Timer#Timer

new Timer(game, autoDestroy)

A Timer is a way to create and manage timer events that wait for a specific duration and then run a callback.
Many different timer events, with individual delays, can be added to the same Timer.

All Timer delays are in milliseconds (there are 1000 ms in 1 second); so a delay value of 250 represents a quarter of a second.

Timers are based on real life time, adjusted for game pause durations.
That is, timer events are based on elapsed game time and do not take physics time or slow motion into account.

Parameters
Name Type Argument Default Description
game Phaser.Game

A reference to the currently running game.

autoDestroy boolean <optional>
true

If true, the timer will automatically destroy itself after all the events have been dispatched (assuming no looping events).

Source code: time/Timer.js (Line 21)
doc_phaser
2017-02-14 11:18:16
Comments
Leave a Comment

Please login to continue.