BlueGit

blue-star speeltuin

smolfix -> time to destroy based on cycleArray

timfa wsadhelios · pushed by timfa

Authored 2022-10-19 · 4 years ago

Hash
9e0a9f6ea368e5d70496b7891db866373730f1cf
Parent
d12b84a6
1 file changed +1 −2
src/minigame/frog/floorTileDestroyer.js +1 −2
@@ -9,14 +9,13 @@ class FloorTileDestroyer extends GameObject{
9 9
10 10 this.renderer.setAnimation("destroy",0 , animationLength);
11 11
12 this.timeOfDestroy = this.renderer.sprite.subImages * animationLength;
12 this.timeOfDestroy = this.renderer.cycle.cycleArray.length * animationLength;
13 13 }
14 14
15 15 update(deltaTime)
16 16 {
17 17 super.update(deltaTime);
18 18
19
20 19 this.timer += deltaTime;
21 20 if(this.timer > this.timeOfDestroy)
22 21 {
@@ -9,14 +9,13 @@ class FloorTileDestroyer extends GameObject{
9
9
10 this.renderer.setAnimation("destroy",0 , animationLength);
10 this.renderer.setAnimation("destroy",0 , animationLength);
11
11
12 this.timeOfDestroy = this.renderer.sprite.subImages * animationLength;
12 this.timeOfDestroy = this.renderer.cycle.cycleArray.length * animationLength;
13 }
13 }
14
14
15 update(deltaTime)
15 update(deltaTime)
16 {
16 {
17 super.update(deltaTime);
17 super.update(deltaTime);
18
18
19
20 this.timer += deltaTime;
19 this.timer += deltaTime;
21 if(this.timer > this.timeOfDestroy)
20 if(this.timer > this.timeOfDestroy)
22 {
21 {