{"id":2505,"edition":14,"categories":3,"features":1,"size":7796,"name":"Tribute Unicorn Attack","authors":[{"name":"Marcin Dudek","url":"https://marcindudek.dev","login":"MarcinDudekDev","gh":109857699}],"description":"

A tribute to Robot Unicorn Attack. Run, jump, dash, and try to keep the combo alive.

\n

Controls

\n\n

Stars are worth 50, smashed dolphins 100, and every pickup raises a multiplier that resets the moment you miss one. Chain 100 and you get SUPER: ten seconds of hovering rainbow where nothing can touch you and the music switches up with you. The sky rolls into a new palette every minute, and if you survive nine of them the sun comes up.

\n

Under the hood

\n

Nothing ships but code. Every sprite is drawn with canvas paths - the unicorn, the dolphins, the parallax hills, the moon. The soundtrack and all the effects are synthesised with WebAudio at runtime, so there is not a single asset file in the zip. The terrain is three summed sine waves.

\n

The frame loop is profiled rather than guessed at. The sky gradient and hill palette are memoised against the day clock instead of rebuilt every frame, the 64 star field is drawn as five batched fills instead of 64, and particles live in a preallocated ring buffer so the loop never allocates. That is around 20% less main thread work per frame than the first version, measured under CPU throttling, which is the case that decides whether it holds 60fps on a phone.

\n","source":"MarcinDudekDev/js13k","stars":0,"languages":{"JavaScript":32801,"HTML":443}}