A multiplayer space war game built using PhaserJS and ColyseusJS. This game allows multiple players to join a space battle, maneuver their ships, and shoot down opponents in real-time.
- Real-time multiplayer battles
- Player-controlled spaceships with movement and shooting mechanics
- Server-side game logic using Colyseus
- Client-side rendering with PhaserJS
- Node.js (v20.x or higher)
- npm or yarn
- Docker compose and Docker(optional)
-
Fork the repository:
git clone https://github.com/diegofer25/spacewar-multiplayer.git cd spacewar-multiplayer
-
Install dependencies for both the server and client:
npm install . && npm install ./client/
-
Start the server:
npm run dev-server
-
Start the client:
cd client/ npm run dev
- Open your browser and go to
http://localhost:2567
to play the game.
You can also run the server using Docker Compose. This will start the server and client, providing better experience.
The server is built with Node.js and Colyseus. It handles real-time communication between players and manages game state.
- Entry point:
src/index.ts
- Room handlers:
src/rooms/
The client is built with PhaserJS, rendering the game on the browser and handling user inputs.
- Entry point:
client/src/main.ts
- Game scenes:
client/src/main-scene/main.scene.ts
- Images: The game assets for images are generated using Leonardo AI.
- Music: Background music is created with Beatoven AI.
- Sound Effects: Sound effects are sourced from Pixabay.
Feel free to submit issues, fork the repository, and create pull requests. We appreciate all contributions to improve the project.
This project is licensed under the MIT License - see the LICENSE file for details.