Tutorial: install TweenMax libs ActionScript 3 with Flash IDE for beginners

About Tweenmax

In this tutorial I will show you how to include the TweenMax ActionScript 3.0 libs in Flash.
The TweenMax libs are available in ActionScript 3.0 and 2.0 developed by the GreenSock team.

This libs can help you a lot in game development.

You can easily use this libs to :

  • Move objects
  • Call functions with delay
  • Morph colors or alpha
  • Use easing : (Bounce, elastic, slow down, …)
  • Handle: timers, tweens and animations with one class.

In few words: This libs kicks ass !

Here some examples. I picked up this swf from greensock.com :

Let’s start

Installation

Download the TweenMax libraries form the website : http://www.greensock.com/tweenmax/

greensock

Then unzip the file.

Open Flash and create a new ActionScript 3.0 file

flash

Then add the libraries to your file by clicking on the wrench.

as3

  1. Click on the Library path tab
  2. Click on the “+”
  3. Click on the swc icon
  4. Select the greensock.swc from the folder you just unzip.
  5. And click OK

add_tweenmax_libs

Annnnnnnnd…. It’s done!

ActionScript 2: setTimeout call a function with a delay

Just in case you forgot how to call a function with a delay or with parameters in ActionScript 2 (as2).
If you are looking for the ActionScript 3 version see this post.
I will show you how to do that, it’s really simple:

That’s all :)

Tutorial: Export your Flash animations on iPhone and iPad with cocos2d and TexturePacker

Hello,

In this tutorial I will show you how to build and use a flexible animation .swf  for universal use (iPhone, iPad and retina display) with cocos2D-iPhone 2.0.

I always use Adobe Flash to make games, whatever the support.

Flash is an amazing tool for game developer: WYSIWYG layout, animation tool, vector graphics editor.
Do you want to scale up you entire animation? No problem if you work with vector graphics.

You can download the final AnimatedSpriteWithFlash.zip file.

1. Tools and files

You need some tools and one Class made for Cocos2D in Objective-C.

  • Download and install the last Cocos2D-iPhone 2.0 libraries with templates in XCode.
  • Download and install Adobe Flash.
  • Download and install TexturePacker.
  • Download the AnimationSprite class from github.
  • Download the Flash animations example : Pig.zip


2. Flash

In Flash

  • Open pig_walk.fla and pig_dead.fla with Adobe Flash.
  • Then export you animation with CMD+Enter or CTRL+Enter for windows users.
  • Flash will export a swf file in the same folder: pig_walk.swf and pig_dead.swf.

Flash Tips

  • Create a dummy cross in the middle of the sprite. Only for position reference purpose. Remove it before exporting your animation or set the layer as a Guide to hide it.
  • Use the same stage dimensions for the same object.
  • Use graphic symbols instead MovieClip. Because graphic animations can be exported with TexturePacker.

Capture d’écran 2013-03-01 à 17.45.44

  • Create one .fla file per animation.
  • Always work for the iPad retina scale (2048×2048). May be you will export your project for iPad in the future :).

3. TexturePacker

In TexurePacker

Let’s use a default export for universal application with a compressed spritesheet altlas.

  1. Drag and drop pig_walk.swf and pig_dead.swf in TexturePacker
  2. Click on the […] on the data file textfield, chose your export folder and enter the name pig-ipadhd.plist (For universal application)
  3. Texture format set zlib compr, PVR (.pvr.ccz, Ver.2)
  4. Check Premultiply alpha
  5. AutoSD: set cocos2D ipad/hd/sd and hit apply.
  6. Save the file and hit Publish: TexturePacker will export 6 files, the pvr texture file with the plist database file for each scale (ipad/hd/sd).

pig

TexturePacker tips

  • Set the Image format to RGBA4444 if you want to optimise your media. And Set the Dithering to FloydSteinbergAlpha (Better gradient effect with RGBA4444).
  • Always work with the same framerate in  your animations: Flash XCode.
  • The max size is 4096×4096 for retina device and 2048×2048 for iPhone 3GS. But TexturePacker will adapt the max size.
  • Check Allow rotation
  • Set size contraints to Any size
  • If you sprites are cropped in you game set Trim mode to None
  • Check Enable auto alias
  • Be curious and test any settings… :)

4. XCode

in Xcode

  • Create a new Cocos2D project template with XCode.
  • Set iOS deployment Target to 5.1 at least.
  • Add the AnimatedSprite.m and the AnimatedSprite.h files into your XCode project. Don’t forget to check the target.

Capture d’écran 2013-03-02 à 11.56.56

  • If you don’t use ARC in your current project set a flag in the Target > Build Phases > And set the compiler flag to the filename AnimatedSprite.m > –fojbc-arc. NB: By default the ARC is disabled.

Capture d’écran 2013-03-01 à 16.58.30

  • Add all this files into the XCode projet:
    • pig.plist
    • pig.pvr.ccz
    • pig-hd.plist
    • pig-hd.pvr.ccz
    • pig-ipadhd.plist
    • pig-ipadhd.pvr.ccz

Capture d’écran 2013-03-02 à 11.57.02

  • Open the HelloWorldLayer.h and use this header:

  • Then use this code for the HelloWorldLayer.m

Run and see the result.

If you tap on the screen the dead animation will run and the pig will be removed.

That’s all !

Capture d’écran 2013-03-04 à 00.09.40

See the AnimatedSprite.h you will see all the public methods and public properties.

Have fun !

Color Fish

My last creation for Teissiere. An advergame designed and developped with Castor & Pollux. This is a Facebook application with contest.
But the constest is over now. By the way this version is only a demo: Only 6 levels are available.

Color is a little puzzle game with physic based gameplay. The player should solve puzzle with dexterity and ingenuity to pouring syrup into an aquarium.

Play Color Fish

The WTF Game Experience Released!

Hello,

Now you can play “The WTF Game Experience” on Kongregate

The WTF Game Experience is a classic physic based puzzle game with WTF features, famous internet meme references and funny twists.

During a boring party night 2 guys decide to create a giant puzzle game with bottles of beer a funnel, a baseball ball and various accessories.
Find a way to flow the beer into the funnel.

Level Editor: Build your levels and share them. Play thousand original levels made by the community.

Share it, like it, create your levels, and please rate the game.

Thanks ;).

The WTF Game Experience: private beta test

Hello everyone!

I’m working on a new Flash based game with physic engine and original gameplay.
The game is still under development but you are welcome to playtest the beta version.

To play the game click here and type the password: beta

Post your comments and report bugs with the google form at the bottom of the page.
I hope you will enjoy this “new approach”!

Have fun ! ;).

Nano War iOS on indiedb.com

I’m proud to introduce the Nano War iOS page on indiedb.com :

Nano War iPad, iPhone game

The game is currently under development. The beta version is available :
https://testflightapp.com/join/4ee26af02efe08560eb615055e07e376-Nzk2ODU/

Nano War iOS application beta version, looking for beta testers !

Hello smartphone users,

I’m happy to say : The beta version of Nano War iOS will be playable soon. This is a very important step. Do not hesitate to contact me or using the feedback form into the app.
By the way you can sign up at TestFlighApp.com in order to test the beta version of Nano War iOS.

Click on this link and sign up: https://testflightapp.com/join/4ee26af02efe08560eb615055e07e376-Nzk2ODU

This step take 1 minute. Sign up from your iOS device (iPhone and/or iPad) or login from your smartphone. I need you device ID in order to register your device into my application.
Done ? Great ! You will receive the last playable version by email. Open the mail from your iOS device and the application will be installed automatically.

Thank you very much !

Rolling Jump version 1.1 with new features was free yesterday.

Rolling jump version 1.1 was released last week.
Yesterday my game was available for free.

There are about 2000 reviews with ★★★★★. :)

It was 1st on the top 25 on several appstore in Europe. (France, Spain, Belgium, …)

Download Rolling Jump on the appstore.

Download Rolling Jump free on the appstore.

Description

Help Lighty save the light of the world by escaping from the dark evil creatures in this incredibly FUN and ADDICTING game! Simply jump from each wheel up into the sky and stars to protect the light of the world.

In Rolling Jump, your goal is to help the hero, Lighty, jump up into the sky and away from the dark evil creatures as fast as possible. Learn secrets of the game like double tapping, jumping onto walls, and discover how to attain the rainbow path to help Lighty save the light of the world, and ultimately prove his worth.

★ 7 levels to discover the stars
★ Increasing difficulty and real challenge for the hardcore gamers
★ Get a Boost bonus after eating suns and reach the space faster!
★ Avoid the air-ballons that won’t let you jump on a new wheel
★ “Slime” wheels that bump Lighty
★ Multiply your score x10 with perfect jumps
★ Use wall to bounce and reach upper wheels
★ Compete in a worldwide ranking via Game Center
★ Compare your score with your friends and challenge them !
★ Cute Retina graphics

Get free tips and be the first to hear updates about Rolling Jump on Facebook :
http://www.facebook.com/rollingjump

Follow us on Twitter: @Chugulu_US

Thanks for playing and enjoy!

ActionScript: Protect your Flash games on the web, sitelock all your games.

If you want to submit your games on one game portals DO NOT UPLOAD YOUR GAMES WITHOUT A SITELOCK SCRIPT.

WHY ?

Your games can be “stolen” by game portals. Or if you didn’t finish your game it’s a really a “pain in the ass” to update your games spread on all the web.

I tried lot of code for sitelocking my games but some of them are in ActionScript 2.0 or totally out of date. Some of them can’t work with the “https” or without the “www” characters.
Another example when you to want to test your game on your local computer you have to comment the script. And you can forget to uncomment the sitelock script when you submit your game on the web.

So I decided to create my own script.

This is a short version of my script.
But this one is perfect for all uses.

Installation

Copy and Paste this code and add your domains into the array “[ ]” separated by commas :

[“kongregate.com”, …, …]

You can lock the local mode by adding a second parameter : false
The default value is set to true.