RCWeb Tilt Maze App

The RCWeb Tilt Maze App (app/tilt-maze) is an advanced 3D physics demonstration utilizing the Asymmetric Pattern. It procedurally generates a complex labyrinth and requires users to physically tilt their remote mobile device to roll a virtual marble toward a finish line without falling into void holes.

Screenshot

screenshot

What it does

  • Procedural Labyrinths: Uses a depth-first search (DFS) algorithm to carve a unique, guaranteed-solvable maze structure into a grid every time the game resets.
  • 3D Physics Pipeline: Renders the board using Three.js, accurately calculating gravity vectors to accelerate a marble dynamically based on the current parsed tilt angle of the hardware board pivot.
  • Lighting & Materials: Applies high-fidelity Physically Based Rendering (PBR) utilizing custom-generated canvas wood textures, reflective clear-coats, and multi-light soft shadows to create a tangible visual toy aesthetic.
  • Procedural Obstacles: Automatically computes the distance logic of the solved path and intelligently places deadly drop-holes distinctly at dead-ends to create hazard gameplay.

How it works

The logic in script.js seamlessly merges mathematical vector geometry with raw network streams.

  • Network-driven Gravity: Instead of processing inputs locally, it receives pure { tiltX, tiltZ } objects rapidly over the WebSocket. It calculates a rollQuaternion applied directly to the boardPivot 3D group, visually slanting the entire maze.
  • Mathematical Physics: The engine calculates an inverse gravity vector relative to the angled board surface realistically accelerating the ballState velocity. It calculates rigorous swept-circle collision against procedurally defined wallRects geometries, integrating friction (WALL_SLIDE_DAMPING) and elastic restitution (WALL_BOUNCE).
  • Telemetry Callbacks: When the marble hits the finish marker or drops into a cavity (holeData), the application natively executes tiltMazeControl.receiveViewerState directly against the specific connected controller client to trigger remote screen alerts and haptic vibration patterns.
DocumentationServer TelemetryServer StatsServer HTTP LogServer WebSocket Log