smolfix -> time to destroy based on cycleArray
@@ -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
{