Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!