fix: correct collision message and improve asset loading

- Fix typo in collision message from "Ihr seit koolidiert!" to "Es gab eine Kollision!"
- Reorder TODO comment in endGame method
- Rename "Früchte" folder to "Fruits" for consistency
- Add TileLoader class to preload and cache game assets
- Refactor Overlay class to use TileLoader for improved image handling
This commit is contained in:
2025-04-28 14:59:18 +02:00
parent f450526375
commit 76392172b5
9 changed files with 47 additions and 12 deletions

View File

@@ -56,9 +56,9 @@ class Playground{
// Falls overlay vorhanden darauf rendern
const overlay = this.overlays[y][x];
if(!overlay.src) continue;
this.ctx.save();
// Rotation anwenden | Bisschen Komplexes Mathe Funzt :)
this.ctx.save();
const centerX = posX + this.tileSize / 2;
const centerY = posY + this.tileSize / 2;
this.ctx.translate(centerX, centerY);
@@ -74,6 +74,7 @@ class Playground{
this.overlays.forEach(row => {
row.forEach(overlay => {
overlay.src = null;
overlay.image = null;
overlay.deg = 0;
})
})