Skip to content

aminehabchi/bomberman-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

76 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Bomberman DOM

Bomberman Game

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.

๐ŸŽฎ Game Features

  • 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

๐Ÿ•น๏ธ How to Play

Game Controls

  • Movement: Arrow keys (โ†‘, โ†“, โ†, โ†’)
  • Place Bomb: x

Game Rules

  • 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!

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v14+ recommended)
  • (Optional) Docker installed

Installation (Without Docker)

  1. Clone the repository:

    git clone https://github.com/yourusername/bomberman-dom.git
    cd bomberman-dom
  2. Start the server:

    cd server
    node server/
  3. Open your browser and navigate to http://localhost:3000

Installation (With Docker)

  1. Build the Docker image:

    docker build -t bomberman-app .
  2. Run the container:

    docker run -p 3000:3000 bomberman-app
  3. Open your browser and navigate to http://localhost:3000

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ 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

๐Ÿ› ๏ธ Technical Implementation

Performance Optimization

  • Game runs at 60+ FPS at all times
  • Efficient use of requestAnimationFrame
  • Optimized DOM manipulation
  • Performance monitoring and metrics

Mini-Framework

This project is built on top of my custom mini-framework which provides:

  • Component-based architecture
  • Virtual DOM-like functionality
  • State management
  • Event handling

Multiplayer Implementation

  • WebSocket server for real-time communication
  • Game state synchronization
  • Room management for multiple concurrent games
  • Chat functionality

About

๐ŸŽฎ Multiplayer Game Built with a Custom Framework ๐ŸŽฎ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages