PDA

View Full Version : Platformer score animations



rjdfhorn_06
May 12th, 2009, 07:48 PM
I am currently working on a platformer where the character runs, jumps, collects items, etc. Right now, if the character touches a collectible like a coin, it disappears using unloadMovie(). I want to be able to add a score animation, e.g. when the coin disappears, a "100" symbol appears letting the player know that the coin was worth 100 points). Does anyone know a good way to accomplish this? Right now I have a movieclip with an animation (making the "100 symbol" float into the air for 6 frames) show up everytime a coin is touched. I can't get it work properly. Any help is greatly appreciated. Any suggestions on how to accomplish this/make it work better?

SparK_BR
May 14th, 2009, 02:37 AM
make it a 1 second anim with fadeout and stuff
then in the last frame of animation you put this action:

removeMovieClip();

go to the library in the linkage properties, check the export for action script option and use a nice name there
then you simply use

var obj = attachMovie("<name>", <newName>, <depth>);
obj.x = ...
obj.y = ...
that code will do the job

ps: this is for AS2 if it's AS3 then i dunno