Skip navigation
Currently Being Moderated

removin bullets from stage after game over

Apr 7, 2012 2:11 AM

in my game enemy Planes shoot at my plane and everything is working fine

enemy bullets are inside an array

the problem is when my plane gets destroyed by enemy Planes ,the last bullets shot by the enemyPlanes still shows on the screen

eventhough i called a removelistener function and added a game over screen

enemy planes use timer which i have a listener for it

how can i remove the last bullets that still shows on the screen?

  • Currently Being Moderated
    Apr 7, 2012 4:59 AM   in reply to mr.shumi

    If the bullets are stored in an array, then use removeChild to remove them and set any references to them as null.  Empty the array when you are done.

    Mark as:
  • Currently Being Moderated
    Apr 7, 2012 5:57 AM   in reply to mr.shumi

    I am not sure why you are showing the code without any explanation, but I do not see where you are removing any of the bullets in your endGame function, which is where you say you wanted them to go away... you only do it in your moveEnemyBullet function

    Mark as:
  • Currently Being Moderated
    Apr 7, 2012 10:52 AM   in reply to mr.shumi

    yep, and clear the array

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points