Space-fleet is the Atari classic "Asteroids" game re-imagined as an MMO game.
The game was initially developed as a personal project during the Codeworks Software Engineering course in 2021, and uses socket.io to communicate with a Node backend game server. It was deployed at Heroku, until free Dynos were removed in 2022.
- Install Node if required
- Fork this project
- Clone to you local machine: From your command line, in the desired directory, run
git clone https://github.com/djr319/spacefleet
- Install dependencies:
npm i
from the project root folder
- The project will run out of the box on your local machine
- If you would like to host on Heroku, don't forget to point the client to the Dyno:
- Open
server/views/scripts/socket-client.js
in your code editor - comment out line 1 (reference to local server)
- un-comment line 2 (insert your reference to heroku domain)
- Open
- The server can be started by running
npm run server
from the root folder - Navigate in browser to http://localhost:5000
- Use the WASD keys (or arrow keys) to control your spaceship, W = Thrust, A & D = Turn, S = Warp to new location
- Spacebar (or left mouse click) = Fire
- Warping has a cost of 1000 points, if you warp below 1000 points, you will die!
- If there are not enough other players in the server, AI enemies will spawn
- Shoot meteors to get points. They will split into smaller faster meteors
- Shoot opponents for big points
- The front end uses canvas API
- The client connects to the backend server with
socket.io
- The backend creates the gaming environment
- Game phsyics are all vanilla JS to further my knowledge and experience of game design
If you are interested in forking and taking this further, the following libraries may be of interest:
- https://brm.io/matter-js/ (2D physics engine)
- https://threejs.org/ (3D rendering)
- https://phaser.io/ (HTML5 Game framework)
- https://github.com/adambom/bullet.js/ (3D physics engine)