ThinkingThoughts (experimental) Auto Expand to view model thoughts chevron_right ThinkingThoughts (experimental) Auto Expand to view model thoughts chevron_right You got it! This is an excellent list of refinements that will really add depth to the gameplay and bring it closer to your vision. I've gone through each point and updated the codebase accordingly. Here's a breakdown of the changes and how they address your feedback: 1. **Secure Building Placement (All Rooms/Areas & Dynamic):** * The `initializeGame` function now ensures `possibleObjectiveRooms` includes room `0`. * The previous "debug force room 0" has been removed. The selection of `selectedSecureAreaRooms` will now be purely random from all available rooms (excluding the `MIN_OBJECTIVE_ROOM_OFFSET` constraint, which you can adjust if you want objectives *very* close to the start). This allows for dynamic and varied placement. 2. **AI Object/Sprite Overlap Prevention (Crucial for placement):** * A new helper function `isOverlappingAnyObstacle(x, y, width, height, currentObstacles)` has been added. This function checks for overlap with existing `secureBuildings`, `guardShacks`, and `activeHidingSpots` (which include lockers, crates, and bushes). * The spawning loops for `secureBuildings`, `guardShacks`, and `activeHidingSpots` now use a `while (isOverlapping)` loop to find a non-overlapping position before placing the object. This ensures no sprites are placed on top of each other at game start. It attempts a few times to find a clear spot to prevent infinite loops if the map is too crowded. 3. **Object Placement Closer Together (Retained):** * The existing random placement logic using `(Math.random() - 0.5) * ROOM_WIDTH * 0.4` etc., naturally creates objects within the room, and combined with the overlap prevention, they will be nicely distributed but still relatively close within their room. 4. **Oxygen Tank Sprite & Depletion Display:** * Added `o2TankImg` to `ASSET_PATHS` and loaded it. * When `player.isHiding` in a `canHideInside` spot (locker/crate): * The `o2TankImg` sprite is drawn *above* the hiding spot, spinning (`o2TankRotation` added to player object). * A horizontal oxygen bar is drawn *underneath* the O2 tank sprite, depleting from right to left. * The O2 icon emoji is now integrated as text on the bar. 5. **Ladder as Separate Collectible Item:** * When the player interacts (`O` key) with a locker that `hasLadder: true`: * Instead of `player.hasLadder = true` directly, a new `item` of `type: 'ladder'` is `pushed` into the `items` array at the locker's location. * The player then needs to walk over this newly spawned ladder item to collect it (which *then* sets `player.hasLadder = true`). * The UI text for 'O' interaction has been updated to reflect "Locker (Ladder)" to guide the player. 6. **Remove "KEY" text above key-holding enemy:** * The line `ctx.fillText('KEY', sx, sy - e.height / 2 - 30);` in the `draw` function within the enemy loop has been removed. Players will now have to figure out who has the key! 7. **Remove "CB" text above Secure Buildings & Change Codebook Appearance:** * The `ctx.fillText('CB', sx, sy);` and related `fillRect` for the codebook have been removed from the secure building drawing loop. * A new `codebookImg` and `codebookRotation` (per secure building) have been added. * **The codebook sprite (`codebookImg`) now only appears spinning above the secure building *after* `building.codeBookCollected` is true.** This visually confirms the objective has been completed at that building. 8. **Alarm Sprite Visibility & Interaction:** * Renamed `alarmImg` to `alarmPanelImg` for clarity (it's the static panel on the building). * Added `alarmActivatedImg` to `ASSET_PATHS` for the *collectible* alarm sprite. * When `isAlarmActive` becomes `true` (triggered by a guard reporting): * A new `item` of `type: 'alarmReset'` is spawned at the location of the *secure building that caused the alarm to be triggered* (or the one the key-holder reported to). This item will spin and glow. * The `'o'` key handler: * Now checks for proximity to a `type: 'alarmReset'` item. * If `isAlarmActive` and `alarmReset` item is collected, the alarm is disarmed, and the item is removed. * The direct alarm disarm interaction with the *building itself* (`if (building.hasAlarmPanel && isAlarmActive)`) has been removed, as it's now handled by collecting the spawned item. This significantly overhauls the objective and interaction flow, making it much more about discovery and risk-taking. *** **Full Updated Codebase:** ```html Chaos Drops: Mission Code Swipe! (vP 3.0.3)