A 3D marble racing game with Three.js physics, 6 levels, turrets, trampolines, portals, and procedural audio.
I've always been fascinated by marble racing games and wanted to see how far I could push Three.js and Cannon-es physics in the browser. The result is Rolling Mayhem — 6 levels of increasingly chaotic marble racing with real physics simulation.
Each level has a distinct personality. Practice Run eases you in, then The Valley introduces banked turns, The Vortex adds escalators and moving platforms, The Slalom throws in turrets that actually fire projectiles at you, The Gauntlet combines everything with water hazards and trampolines, and The Fortress is the final boss with portals and collectibles.
The physics feel right because I'm using Cannon-es for proper rigid body simulation — gravity, collisions, forces all running at 60fps. The camera follows with configurable distance, height, and smoothness, plus screen shake on impacts that decays over time. Audio is procedural via the Web Audio API — no audio files, just synthesized effects and background music.
The UI has a glassmorphism aesthetic with a dynamic starfield background. Each level has its own skybox and colour palette. WASD/arrow keys to move, space to jump, mouse for camera.