This is a Node.js-based game engine for a multiplayer real-time browser game. Players can join the game, move around the game area, collect feeds, avoid traps, and attack other players.
Node.js (version 14 or higher recommended) npm (usually comes with Node.js)
Clone the repository:
- git clone https://github.com/meteoncu/nodejs-socketio-multiplayer-realtime-game-engine.git
- cd nodejs-socketio-multiplayer-realtime-game-engine
Install the required dependencies:
- npm install
node server.js The server will start running on the specified port (default is 3000).
- Joining the Game: Players can join the game by connecting to the server. They will be assigned a random position in the game area.
- Moving: Players can move around the game area by setting a destination. The server will update their position based on their speed.
- Feeds: Feeds are randomly placed in the game area. Players can collect feeds to increase their energy.
- Traps: Traps are also randomly placed in the game area. Players should avoid traps, as they can reduce their speed and energy.
- Attacking: Players can attack other players within a certain range. Successful attacks can reduce the health of the target player.
- Scoring: Players earn points by collecting feeds and attacking other players. The game maintains a leaderboard based on the players' scores.
The game's configuration can be found in the config.js file. You can modify the game settings such as the game area size, player speed, feed interval, and more.
Contributions are welcome! Feel free to fork the repository, make changes, and submit pull requests.