JSteroids is a recreation of the classical retro game Asteroids. The project itself is an HTML5 game created with the help of the open-source game engine Phaser 3 which is based on JavaScript.
The game is a 2D top-down view shooter. The player controls a spaceship which may navigate around in space and fire projectiles. The game's main objective is to destroy asteroids which spawn endlessly in waves. With each wave, the number of asteroids increases by multiplying the previous wave's asteroid count with a level multiplier which depends on the player's score. Asteroids come in several levels with each next level of asteroids being faster and smaller than the previous.
Saucers are the player's main enemy. They spawn randomly every so often and shoot in random directions. Like asteroids, saucers also come in a few levels with each next level of saucers being faster and smaller than the previous level. Saucers can be destroyed by colliding with either the player or their projectiles. However, these enemies bounce off asteroids on collision.
Each player-destroyable object (asteroids and saucers) give the player some amount of score. The objective of the game is to achieve a higher score before the player loses all of their lives. After the game ends, the player has the option of returning to the main menu or to directly restart the game.
This project is currently deployed on Heroku. You may visit the following app to play JSteroids without performing any setup:
https://tranquil-bayou-90414.herokuapp.com/
The following instructions will get you a running copy of the game on your local machine.
You must have installed nodejs and npm in order to run this project. The latest versions used in this project are:
- nodejs v10.15.3
- npm 6.4.1
To get a copy of the game, all you need to do is clone this Github repository.
$ git clone https://github.com/Pejo-306/JSteroids.git
$ cd JSteroids/
Then install all npm packages.
$ npm install
Run webpack's development server.
$ npm run dev
Afterward, open your browser and visit localhost:8000.
And you're good to go. Enjoy playing the game :).
In order to deploy the game in a production environment, you must start the provided simple Express.js server. To run the server use the following npm script:
$ npm start
This project is distributed under the MIT license.