I'll build you a tunnel runner with rock-solid mechanics — lane switching, jump, slide/slam, and a physics-based sling/swing system — all separated from rendering so you can swap in your 3D graphics later. Let me first look at the project structure.
Tailwind v4, React 19, single-file build. Let me install an icon library, then set up the HTML shell and global styles.
Now the global stylesheet with fonts, theme tokens, and the menu's animated tunnel background:
Now the core game layer. First, the central tuning file (all physics constants in one place so you can tweak the feel easily) and the shared types:
Next, the three themed levels and the pattern library the spawner draws from:
Now the engine — the heart of the mechanics (lanes, jump/coyote/buffers, slide/slam, sling pendulum, collisions, spawning, scoring):
Fixing a bad import path in the engine:
Now I'll fix a couple of gameplay-fairness issues I spotted: jump spacing must scale with speed (higher speed = longer airtime), and the sling arc must not double-advance z. Updating patterns first:
Now fixing the sling physics in the engine — the arc must own z while swinging (no double advance):
Engine is clean. Now the sound synth and input system (keyboard + swipe + sling button):
Now the placeholder renderer — pseudo-3D perspective canvas that visualizes every mechanic clearly (this is the file you'll replace with your 3D renderer later):
Quick cleanup of unused imports in the renderer:
Renderer done. Now the React UI layer — menu, HUD, overlays, and a live mechanics debug panel (great for tuning feel). All four in parallel:
Removing a leftover unused ref in HUD, then wiring everything together in App.tsx:
Cleaning up two rough edges in App (stale closure and unused import):
All files in place — building to verify:
Solid build. But I'm doing a mechanics-review pass and found a few fairness/timing issues worth tightening before calling this done:
- Collision hitbox is too generous (1.2u front margin = crashing while visually in front of an obstacle).
- Sling attach window starts too late at high speed — only ~0.1s of decision time before a gap edge at top speed.
- Missing initial countdown beep; a stray CSS class in the menu.
One more wiring fix — the level density knob isn't actually affecting spawns yet. Tier thresholds should shift earlier based on density:
Rebuilding to verify everything still compiles:
One last visual/hitbox alignment in the placeholder renderer (barrier art slightly taller than its collision could look unfair), then final build:
Done — VOIDLINE, a tunnel-runner mechanics build, is ready. The whole game is architected exactly for your workflow: all game logic is renderer-agnostic, so you can bolt your 3D characters/graphics on top of a proven rule set.
The mechanics (the solid part)
- 3 lanes, 3rd person — instant lane targeting at 13 u/s, steerable mid-air and mid-swing, double-tap for two-lane hops
- Jump — ~3u arc with input buffering (130ms) + coyote time (80ms); cancels slides; hold ↓ to land straight into a slide
- Slide / Slam — 0.6s slide under overheads; pressing ↓ mid-air slams you down and sticks the landing into a slide
- Sling — anchors signal with brackets; fire with
E/Shift to pendulum over huge gaps. Physics-based release with upward launch + speed boost +150 pts. Jump mid-swing = early release with scaled power. Early presses are buffered (350ms) so window-edge timing never feels dropped. High-sling clears even full blocks
- Obstacles — barriers (jump ▲), overheads (slide ▼), lane blocks (dodge), jumpable gaps, sling-only gaps
- Fair-by-construction spawner — handcrafted solvable patterns; consecutive-jump spacing scales with your current speed so double-jumps are always possible; reaction-time rest gaps grow with velocity; difficulty tiers unlock by distance
- Scoring — distance + coins +25, near-miss +30, sling +150, per-level best in localStorage
- Feel juice — slow-mo deaths (crash vs. fall are different), landing squash, screen shake, speed lines, wind audio tied to velocity, synth SFX (no assets), countdown, pause
Themed pages & levels
Menu with animated tunnel backdrop, level-select cards, pause and game-over screens — plus three endless levels with distinct palettes (Neon Sprawl → Ember Core → Volt Abyss), each faster and denser.
Where you plug in your art
src/game/renderer.ts — the placeholder pseudo-3D canvas renderer. Replace it entirely; it only reads GameState
GameState gives you everything per frame: player.laneX / y / z / pose / lean / squash / runPhase, plus obstacles, gaps, anchors, coins, anchorReady
src/game/tuning.ts — every physics constant in one commented file
- Toggleable live mechanics debug panel (backtick or the sliders button) shows pose, speed, buffers, timers, and anchor state in real time — super handy while you re-tune feel or wire your character
Controls: ←→/AD lanes · ↑/W/Space jump (early rope release) · ↓/S slide/slam · E/Shift sling · Esc pause · R retry · swipe on touch.
Files built: index.html, src/index.css, src/game/tuning.ts, src/game/types.ts, src/game/levels.ts, src/game/patterns.ts, src/game/engine.ts, src/game/audio.ts, src/game/input.ts, src/game/renderer.ts, src/components/Menu.tsx, src/components/HUD.tsx, src/components/Overlays.tsx, src/components/DebugPanel.tsx, src/App.tsx