XekeDeath Posted February 18, 2014 Share Posted February 18, 2014 I attached 4 events to the game timer as an experiment like this: //This state is the Game state in the Boot -> Preloader -> Game state sequence..create: function(){ //Timer..! Woo..! this.game.time.events.loop(Phaser.Timer.SECOND, this.timeMinute, this); this.game.time.events.loop(Phaser.Timer.SECOND*15, this.timeQuarterHour, this); this.game.time.events.loop(Phaser.Timer.SECOND*30, this.timeHalfHour, this); this.game.time.events.loop(Phaser.Timer.MINUTE, this.timeHour, this);}I have some text fields on the screen that display an integer that is incremented in the SECOND event and the MINUTE event.If you guessed that I was making a clock, you guessed correct. I have 2 problems.One may be because of the timer already running at the time of adding the events, not sure, but the MINUTE event fires about half a second after the 60th SECOND event, so it ticks the clocks hour number up after the minutes reset to 00 ( 1:58, 1:59, 1:00, 2:00, 2:01) Problem two is more fun. If I change tabs long enough for an event to fire twice, then the events seem to never stop firing, and my clock goes psycho. Link to comment Share on other sites More sharing options...
rich Posted February 18, 2014 Share Posted February 18, 2014 Yes there are a few github issues related to Timers (and this specifically). I'll be looking into them in more detail later this week. Link to comment Share on other sites More sharing options...
aberrantmind Posted February 19, 2014 Share Posted February 19, 2014 For the second issue i noticed the timer going crazy with browser switching thing a couple days ago. This only happen to me when game.stage.disableVisibilityChange = true; otherwise it is fine. Link to comment Share on other sites More sharing options...
rich Posted February 19, 2014 Share Posted February 19, 2014 Yup it's on github and will be fixed. I know what it is, just getting around to sorting it out. Link to comment Share on other sites More sharing options...
Recommended Posts