pimous Posted March 23, 2015 Share Posted March 23, 2015 Hi everyone,I juste have a little question. How can I do for doing something evey 5 secondes ? Link to comment Share on other sites More sharing options...
valueerror Posted March 23, 2015 Share Posted March 23, 2015 game.time.events.loop(5000, myfunc); Link to comment Share on other sites More sharing options...
pimous Posted March 23, 2015 Author Share Posted March 23, 2015 thanks Link to comment Share on other sites More sharing options...
pimous Posted March 23, 2015 Author Share Posted March 23, 2015 But now I would like to call a fonction with properties, how can I do that ? Something like this ...game.time.events.loop(5000, myfunc(2)); Link to comment Share on other sites More sharing options...
valueerror Posted March 23, 2015 Share Posted March 23, 2015 http://phaser.io/docs/2.2.2/Phaser.Timer.html#loop probably more like this:game.time.events.loop(5000,myfunc,this, parameter);myfunc(parameter)be aware that if you would write it your way the function myfunc(2) would be triggered immediately because of the () brackets or if it's just a simlpe task that is going to be triggeredgame.time.events.loop(5000, function(){ do this or that }); Link to comment Share on other sites More sharing options...
Recommended Posts