forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNextState.js
More file actions
34 lines (30 loc) · 699 Bytes
/
Copy pathNextState.js
File metadata and controls
34 lines (30 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var TWEEN_CONST = require('../const');
var NextState = function ()
{
if (this.loopCounter > 0)
{
this.resetTweenData(true);
this.elapsed = 0;
this.progress = 0;
this.loopCounter--;
if (this.loopDelay > 0)
{
this.countdown = this.loopDelay;
this.state = TWEEN_CONST.LOOP_DELAY;
}
else
{
this.state = TWEEN_CONST.ACTIVE;
}
}
else if (this.completeDelay > 0)
{
this.countdown = this.completeDelay;
this.state = TWEEN_CONST.COMPLETE_DELAY;
}
else
{
this.state = TWEEN_CONST.PENDING_REMOVE;
}
};
module.exports = NextState;