Jump to content

removed children still around


jaevelgames
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...