asteroids

command module
v0.0.0-...-ef779ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 6 Imported by: 0

README

Asteroids Go Report Card

A modern implementation (in Golang) of the classic arcade game.

screenshot

The game can be compiled natively and run locally, or cross-compiled into WASM and deployed to GitHub Pages. Every time a commit is made on the main branch, a GitHub action deploys a fresh version.

Running in a browser

You can play the game online at https://www.destructuring-bind.org/asteroids. A browser with WebGL support is required. It will run on smartphones and iPads, however there is no support yet for non-keyboard input.

Running locally

Install the go binary (instructions here), and:

go run github.com/rm-hull/asteroids@latest

Keyboard Controls

LEFT-SHIFT or SPACE : Fire

← or → : Rotate left & right

↑ : Thrust

F : Toggle fullscreen

P : Toggle pause

Q : Quit

R : Restart

Strategy

Pick off the asteroids taking care to mop up exploded fragments. After a while an alien saucer may appear, and will start aiming at you. As you progress through the levels, the asteroid belt gets more dense, and the alien's shooting accuracy improves. On starting each level, you will have a few seconds of immunity to get yourself out of danger.

There is a "god-mode" which gives you immortality and your weapon is hugely upgraded from the normal salvo of 3 shots. You'll have to browse the source code to find out how to activate it.

TODO

  • Hyperspace
  • Extra lives at every 10,000
  • (Persistent) High score
  • Score wraps round at 100,000 (like the original)
  • Support different sprite sheets
  • Code refactoring / reorganisation / tests
  • Custom key mapppings
  • Touchscreen support

KNOWN ISSUES

  • Fix sound distortion

References & Attribution

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
resources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL