create 3d game on html5. A third-person gameplay camera follows a glowing segmented red…
- User
create 3d game on html5. A third-person gameplay camera follows a glowing segmented red snake moving smoothly across a futuristic floating hexagonal grid in outer space. The snake continuously slithers forward and turns left and right across the hexagon tiles. Bright white crystal diamonds are scattered along the path. As the snake reaches each crystal, the crystal disappears with a small energy flash, the score increases, and the snake grows by one glowing red body segment. The camera stays behind and slightly above the snake, smoothly following its movement. The environment is dark space with neon blue and purple glowing hexagonal tiles. Retrowave style, with the most beautiful graphics the engine allows.
Assistant
I'll build NEON SERPENT — a third-person retrowave hex-grid snake game in Three.js with bloom post-processing, a synthwave sun, energy-grid floor, crystal collection, growth mechanics, and a smooth chase camera.
Packages installed. Setting up the HTML shell with retrowave fonts:
Now the global stylesheet with retrowave UI treatments (scanlines, vignette, neon glow text, animations):
Now the WebAudio sound engine (synthesized retro SFX + ambient pad, no assets needed):
Now the core game engine — Three.js scene, hex grid, snake logic, chase camera, post-processing:
Let me check the reported type error at line 255:
Simple fix —
scatterCrystalstakes no arguments:Now the React shell with the full retrowave HUD, menus, and touch controls:
Fixing the unused parameter and adding the missing popup animation to the CSS:
Let me check main.tsx, then build:
Build succeeds. Now let me review and fix a few gameplay/visual issues I've spotted in the engine: segment scale (too small), collecting during menu triggering UI popups, and menu autopilot dying incorrectly. Applying the fixes:
A few more robustness fixes — FOV reset on restart and frustum culling for instanced/particle meshes:
Rebuilding to verify everything:
The build is clean. NEON SERPENT is complete — a fully playable third-person retrowave snake game.
What was built
🎮 Core Gameplay (
src/game/engine.ts)- Hex-grid slithering: The snake glides continuously across a 19-hex-radius pointy-top grid (271 tiles), steering in smooth 60° turns with a two-deep turn-input queue
- Third-person chase camera: Sits behind and above the serpent with exponential damping, subtle side-sway synced to the slither wobble, gentle bank-into-turns roll, FOV that widens as speed ramps, and a pull-back dolly on death
- Serpentine motion: Segments are sampled along a time-parameterized path with a traveling sine wobble (amplitude fading in behind the head), vertical bob, growth-pop scaling, and tail taper
- Crystals: Rotating white-hot octahedral diamonds with bloom cores and additive halos — on contact they detonate a particle burst + expanding shockwave ring + vertical energy beam + point-light flash, add combo-scaled points, and grow the snake by one segment
- Deaths: Falling off the grid edge into the void or biting your own body triggers a red screen flash, camera shake, and a sequential sinking/fading of every segment
🌆 Retrowave visuals
- UnrealBloom HDR post chain + custom grain/vignette/chromatic-aberration pass + CSS scanlines & animated film grain
- Animated striped synthwave sun with halo glow, rotating wireframe planet, additive nebulas, 1600 twinkling stars
- Scrolling magenta/cyan energy sea beneath the floating grid, drifting glowing debris hexes for parallax
- Per-tile neon rims (cyan/purple/blue/magenta palette) that twinkle, breathe in waves, and ignite red as the glowing snake passes — lit underneath by the snake's red point light
🕹️ UI & Audio (
src/App.tsx,src/game/sound.ts)- Monoton/Orbitron neon HUD: score counter with pop animation, combo multiplier, speed level, best-record panel
- Menu with ambient autopilot snake slithering behind the title; "SIGNAL LOST" game-over screen with stats and NEW GRID RECORD badge
- Controls: A/D or ←/→ keys, tap screen halves, or hexagonal turn pads (touch-friendly); Space/Enter to start
- Pure Web Audio synth: combo-climbing crystal arpeggios, ambient detuned pad with LFO filter, death sweep + noise burst, mute toggle
Files built:
index.html,src/index.css,src/game/sound.ts,src/game/engine.ts,src/App.tsx
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.