Jump to content

When you 'kill' a sprite, what happens


Recommended Posts

Trying to find out the best way to, remove a sprite.

I notice there is an add method, but I don't see an accompanying remove method for sprites.


What is the correct method to remove a sprite, currently i'm calling "kill" (my sprites are created using the GameObjectFactory), that doesn't seem to completely remove it, only stop drawing / updating it?


Is this correct? If so what is the right way to go about removing a sprite

Link to comment
Share on other sites

  • 2 weeks later...

I can't seem to find the destroy function on the dev branch, is it no longer being added?

How do we handle removing the inputs, previously I was doing this

 if( this._view.input ) {  this._view.input.destroy(); } this._view.kill();

However this leads to a memory leak after the game is running for a prolonged period of time.

I'll try the work around above for now though

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.

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.


  • Recently Browsing   0 members

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