|
I have been learning flash and I just began learning action script. I am making a crude game of where a graphic follows you and you have to move so that you do not get hit by the box. I have gotten everything scripted properly, including the hittest, etc, but there is only one problem. I have set up the following box ( referred to as "enemy" from here on out) so that it will increase in speed after a certain amount of time. For this time, i used the Timer(); function. what this does is that it takes the time that has elapsed from the beginning of the movie. whenever the enemy hits the player, you are taken to another frame where it says you lose and has a button that takes you back to the game frame. The problem is that when i press this button, the enemy is still moving VERY fast, as if the timer had already elapsed. I want to know if there's either
1) a way to restart the movie completely, so that the Timer(); function is also restarted
or
2) another method to measure the time elapsed since the game started (or frame started since its all on one frame)
I hope this makes sense, and thnx for ur time. If you have any questions, feel free to reply.
|