Skip to content

The Asteroids arcade videogame using Phaser

License

Notifications You must be signed in to change notification settings

dsantarelli/phaser-asteroids

Repository files navigation

Asteroids

This is a simple implementation of the Asteroids videogame using Phaser.

Branch Build Coverage
main Build Status codecov

Game features

  • Each time you hit an asteroid, it breaks down into smaller and faster pieces. Try not to be hit!
  • The game is over when you have no more lives or if you destroy all the asteroids.
  • Your highest score is saved on your browser localStorage.

Development goals

  • Leverage TypeScript's type system as much as possible. 🚀
  • Building and running the videogame through webpack
  • Learning how to make a Phaser videogame testable (this is the hard part! 😅)
  • Automated testing through Headless Chrome, Karma, Mocha and Chai 🤘

How to run

1. Install node.js and npm

https://nodejs.org/

2. Install dependencies (optionally you can install yarn)

Run npm install or yarn install

3. Run the development server

Run npm run dev or yarn run dev

This will run a server so you can run the game in a browser. It will also start a watch process, so you can change the source and the process will recompile and refresh the browser automatically. To run the game, open your browser and enter http://localhost:8080/ into the address bar. If you want to change the port, please edit the webpack.config.js file.

4. Run the tests

Run npm run test or yarn run test

This will launch the Karma test runner which uses the Headless Chrome browser.