Skip to content
No description, website, or topics provided.
JavaScript HTML 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.





The player controls a spaceship in an asteroid field which is periodically traversed by flying asteroids. The objective of the game is to shoot and destroy asteroids while not colliding with them. The game becomes harder as the number of asteroids increases. Each level starts with a few large asteroids drifting in various directions on the screen. Objects wrap around screen edges – for instance, an asteroid that drifts off the top edge of the screen reappears at the bottom and continues moving in the same direction.


  • You can move the ship using the keys W, A, S and D.
  • Press SPACE to fire
  • Once the ship begins moving in a direction, it will continue in that direction
  • You get 100 health points in the beginning, try getting a high score before your health becomes zero

To Do

  • Basic skeleton canvas that renders at 32 FPS
  • Utility functions for -
    • Generating a vector with a specific magnitude and random direction
    • Getting the normal of a vector
    • Scaling the length of a vector by a specific amount
    • Finding distance between two points
    • Finding the inverse tangent of the direction of a vector
  • The game adds and displays the Asteroids, ship and the bullets
  • Bind key handlers on W, A, S, D and SPACE so move ship and fire bullets
  • Implement collision mechanics
  • Add images for background, asteroids, ship
  • Implement client side game restart
  • Allow user to control ship using arrow keys
  • Output and keep track of score and high scores
  • Using Heap, allow users to add record scores
  • Implement explosion effects
  • Show GIFs for asteroids instead of steady JPGs
  • Implement physically correct collisions, with debris
You can’t perform that action at this time.