October 28, 2026
Build Snake in Aurelia 2
A playable Snake game in one Aurelia 2 component: a CSS grid board, a requestAnimationFrame loop, keyboard and touch controls, and a high score that survives a refresh. Under 300 lines, and no game engine.
A playable Snake game in one Aurelia 2 component: a CSS grid board, a requestAnimationFrame loop, keyboard and touch controls, and a high score that survives a refresh. Under 300 lines, and no game engine.
Counting with repeat.for, comparing against the previous item, template variables, promises in markup, portals, two-way focus, key modifiers, and a few more small things that save you writing code.
if, repeat, with and promise are ordinary custom attributes with one flag set. Here's how they work, and how to build your own: one that renders content while a media query matches, and one that adds a variable to its template.
How to use the island architecture with Aurelia 2 and modern libraries.