Khaihkd Posted March 19, 2014 Share Posted March 19, 2014 When the game over , I want to remove loop. Because it always running. If I restart game now, loop was duplicated. Please help me. Thank you very much Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 19, 2014 Share Posted March 19, 2014 I think this is what you are looking for:game.time.events.stop(); Link to comment Share on other sites More sharing options...
Khaihkd Posted March 20, 2014 Author Share Posted March 20, 2014 Thank you ctmartinez1992. I was trying this, but it's not working Link to comment Share on other sites More sharing options...
mamwalter Posted March 20, 2014 Share Posted March 20, 2014 it's one of the examples: http://examples.phaser.io/_site/view_full.html?d=time&f=remove+event.js&t=remove%20event.var myLoop = game.time.events.loop(Phaser.Timer.SECOND * 20 , callbackLoop, this);game.time.events.remove(myLoop); Khaihkd and quiphop 2 Link to comment Share on other sites More sharing options...
Khaihkd Posted March 21, 2014 Author Share Posted March 21, 2014 thank you mamwalter. issues have been resolved Link to comment Share on other sites More sharing options...
valueerror Posted March 21, 2014 Share Posted March 21, 2014 IMHO the best way is to add all timer events to an array and then make a forloop over the array to clear all eventsfor (var i=0; i<timerEvents.length; i++){ game.time.events.remove(timerEvents[i]); }btw... mark thread as answered plz.. Pooya72 and Robert O'Rourke 2 Link to comment Share on other sites More sharing options...
Recommended Posts