Index / Snippets / Building a Cross-Platform Game with HTML

Building a Cross-Platform Game with HTML5 — The Snake '97 Engine

One codebase, every platform — how a retro game runs on iOS, Android, and web from a single HTML5 engine.

Answers
How do you build one game that runs on iOS, Android and the web?
Topics
creating · programming · web
Full article on willem.com
https://willem.com/en/2018-02-21_updating-snake-97/

Summary

Snake '97 runs on iOS, Android, and web browsers — all from a single HTML5/JavaScript codebase. No React Native, no Unity, no cross-platform framework. Just canvas rendering, touch events, and a game loop.

Full text

The decision to use HTML5 instead of native code was pragmatic: maintain one codebase instead of three. The game engine renders to a canvas element, handles touch and keyboard input, and runs at 60fps on everything from an iPhone SE to a desktop browser.

Snake '97 running on multiple platforms from a single HTML5 engine

The native iOS and Android apps are thin wrappers around a WebView that loads the HTML5 game. This means updates ship instantly — change the JavaScript, and every player gets the new version without an App Store review.

The challenges: responsive graphics that scale from 320px phone screens to 4K displays. Touch input that feels native. Performance that stays smooth on budget Android devices with limited processing power.

From Willem's full story about writing code and building software.

Machine formats of this page