fix animationcycle not cycling all frames in an animation, immediately switch subimage on animation trigger
@@ -33,9 +33,8 @@ class Renderer
33
33
{
34
34
this.cycle.timer -= this.cycle.cycleSpeed;
35
35
36
this.cycle.cycleArray[this.cycle.current + 1] ?
37
this.updateCycleSprite(this.cycle.current + 1) :
38
this.updateCycleSprite(0);
36
let next = (this.cycle.current + 1) % this.cycle.cycleArray.length;
37
this.updateCycleSprite(next)
39
38
}
40
39
}
41
40
}
@@ -114,6 +113,8 @@ class Renderer
114
113
current: defaultIndex,
115
114
cycleSpeed: cycleSpeed,
116
115
timer: 0};
116
117
this.subImage = this.cycle.cycleArray[this.cycle.current];
117
118
}
118
119
119
120
setAnimationCycleSpeed(cycleSpeed)
@@ -33,9 +33,8 @@ class Renderer33
{33
{34
this.cycle.timer -= this.cycle.cycleSpeed;34
this.cycle.timer -= this.cycle.cycleSpeed;35
35
36
this.cycle.cycleArray[this.cycle.current + 1] ?36
let next = (this.cycle.current + 1) % this.cycle.cycleArray.length;37
this.updateCycleSprite(this.cycle.current + 1) :37
this.updateCycleSprite(next)38
this.updateCycleSprite(0);39
}38
}40
}39
}41
}40
}@@ -114,6 +113,8 @@ class Renderer114
current: defaultIndex, 113
current: defaultIndex, 115
cycleSpeed: cycleSpeed,114
cycleSpeed: cycleSpeed,116
timer: 0};115
timer: 0};116
117
this.subImage = this.cycle.cycleArray[this.cycle.current];117
}118
}118
119
119
setAnimationCycleSpeed(cycleSpeed) 120
setAnimationCycleSpeed(cycleSpeed)