Git Product home page Git Product logo

asteroids's Introduction

Asteroids

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.