Change black empty tile to grass and make it destructable

This commit is contained in:
Peter Stockings
2026-01-05 20:59:33 +11:00
parent a7091c70c6
commit ecf58dded1
8 changed files with 150 additions and 43 deletions

View File

@@ -110,6 +110,15 @@ export class DungeonRenderer {
// Update Tiles
this.layer.forEachTile(tile => {
const i = idx(this.world, tile.x, tile.y);
const worldTile = this.world.tiles[i];
// Sync visual tile with logical tile (e.g. if grass was destroyed)
if (tile.index !== worldTile) {
// We can safely update the index property for basic tile switching
// If we needed to change collision properties, we'd use putTileAt
tile.index = worldTile;
}
const isSeen = seen[i] === 1;
const isVis = visible[i] === 1;