Welcome to the Multiplayer Flappy Bird Game repository! This project is a modern, multiplayer implementation of the classic Flappy Bird game, where you control a bird, dodge pipes, and compete with others in real time. The game is built using the following technologies:
- Frontend: Vite + TypeScript
- Backend: Express + TypeScript + Socket.io
- Multiplayer Support: Players can join a game room and compete against each other!
- Simple Game Mechanics: Control a bird that continuously falls. Press the spacebar (or other designated keys) to make the bird flap and rise slightly.
- Pipes: Navigate through randomly generated pipes. Colliding with a pipe or the ground ends the game.
- Score System: Earn points by successfully passing through a set of pipes. Points are awarded for each successful pipe pass.
- Multiplayer: Play with friends in real-time! Join a game room and compete to achieve the highest score.
- Game End: The game ends when the bird collides with a pipe or the ground, or when a player exits the room.
- Frontend:
- Vite – Fast build tool for frontend development.
- TypeScript – Statically typed JavaScript for better maintainability and developer experience.
- Backend:
- Express – Web framework for building the game’s backend API.
- Socket.io – Real-time communication between the server and clients for multiplayer functionality.
- Multiplayer Rooms: Players can create or join rooms and compete with others in real-time.
- Game State Sync: The game state (bird position, score, etc.) is synchronized between clients using WebSockets.
Before running the game locally, make sure you have the following installed:
- Node.js – Required to run the backend server and frontend build tools.
- Git – To clone the repository.
- Create a Room: To start a multiplayer game, create a room by entering a unique name.
- Join a Room: Share the room ID with friends to let them join your game session.
- Multiplayer Gameplay: Compete with others in real-time to see who can score the most points before crashing.
-
Clone the repository:
git clone https://github.com/imkaranks/multiplayer-flappy-bird.git cd multiplayer-flappy-bird
-
Navigate to each folder and install the required npm packages:
# For the client cd client npm install # For the server cd ../server npm install
Copy the .env.template
files in each folder to .env
and configure them with your specific settings.
# For example:
cp .env.template .env
Make sure to set up your MongoDB URI and any other necessary environment variables.
- Spacebar / Enter: Make the bird flap (rise).
- Launch the game by running the development servers as described in the installation section.
- Control the bird by pressing the spacebar to make it flap.
- Try to avoid hitting the pipes! Each successful pass through a pair of pipes earns you one point.
- The game ends when the bird hits a pipe or falls to the ground.
- Play again to try for a higher score!
The project consists of three main folders:
- client: Vite front-end application.
- server: Express backend server.
Each folder contains a .env.template
file to help you set up environment variables.
- This project is inspired by the classic Flappy Bird game originally created by Dong Nguyen.
Feel free to modify this README as needed based on your actual game stack and project specifics.