Skip to content
An asteroids-like HTML5 canvas game, implemented in node.js using websockets.
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Multiplayer Cosmic Drift

Note: Because my multiplayer version of Cosmic Drift, an asteroids-type game utilizing a JavaScript engine with HTML5 canvas for graphics, entailed a complete overhaul of my original, single player version, I've opted to create a new repo for this continuation of the project.


  • Arrow Keys turn
  • Forward applies thrust
  • Spacebar shoots
  • That's it! There's no braking in space!


###Single Player

Stay alive as long as possible, and destroy asteroids to rack up your score.


  • The object is to outlast your opponent.
  • If your opponent dies before you, you have 10 seconds to score bonus points.
  • Your victory (or defeat) will be measured by score differential.

Good Stuff/ Technical Features

  • Trig functions to determine rotation of ships and asteroids.
  • Finite State Machine handles game state transitions.
  • Predictive analysis used to minimize lag/number of packets transmitted over websockets.
  • Server-side data structures allow multiple concurrent multiplayer games.

Technologies used

  • Node.js
  • HTML5 Canvas
  • Websockets ( library)
  • Finite State Machine (javascript-state-machine library)

This app is hosted on Heroku, using their websockets add-on

You can’t perform that action at this time.