Sign in to follow this  
jeteran

TimeBomb on AS. How to add it's own time?

Recommended Posts

jeteran    311
Hi guys from the net. I have a problem. I'm making a game that some enemies are going to pass thro and you have to guess the exact momentum that the enemy is going to pass thro the screen and with a click, you are going to place a bomb with a timer (say 5 secs). If it bombs (hitTest) the enemy, dies, ++score. I have pretty much everything, but I have problem assigning a timer for each bomb. I made a bomb layer, and goes something like this: createBomb = function(type, x, y) { var nm = "bomb" + count; bombLayer.attachMovie(type, nm, count); bombLayer[nm]._x = x; bombLayer[nm]._y = y; bombLayer[nm].bombID = setInterval(bombLayer[nm].makeTimeBomb, 1000); //here comes the .onEnterFrame() and now, where do i place this? makeTimeBomb= function() { timeBomb--; timeBomb_txt.text = timeBomb; } I can easily do it with animations, but I prefer to program it. If I don't get it very soon, I will do it with anims. Help me please. Thank you guys!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this