feat: BSP dungeon generation with 2D ASCII tile map
Replace list-based room display with proper 2D tile map using Binary Space Partitioning. Rooms are carved into a 60x20 grid, connected by L-shaped corridors, and rendered with ANSI-colored ASCII art including fog of war visibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,3 +40,19 @@ func TestRoomTypeProbability(t *testing.T) {
|
||||
t.Errorf("Combat room probability: got %.1f%%, want ~45%%", combatPct)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFloorHasTileMap(t *testing.T) {
|
||||
floor := GenerateFloor(1)
|
||||
if floor.Tiles == nil {
|
||||
t.Fatal("Floor should have tile map")
|
||||
}
|
||||
if floor.Width != 60 || floor.Height != 20 {
|
||||
t.Errorf("Map size: got %dx%d, want 60x20", floor.Width, floor.Height)
|
||||
}
|
||||
// Current room should have floor tiles
|
||||
room := floor.Rooms[0]
|
||||
centerTile := floor.Tiles[room.Y+room.H/2][room.X+room.W/2]
|
||||
if centerTile != TileFloor {
|
||||
t.Errorf("Room center should be floor tile, got %d", centerTile)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user