Schlangen werden angezeigt aber sind noch nicht bewegbar

This commit is contained in:
2025-04-10 21:04:52 +02:00
parent 125639cfa1
commit d669420a4f
9 changed files with 250 additions and 24 deletions

View File

@@ -10,7 +10,23 @@ class Loop{
}
loop(data){
this.game.playGround.resetOverlays();
const tiles = data.playground.tiles;
tiles.forEach((row, x) => {
row.forEach((tile, y) => {
if(!tile) return;
console.log(tile)
if(tile.class === "Snake"){
/** @type {HTMLImageElement} */
const tileImg = this.game.playGround.getOverlayTile(x, y);
tileImg.src = `./assets/Snakes/${tile.color}/${tile.type}.png`;
tileImg.style.display = "block"
tileImg.style.transform = `rotate(${tile.deg}deg)`;
}
})
});
}
}