← sources

How my 13 KB JavaScript game generates its tracks, cities and music at load time

source: reddit (reddit:gamedev)published 2026-09-16 18:23ingested 2026-09-17 02:36

retained text

SP13KTRA is a hover racer I made for js13kGames, where the whole game has to fit in 13 kilobytes. That means no assets, so everything is generated when the page loads:

* **Tracks:** each circuit is just a short list of corners
* **Banking and hills:** follow the curves and flow between corners
* **Ships:** all 8 hulls generated from a seed
* **Cities:** 8 shape languages, a palette per circuit
* **Skylines:** one slow wave sets building heights, so neighbors form ridges
* **Canyons:** towers standing on pillars far below the road
* **Pads and arrows:** placed wherever the road runs straight or curves
* **Skies:** suns, eclipses, stars and clouds, all soft circles
* **Sound effects:** synthesized using ZZFX, no audio files
* **Music:** 8 techno loops, each from one seed that picks 26 parameters. I made a tool to find good seeds for each track.

Play free in the browser: [https://www.newgrounds.com/portal/view/1052078](https://www.newgrounds.com/portal/view/1052078)

Source: [https://github.com/KilledByAPixel/SP13KTRA](https://github.com/KilledByAPixel/SP13KTRA)

Music tool: [https://killedbyapixel.github.io/SP13KTRA/tools/music.html](https://killedbyapixel.github.io/SP13KTRA/tools/music.html)

document fetched 2026-09-17 00:26 · canonical https://reddit.com/r/gamedev/comments/1wi5d0c/how_my_13_kb_javascript_game_generates_its_tracks