forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInit.js
More file actions
41 lines (32 loc) · 1.02 KB
/
Copy pathInit.js
File metadata and controls
41 lines (32 loc) · 1.02 KB
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
35
36
37
38
39
40
41
var TWEEN_CONST = require('../const');
// Return true if this Tween should be moved from the pending list to the active list
var Init = function ()
{
var data = this.data;
var totalTargets = this.totalTargets;
for (var i = 0; i < this.totalData; i++)
{
var tweenData = data[i];
var target = tweenData.target;
var gen = tweenData.gen;
tweenData.delay = gen.delay(i, totalTargets, target);
tweenData.duration = gen.duration(i, totalTargets, target);
tweenData.hold = gen.hold(i, totalTargets, target);
tweenData.repeat = gen.repeat(i, totalTargets, target);
tweenData.repeatDelay = gen.repeatDelay(i, totalTargets, target);
}
this.calcDuration();
this.progress = 0;
this.totalProgress = 0;
// console.log('Tween duration', this.duration, 'totalDuration', this.totalDuration);
if (this.paused)
{
this.state = TWEEN_CONST.PAUSED;
return false;
}
else
{
return true;
}
};
module.exports = Init;