Ok, for the game that I am creating at the moment I have a health bar animation that starts off full and empties as time goes on. When the health bar is empty it goes to the gameover screen. This part works fine.
What I would like to happen is when the user runs into a target for the bar to increase by 10%, giving the user more time. The way it is set up at the moment the healthbar movieclip has the instance name "healthbar" .
Inside this are 100 frames showing the bar going down (shape tween broken down into keyframes). 1 is the full healthbar, 0 is the empty healthbar.
On the target I have the following code:
//10 is the number of frames I would like to increase the bar by
_root.healthbar += 10;
However the bar just seems to keep going down. I think I need to find out the current frame the bar is at before adding 10 pixels to it but dont know how. Any help, can provide the .Fla if needed.
Thanks,
Martin
What I would like to happen is when the user runs into a target for the bar to increase by 10%, giving the user more time. The way it is set up at the moment the healthbar movieclip has the instance name "healthbar" .
Inside this are 100 frames showing the bar going down (shape tween broken down into keyframes). 1 is the full healthbar, 0 is the empty healthbar.
On the target I have the following code:
//10 is the number of frames I would like to increase the bar by
_root.healthbar += 10;
However the bar just seems to keep going down. I think I need to find out the current frame the bar is at before adding 10 pixels to it but dont know how. Any help, can provide the .Fla if needed.
Thanks,
Martin
Comment