cocolanse Posted May 23, 2017 Share Posted May 23, 2017 How to bind the wizard for a second to automatically delete the method! Kill the wizard after 1 second, bind this wizard After 1 second kill sprite, bind this sprite Link to comment Share on other sites More sharing options...
cocolanse Posted May 23, 2017 Author Share Posted May 23, 2017 Bind in itself Not bound to a click event Link to comment Share on other sites More sharing options...
Jammy Posted May 23, 2017 Share Posted May 23, 2017 something like this? wizard.killTimer = 60; update() { wizard.killTimer -= 1*delta; if(wizard.killTimer<0) {wizard.destroy()} } Link to comment Share on other sites More sharing options...
Abhishek Singhal Posted May 29, 2017 Share Posted May 29, 2017 Maybe you should use native JS setTimeout like this : var wizard = some instantiation; setTimeout(function(){ // CLEANUP CODE GOES HERE. }.bind(this), 1000); the function will execute only once. Link to comment Share on other sites More sharing options...
Recommended Posts