Oskar Austegard

Asteroids Game

A modern, single-file implementation of the classic arcade game Asteroids, built with Preact.

Live Demo Source Code

Overview

This is a complete, playable version of the classic Asteroids game, recreated as a self-contained single-page application. It features responsive controls, a scoring system, and progressively difficult levels. The entire game—logic, rendering, and UI—is encapsulated within a single HTML file.

Features

Controls

The game supports several control methods:

Keyboard

Touch (Mobile)

Tilt (Mobile)

  1. Check the “Tilt controls” box.
  2. Grant motion sensor permissions if prompted.
  3. Thrust: Tilt your device forward.
  4. Rotate: Tilt your device left or right.

Technical Details

Credits


For issues, feature requests, or contributions, please open an issue on GitHub.