Minesweeper Web Game
Project Overview
The Minesweeper Web Game is a browser-based puzzle game where players uncover hidden cells on a grid while avoiding mines. The numbers on revealed cells indicate how many mines are adjacent, helping players use logic to avoid detonating bombs. The project highlights algorithm design, dynamic UI rendering, event handling, and real-time game validation.
This project is ideal for final-year computer science students because it involves game logic, backend score management, and interactive frontend gameplay.
Key Features
-
User Authentication (Optional)
-
Players can sign up/login to track scores and game history.
-
Guest mode for casual play.
-
-
Game Modes & Difficulty Levels
-
Easy (9x9 grid, 10 mines)
-
Medium (16x16 grid, 40 mines)
-
Hard (30x16 grid, 99 mines)
-
Custom mode: Players can set grid size and mine count.
-
-
Gameplay Mechanics
-
Left-click to reveal a cell.
-
Right-click to flag/unflag suspected mines.
-
Numbers indicate adjacent mines.
-
Game over if a mine is clicked.
-
Victory when all safe cells are revealed.
-
-
Timer & Scoring System
-
Game timer starts when the first cell is revealed.
-
Score based on time taken and accuracy of flagged mines.
-
High scores saved in leaderboard.
-
-
Leaderboard & Player Stats
-
Stores fastest completion times for each difficulty.
-
Shows win/loss ratio and overall performance.
-
-
Responsive UI
-
Smooth animations for cell reveal and flagging.
-
Mobile-friendly with touch support.
-
Bootstrap for a clean layout.
-
Technology Stack
-
Frontend: HTML, CSS, Bootstrap, JavaScript (for game board rendering, event handling, animations).
-
Backend:
-
Node.js with Express / PHP / Java (Spring Boot) for score tracking, authentication, and multiplayer features.
-
-
Database: MySQL / MongoDB (for storing user data, game history, and leaderboard).
-
Game Logic: JavaScript algorithm for mine placement, adjacency calculation, and recursive reveal of empty cells.
How It Works
-
User logs in (or plays as guest).
-
Chooses a difficulty level.
-
The system generates a grid → mines randomly placed (ensuring the first click is safe).
-
Player clicks cells:
-
If mine → Game Over.
-
If safe → Number displayed (adjacent mines count).
-
If empty → Auto-reveals surrounding safe cells recursively.
-
-
Player wins when all safe cells are revealed.
-
Score and time stored → Leaderboard updates.