Grass becomes grass saplings when walked over
This commit is contained in:
@@ -2,6 +2,7 @@ export const TileType = {
|
||||
EMPTY: 1,
|
||||
WALL: 4,
|
||||
GRASS: 15,
|
||||
GRASS_SAPLINGS: 2,
|
||||
EMPTY_DECO: 24,
|
||||
WALL_DECO: 12,
|
||||
EXIT: 8,
|
||||
@@ -21,7 +22,8 @@ export interface TileBehavior {
|
||||
export const TILE_DEFINITIONS: Record<number, TileBehavior> = {
|
||||
[TileType.EMPTY]: { id: TileType.EMPTY, isBlocking: false, isDestructible: false },
|
||||
[TileType.WALL]: { id: TileType.WALL, isBlocking: true, isDestructible: false },
|
||||
[TileType.GRASS]: { id: TileType.GRASS, isBlocking: false, isDestructible: true, isDestructibleByWalk: true, destructsTo: TileType.EMPTY },
|
||||
[TileType.GRASS]: { id: TileType.GRASS, isBlocking: false, isDestructible: true, isDestructibleByWalk: true, destructsTo: TileType.GRASS_SAPLINGS },
|
||||
[TileType.GRASS_SAPLINGS]: { id: TileType.GRASS_SAPLINGS, isBlocking: false, isDestructible: false },
|
||||
[TileType.EMPTY_DECO]: { id: TileType.EMPTY_DECO, isBlocking: false, isDestructible: false },
|
||||
[TileType.WALL_DECO]: { id: TileType.WALL_DECO, isBlocking: true, isDestructible: false },
|
||||
[TileType.EXIT]: { id: TileType.EXIT, isBlocking: false, isDestructible: false },
|
||||
|
||||
@@ -242,6 +242,9 @@ function decorate(width: number, height: number, tiles: Tile[], random: () => nu
|
||||
// Create grass patches where noise is above threshold
|
||||
if (grassValue > 0.35) {
|
||||
tiles[i] = TileType.GRASS;
|
||||
} else if (grassValue > 0.25) {
|
||||
// Transition zone: Saplings around grass clumps
|
||||
tiles[i] = TileType.GRASS_SAPLINGS;
|
||||
} else {
|
||||
// Floor decorations (moss/rocks): clustered distribution
|
||||
const decoValue = decorationNoise.get((x + decorOffset) / 8, (y + decorOffset) / 8);
|
||||
|
||||
Reference in New Issue
Block a user