Funktionierender Punktestand durch Äpfel und Blaubeeren

This commit is contained in:
2025-04-24 18:20:30 +02:00
parent 4f337778df
commit 7cafc07bf1
9 changed files with 193 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ class Loop{
this.game.playGround.resetOverlay();
const tiles = data.playground.tiles;
// Spielfeld Zeichenen
tiles.forEach((row, x) => {
row.forEach((tile, y) => {
if(!tile) return;
@@ -23,11 +24,21 @@ class Loop{
tile.deg
)
this.game.playGround.setOverlay(x, y, overlay);
}
else if(tile.class === "Fruit"){
const overlay = new Overlay(
`./assets/Früchte/${tile.type}.png`
)
this.game.playGround.setOverlay(x, y, overlay);
}
})
});
// Score Anzeigen
this.game.uiManager.score.innerText = `${data.score}`;
this.game.playGround.draw();
}
}