jaevelgames Posted March 27, 2015 Share Posted March 27, 2015 Hi! I'm making this classic defender game, where the enemies(Sprites) are rushing from the top of the screen to the bottom, and you're supposed stop them with bombs. When a bomb detonates close enough to an enemy, the enemy is removed with removeChild(). This works fine. However! The point of the child is still moving downward (though invisible), and it's possible to continue hitting it although the child is gone. I'm using console.log(stage.children.length) to see if the enemy sprite really is gone, and it is. How comes? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
jaevelgames Posted March 27, 2015 Author Share Posted March 27, 2015 Oops. Forgot to splice away the enemy from the array containing and updating it. Sorry! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.