Get_Bentley Posted September 17, 2017 Share Posted September 17, 2017 Hey All, Last night decided to give Phaser 3 Beta a whirl, so far has been an interesting journey trying to figure everything out. So basically my question here is I cannot seem to destroy/kill a sprite, basically what I am doing in a very simple form is testing the new functionality and making a sprite interactive and what I want is to have to sprite destroyed/killed on a click (simple I know), but for the life of me after going through the examples I do not see a way to do this. I know it is probably right in front of my nose but if someone could help me out or point me in the right direction I would greatly appreciate it! Right after posting this I have found this functionality but am not quite sure if it the correct way to destroy/kill a sprite. Let me know if anyone has any opinions or guidance. this.input.events.on('POINTER_DOWN_EVENT', function (event) { event.gameObject.setActive(false); event.gameObject.setVisible(false); }); Thank you all! Link to comment Share on other sites More sharing options...
rich Posted September 28, 2017 Share Posted September 28, 2017 Just to say that I worked on this quite a bit the other day. There's a full example here: http://labs.phaser.io/view.html?src=src\input\game object\destroy sprite on down event.js Link to comment Share on other sites More sharing options...
Recommended Posts