A note on rendering a generative art snake in plain Canvas 2D.
Algo Snake is a generative art snake game: instead of a block snake, every run grows a unique creature whose body is drawn fresh each frame. This page is a short technical tour of how that works. You can browse the species in the gallery or just play it.
The snake's body is a procedurally generated organism rendered along the snake's moving spine — there are no sprites, textures, or meshes. Each frame:
Everything is just additively-blended points: globalCompositeOperation = 'lighter'. There are no gradients, shadows, or blur filters. The glow is an emergent property of point density — wherever strokes overlap, light accumulates. A practical consequence: tuning "brightness" really means tuning how densely points are scattered, which couples brightness to cell size and took a fair amount of iteration to balance across species.
lighter): where strokes overlap, light accumulates. Brightness is an emergent property of point density — no blur or glow filter involved.There are 38 archetypes, but they're all one parametric system driven by a single integer seed through a small PRNG (mulberry32). The same seed always produces the same creature, deterministically. That's what makes seeds shareable as ?seed=12345 links, and it's also why the start-screen preview and the share card can render the same organism the game does.