Skip to content

Commit 697ba8b

Browse files
committed
allow a timer to have a start delay
1 parent 10a3706 commit 697ba8b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/time/Timer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,16 @@ Phaser.Timer.prototype = {
231231
/**
232232
* Starts this Timer running.
233233
* @method Phaser.Timer#start
234+
* @param {number} startDelay - The number of milliseconds that should elapse before the Timer will start.
234235
*/
235-
start: function () {
236+
start: function (startDelay) {
236237

237238
if (this.running)
238239
{
239240
return;
240241
}
241242

242-
this._started = this.game.time.now;
243+
this._started = this.game.time.now + (startDelay || 0);
243244

244245
this.running = true;
245246

0 commit comments

Comments
 (0)