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

Started by
0 comments, last by jeteran 16 years, 2 months ago
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!!
Advertisement
Any request?

Thank you guys!

This topic is closed to new replies.

Advertisement