Hi guys
I'm trying to remove a sprite using a tweens onComplete function. I'm not sure how to make the function retain the correct reference to that sprite, so it doesn't throw an error when there are a few sprites on the screen.
In javascript, I think you would use bind()?
Any help would be awesome
Thank you!
Comments
Another option could be to use a single global table where every entry is a reference to a sprite you may need to remove. It's not cool to use global vars, but in this scenario you would get rid of it as soon as you no longer need it.
I think you're right, it seems to retain a reference to it I was worried it wouldn't work but after testing, everything is fine
Thanks for the help!