Change black empty tile to grass and make it destructable
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user