Graveyard terrain and background tiles implemented

This commit is contained in:
Mal
2025-05-16 23:08:35 +02:00
parent e97c04ed19
commit fc990c12aa
25 changed files with 504 additions and 50 deletions

View File

@@ -11,6 +11,10 @@ export class FullscreenEffect
{
}
destroy()
{
}
update(timestamp)
{
}

View File

@@ -48,4 +48,12 @@ export class RainEffect extends FullscreenEffect
}
}
}
destroy()
{
super.destroy();
this.sound.pause();
this.sound.remove();
}
}

View File

@@ -48,4 +48,12 @@ export class SnowEffect extends FullscreenEffect
}
}
}
destroy()
{
super.destroy();
this.audio.pause();
this.audio.remove();
}
}

View File

@@ -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();
}
}
}