mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
This commit addresses three critical issues identified during testing: 1. **Fixed mixed room size door alignment (Issue #1)** - Updated room positioning logic in positionNorthMultiple, positionSouthMultiple, positionEastMultiple, and positionWestMultiple functions - Rooms are now positioned centered on their corresponding door positions - Ensures doors align properly between different-sized rooms (e.g., 1×1 GU closet connecting to 2×1 GU hallway) - Uses same door spacing logic as door placement (edgeInset + doorSpacing) 2. **Implemented East/West single-tile doors (Issue #2)** - Changed door_side_sheet_32 from image to spritesheet (6 frames, 32×32px each) - Updated door sprite creation to use single tile per room for east/west doors - West-facing doors (left room) now properly flip horizontally - Doors positioned 3 tiles down from top (TILE_SIZE * 2) as specified - Updated wall tile removal and animated door creation to use correct dimensions - Both sides of east/west connections now use matching door system 3. **Added connection limit validation (Issue #3)** - Created validateMultipleConnections function to check if connections fit - Validates that multiple connections won't cause rooms to overhang excessively - Logs detailed error messages with recommendations when connections don't fit - Example: 2GU room can't have 3 north connections (not enough width) - Helps developers identify invalid room layouts during scenario design Files modified: - js/core/game.js: Load door_side_sheet_32 as spritesheet - js/core/rooms.js: Fix positioning, add validation - js/systems/doors.js: Single-tile east/west doors with flipping - js/systems/collision.js: Update wall tile removal for single-tile doors