mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Graveyard terrain and background tiles implemented
This commit is contained in:
@@ -18,6 +18,7 @@ export class ThunderstormEffect extends FullscreenEffect
|
||||
new Audio('js/effects/thunder04.mp3'),
|
||||
];
|
||||
this.currentSound = 0;
|
||||
this.isActive = true;
|
||||
}
|
||||
|
||||
shuffleSounds(iterations = 10)
|
||||
@@ -60,6 +61,10 @@ export class ThunderstormEffect extends FullscreenEffect
|
||||
|
||||
setTimeout(
|
||||
() => {
|
||||
if (!this.isActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.currentSound === 0) {
|
||||
this.shuffleSounds();
|
||||
}
|
||||
@@ -85,4 +90,14 @@ export class ThunderstormEffect extends FullscreenEffect
|
||||
context.fillStyle = 'rgba(255, 255, 255, ' + this.currentAlpha + ')';
|
||||
context.fillRect(0, 0, context.canvas.width, context.canvas.height);
|
||||
}
|
||||
|
||||
destroy()
|
||||
{
|
||||
this.isActive = false;
|
||||
|
||||
for (const sound of this.sounds) {
|
||||
sound.pause();
|
||||
sound.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user