An open API service indexing awesome lists of open source software.

https://github.com/huseynovvusal/multiplayer-snake-game

🐍 Multiplayer Snake Game using Nest.js (Socket.io) and React.
https://github.com/huseynovvusal/multiplayer-snake-game

canvas multiplayer nestjs react snake-game socket-io websockets

Last synced: about 2 months ago
JSON representation

🐍 Multiplayer Snake Game using Nest.js (Socket.io) and React.

Awesome Lists containing this project

README

          

# Multiplayer Snake Game 🐍

Welcome to the **Multiplayer Snake Game**, a modern twist on the classic snake game where you can compete with friends in real-time! This project is built using **NestJS** for the server and **React** with **Vite** for the client, ensuring a fast and scalable gaming experience.

---

## Features ✨

- **Multiplayer Gameplay**: Join or create rooms to play with friends. đŸ‘Ģ
- **Dynamic Game Board**: Real-time updates of the game state. đŸ•šī¸
- **Customizable Player Colors**: Each player gets a unique color. 🎨

---

## Screenshots 📸

### Game Room

![Game Room](assets/room.png)

### In-Game

![In-Game](assets/game.png)

---

## Getting Started 🚀

### Prerequisites ✅

- **Node.js** (v16 or later)
- **npm** (v7 or later)

### Installation đŸ› ī¸

1. Clone the repository:

```bash
git clone https://github.com/your-username/multiplayer-snake-game.git
cd multiplayer-snake-game
```

2. Install dependencies for both the server and client:
```bash
cd server && npm install
cd ../client && npm install
```

### Running the Application â–ļī¸

#### Server đŸ–Ĩī¸

1. Navigate to the `server` directory:

```bash
cd server
```

2. Start the server in development mode:
```bash
npm run start:dev
```

#### Client 🌐

1. Navigate to the `client` directory:

```bash
cd client
```

2. Start the client in development mode:

```bash
npm run dev
```

3. Open your browser and navigate to `http://localhost:5173`.

---

## How to Play 🎮

1. **Create or Join a Room**: Enter your name and either create a new room or join an existing one. 🏠
2. **Start the Game**: The room owner can start the game once all players are ready. đŸŸĸ
3. **Control Your Snake**: Use the arrow keys to move your snake and collect food to grow. âŦ†ī¸âŦ‡ī¸âŦ…ī¸âžĄī¸
4. **Avoid Collisions**: Stay alive by avoiding walls and other players' snakes. 🚧

---

## Project Structure đŸ—‚ī¸

```
multiplayer-snake-game/
├── client/ # Frontend code (React + Vite)
├── server/ # Backend code (NestJS + Socket.io)
└── assets/ # Images and other assets
```

---

## Contributing 🤝

Contributions are welcome! Feel free to open an issue or submit a pull request. đŸ› ī¸

---

## License 📜

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

## Acknowledgments 🙌

- **NestJS**: For the robust backend framework. đŸ›Ąī¸
- **React**: For the dynamic and responsive frontend. âš›ī¸
- **Socket.IO**: For real-time communication. 🔌
- **Vite**: For the fast development experience. ⚡