A real-time multiplayer Snake game built with Node.js, Express, and Socket.IO. Players can join rooms, customize their snake's color and name, chat with other players, and compete for the highest score.
- 🎮 Real-time multiplayer gameplay with collision detection
- 🏠 Room-based system for creating/joining game sessions
- 🎨 Customization of snake colors and player names
- 💬 In-game chat with player colors and timestamps
- 📊 Scoreboard showing all players' scores
- 🔁 Restart functionality after game over
- 🌐 Responsive UI with intuitive controls
- Backend: Node.js, Express
- Real-time Communication: Socket.IO
- Frontend: HTML5 Canvas, JavaScript, CSS
- Deployment: Render (or any Node.js hosting platform)
- Node.js (v14 or higher)
- npm (Node Package Manager)
- Clone the repository:
git clone https://github.com/your-username/multiplayer-snake-game.git
cd multiplayer-snake-game- Install dependencies:
npm install- Start the server:
npm run dev- Open your browser and visit:
http://localhost:5000
-
Join a Room:
- Enter a room name (create new or join existing)
- Choose your player name and snake color
-
Game Controls:
- Use arrow keys to control your snake
- Collect food (red circles) to grow and earn points
- Avoid walls and other snakes
-
Chat:
- Type messages in the chat box
- Press Enter to send
-
After Game Over:
- Restart to play again in the same room
- Or go back to room selection
Contributions are welcome! Please open an issue or submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/your-feature) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.