Bug Report
Building: Arcade House
Difficulty: Hard
What is broken?
The mini-game features no actual collision detection. The player sprite can pass directly through enemy blocks without taking damage, yet the player's health steadily decreases over time regardless of their actions.
Steps to reproduce
- Navigate to the Arcade House and begin the Glitch Racer game.
- Intentionally collide with an incoming enemy block. Observe that no damage is taken upon impact.
- Successfully jump over all blocks and avoid all contact. Observe that health randomly drops anyway.
Expected behavior
The game should evaluate physical overlap between the player sprite and enemy sprites. Health should only decrease when a physical collision occurs on the screen.
Actual behavior
The enemy blocks were entirely CSS-driven visual decorations decoupled from React state. Instead of implementing hitboxes, the developer simulated difficulty by placing a Math.random() > 0.84 probability check inside the 900ms passive game loop, arbitrarily deducting health points regardless of gameplay.
Root cause & Fix
Root Cause: Complete absence of a 2D collision detection loop bridging DOM rendering with React state logic.
Fix applied: 1. Attached useRef hooks (playerRef, enemyARef, enemyBRef) to the respective DOM elements.
2. Removed the randomized health penalty from the passive game ticker.
3. Implemented a dedicated 50ms interval physicsEngine that evaluates getBoundingClientRect() for the elements, applying standard AABB (Axis-Aligned Bounding Box) collision math to deduct health only upon physical DOM overlap.
Bug Report
Building: Arcade House
Difficulty: Hard
What is broken?
The mini-game features no actual collision detection. The player sprite can pass directly through enemy blocks without taking damage, yet the player's health steadily decreases over time regardless of their actions.
Steps to reproduce
Expected behavior
The game should evaluate physical overlap between the player sprite and enemy sprites. Health should only decrease when a physical collision occurs on the screen.
Actual behavior
The enemy blocks were entirely CSS-driven visual decorations decoupled from React state. Instead of implementing hitboxes, the developer simulated difficulty by placing a
Math.random() > 0.84probability check inside the 900ms passive game loop, arbitrarily deducting health points regardless of gameplay.Root cause & Fix
Root Cause: Complete absence of a 2D collision detection loop bridging DOM rendering with React state logic.
Fix applied: 1. Attached
useRefhooks (playerRef,enemyARef,enemyBRef) to the respective DOM elements.2. Removed the randomized health penalty from the passive game ticker.
3. Implemented a dedicated 50ms interval
physicsEnginethat evaluatesgetBoundingClientRect()for the elements, applying standard AABB (Axis-Aligned Bounding Box) collision math to deduct health only upon physical DOM overlap.