jotaSe Posted February 14, 2014 Share Posted February 14, 2014 Hi, I tested phaser 1.1.3 and I used Timer this way: Timer = new Phaser.Timer(game); Timer.onEvent.add(spawnBonus); Timer.add(1); Timer.start(); function stuff(){ Timer.stop(); //stuff... Timer.start(); Timer.add(delay); }Now, using 1.1.5 there's not Timer.onEvent.add, so I change it for this Timer = new Phaser.Timer(game,false); Timer.add(1, spawnBonus, this); Timer.start();But this Timer never start, I have to create a time.event.loop to handle it, but, it's not enough cuz I need to set the delay with a random number. Any help? Jasonfroz 1 Link to comment Share on other sites More sharing options...
Jasonfroz Posted February 18, 2014 Share Posted February 18, 2014 i have like this with Timer not use onEvent loop time Link to comment Share on other sites More sharing options...
coloreddrums Posted February 18, 2014 Share Posted February 18, 2014 I had the same problem and solved it by using timer = game.time.create(false)instead oftimer = new Phaser.Timer(game,false);I am not sure if this is a bug or not... Link to comment Share on other sites More sharing options...
jotaSe Posted February 19, 2014 Author Share Posted February 19, 2014 I had the same problem and solved it by using timer = game.time.create(false)instead oftimer = new Phaser.Timer(game,false);I am not sure if this is a bug or not...Thanks ! Link to comment Share on other sites More sharing options...
Guest Posted February 22, 2014 Share Posted February 22, 2014 Any clues why the following code never calls the event callback?var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });var testTimer;function preload(){}function create(){ testTimer = new Phaser.Timer(game, false); testTimer.add(250, function(){ console.log('Event callback.'); }, this); testTimer.start();}function update(){} Link to comment Share on other sites More sharing options...
Recommended Posts