17

Most snake-game prompts give you a joyless gray grid. I wanted arcade feel: particles, screen shake, an actual difficulty curve.

After a lot of trial and error the prompt below consistently produces a genuinely fun version. The key insight was asking for "game juice" by name and enumerating the specific effects.

Anyone have a variant that adds sound without breaking the single-file constraint?

THE PROMPT
Create a complete Snake game in a single HTML file with canvas. Beyond the basics, it must have GAME JUICE:
- screen shake on death (200ms, decaying)
- particle burst when eating food
- the snake's head slightly overshoots turns (squash & stretch)
- food pulses at 1Hz
- score popup floats up and fades when eating
- speed increases 4% per food eaten
- CRT scanline overlay effect
- start screen and game-over screen with high score in localStorage
Controls: arrows + WASD + swipe on mobile. 60fps game loop with requestAnimationFrame and fixed timestep. No external assets or libraries.
Confirmed this works on the first try. The CRT overlay is a nice touch. – lena-builds 1 hour ago
add a comment

1 Answer

9
✔

For sound without external assets, use the WebAudio API and synthesize everything. Append this to your prompt and you get satisfying blips with zero files:

It generates an oscillator-based sound module. The "duck the music on death" detail is what makes it feel intentional rather than tacked on.

THE PROMPT
Add sound using ONLY the WebAudio API (no audio files): eat = short square-wave blip rising in pitch with combo, death = descending sawtooth sweep + noise burst, subtle bass pulse on the beat of the game speed. Include a mute toggle (M key) persisted to localStorage. Duck all other sound 12dB for 400ms on death.

Your Answer