Adko20 Posted July 26, 2014 Share Posted July 26, 2014 Hi guys, I need your help again. So I past here part of my code.var play_state = { create: function() { spawnTimerBarrier = 6000; this.timerForBarriers = this.game.time.events.loop(spawnTimerBarrier, this.add_row_of_barriers, this); }, update: function() { this.update_speed(); }, update_speed: function() { switch(level){ case 10: { this.game.time.events.remove(this.timerForBarriers); spawnTimerBarrier = 2000; this.timerForBarriers = this.game.time.events.loop(spawnTimerBarrier, this.add_row_of_barriers, this); } } },}; So It works fine, except this line: this.timerForBarriers = this.game.time.events.loop(spawnTimerBarrier, this.add_row_of_barriers, this); .... It doesn´t create new events loop with new value of spawnTimerBarrier. PLS help me Link to comment Share on other sites More sharing options...
lewster32 Posted July 26, 2014 Share Posted July 26, 2014 Not entirely sure what's going on here, but you can alter the TimerEvent.delay property to just change the interval at which the loop occurs: update_speed: function() { switch(level){ case 10: { this.timerForBarriers.delay = 2000; } } }, Link to comment Share on other sites More sharing options...
Adko20 Posted July 26, 2014 Author Share Posted July 26, 2014 lewster32 You are incredible, thx man lewster32 1 Link to comment Share on other sites More sharing options...
Recommended Posts