AbdSab Posted February 12, 2015 Share Posted February 12, 2015 Hi all; I have a little probleme with the timer:generator[id] = enemyGenerators.create(i*32,j*32,'eGenerator');generator[id].timer = this.game.time.events.loop(1500, this.addEnemy, this);So i want from to give to the timer function the x, y parametres, but i don't know how, because i can't write like that: generator[id].timer = this.game.time.events.loop(1500, this.addEnemy(generator[id].x,generator[id].y), this);Is there any solution please ? And thank you all very much Link to comment Share on other sites More sharing options...
mxmlb Posted February 12, 2015 Share Posted February 12, 2015 Hello, In order to pass arguments, you might need to create a new Phaser.Timer instead of relying on your game timer.This way, you can pass arguments to .loop() as you can see in the documentation : http://docs.phaser.io/Phaser.Timer.html#loop AbdSab 1 Link to comment Share on other sites More sharing options...
AbdSab Posted February 12, 2015 Author Share Posted February 12, 2015 Thank you very much you saved my life Link to comment Share on other sites More sharing options...
Recommended Posts