PDA

View Full Version : [AS3] Efficient method for player graphic changes


pondwater
09-10-2009, 09:38 PM
What is an effective method for making sure the players graphic is correct. For example, im creating a platformer and there will be a multitude of player graphic changes depending on what the character is pressing and whats going on at the time. These include:

standing left and right
running left and right
ducking left and right
attacking left and right
duck attacking left and right
attacking up
shooting left and right
duck shooting left and right
shooting upwards left and right
jumping
falling
landing
etc.

The player movieClip stores all of these and i use the gotoAndPlay (#); fucntion to switch between.

As you can see it gets a bit hectic and i find myself currently working on a 1,500 line code and about 800 of those lines are attempting to make sure the correct graphic is in place and ensuring a smooth transition between them.

Any suggestions? is there a tutorial on this?

tango88
09-11-2009, 06:03 AM
There's something called 'blitting' that you could try. I think you'll find some tutes on 8bitrocket.com