Apex Circuit
Create a complete, single-file HTML top-down racing game called "APEX CIRCUIT" with a dark cyberpunk aesthetic. Use deep blacks and teals with neon green accents, monospace and futuristic display fonts, and a three-panel layout (stats | game canvas | stats) framed by CRT scanl...
Create a complete, single-file HTML top-down racing game called "APEX CIRCUIT" with a dark cyberpunk aesthetic. Use deep blacks and teals with neon green accents, monospace and futuristic display fonts, and a three-panel layout (stats | game canvas | stats) framed by CRT scanlines and vignette effects. The game features a procedurally generated race track using spline interpolation to create a winding circuit with start/finish at the top. Render the track with asphalt texture, dashed center lines, grass verges, and checkpoint markers. Implement a distance-based collision system where the car grips on road but slides on grass. Build a physics model with velocity vectors separate from heading angle. Include two manual gears (low/top) toggled via 'R' keyโhigher gear enables faster straight-line speed but requires braking for corners. Implement speed-sensitive steering that peaks at mid-velocities, with reversed controls when driving backward. Add drifting mechanics where grip decreases significantly on grass surfaces. The car is drawn procedurally as a sleek top-down racer with gradient body, cockpit, rear wing, and wheels. Spawn exhaust particles that change color based on gear. Add headlight glow effects when moving. Gameplay requires players to hit three checkpoints in any order before crossing the finish line to complete a lap. Display a digital timer, speedometer, gear indicator, and minimap showing track progress. Include start/win overlays, notification toasts for checkpoints, and session tracking for best/last lap times. Support keyboard controls: arrows for steering/acceleration, 'R' for gear shifting, spacebar to restart. Maintain a 60fps game loop with delta time, state management for menu/racing/done phases, and persistent lap records across sessions.