A multiplayer Bomberman game built using vanilla JavaScript and WebSockets, without canvas or WebGL. This project implements a classic Bomberman-style game where 2โ4 players can battle until one remains standing.
- Multiplayer: 2โ4 players can join and play together in real-time
- WebSocket Communication: Real-time game state updates and chat functionality
- Custom Mini Framework: Built on top of my Mini-Framework project
- Room System: Create private rooms or join random ones
- Power-ups: Collect items to increase bombs, explosion range, and speed
- Responsive Design: Fully responsive game interface that works across devices
- Movement: Arrow keys (โ, โ, โ, โ)
- Place Bomb:
x
- Each player starts with 3 lives
- Players are placed in the corners of the map
- Destroy blocks to find power-ups:
- Bombs: Increases the number of bombs you can place simultaneously
- Flames: Increases explosion range in all four directions
- Speed: Increases your movement speed
- Last player standing wins!
- Node.js (v14+ recommended)
- (Optional) Docker installed
-
Clone the repository:
git clone https://github.com/yourusername/bomberman-dom.git cd bomberman-dom
-
Start the server:
cd server node server/
-
Open your browser and navigate to
http://localhost:3000
-
Build the Docker image:
docker build -t bomberman-app .
-
Run the container:
docker run -p 3000:3000 bomberman-app
-
Open your browser and navigate to
http://localhost:3000
.
โโโ Dockerfile
โโโ server
โ โโโ bomb # Bomb logic and explosion handling
โ โโโ controllers # Game controllers
โ โโโ moduls # Core server modules
โ โโโ movement # Player movement logic
โ โโโ routes # API routes
โ โโโ service # Game services
โโโ web
โโโ bomberman
โ โโโ assets # Game assets (sprites, sounds)
โ โ โโโ player
โ โ โโโ powers
โ โโโ components # Game components
โ โโโ gameLoop # Main game loop
โ โโโ socket # WebSocket client implementation
โ โโโ styles # CSS styles
โ โโโ utils # Utility functions
โโโ framework # Custom mini-framework
- Game runs at 60+ FPS at all times
- Efficient use of
requestAnimationFrame
- Optimized DOM manipulation
- Performance monitoring and metrics
This project is built on top of my custom mini-framework which provides:
- Component-based architecture
- Virtual DOM-like functionality
- State management
- Event handling
- WebSocket server for real-time communication
- Game state synchronization
- Room management for multiple concurrent games
- Chat functionality