mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 19:28:03 +00:00
The previous fix attempted to position rooms based on door positions, but grid alignment (alignToGrid) was rounding positions to 160px boundaries, breaking the precise positioning needed for door alignment. Issue: When test_mixed_room_sizes.json loaded, the closet room was positioned at (-160, -256) but its door was at (48, -96). The door was 48px to the right of the room's bounds, completely outside the room tiles. Root cause: Grid alignment was rounding x=-32 to x=-160, shifting the room 160px to the left. Solution: Remove alignToGrid calls for multiple room connections and use exact positioning: - North/South: roomX = doorX - edgeInset (positions room so door is at edgeInset from left) - East/West: roomY = doorY - (TILE_SIZE * 2) (positions room so door is 2 tiles from top) This ensures doors are positioned within room bounds and align properly between different-sized rooms (e.g., 1×1 GU closet, 2×1 GU hall, 2×2 GU CEO office).