diff --git a/src/core/terrain.ts b/src/core/terrain.ts index 47249d3..d319230 100644 --- a/src/core/terrain.ts +++ b/src/core/terrain.ts @@ -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 = { [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 }, diff --git a/src/engine/world/generator.ts b/src/engine/world/generator.ts index 528e2b1..72a666d 100644 --- a/src/engine/world/generator.ts +++ b/src/engine/world/generator.ts @@ -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);