Timer#repeat()

repeat(delay, repeatCount, callback, callbackContext, arguments) → {Phaser.TimerEvent}

Adds a new TimerEvent that will always play through once and then repeat for the given number of iterations.

The event will fire after the given amount of delay in milliseconds has passed, once the Timer has started running.
The delay is in relation to when the Timer starts, not the time it was added.
If the Timer is already running the delay will be calculated based on the timers current time.

Make sure to call start after adding all of the Events you require for this Timer.

Parameters
Name Type Argument Description
delay integer

The number of milliseconds, in game time, before the timer event occurs.

repeatCount number

The number of times the event will repeat once is has finished playback. A repeatCount of 1 means it will repeat itself once, playing the event twice in total.

callback function

The callback that will be called when the timer event occurs.

callbackContext object

The context in which the callback will be called.

arguments * <repeatable>

Additional arguments that will be supplied to the callback.

Returns

The Phaser.TimerEvent object that was created.

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

Please login to continue.