Skip to content

LeahRhinehart/miniHack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper Game

A fully functional Minesweeper game that can be deployed as a website, similar to Google's Minesweeper game.

Features

Game Features:

  • Three difficulty levels: Easy, Medium, and Hard
  • Classic Minesweeper gameplay
  • Flag system to mark suspected mines
  • Flood fill algorithm for automatic cell revelation
  • Real-time timer and flag counter
  • Game status indicator (Playing, Won, Game Over)
  • Responsive design for mobile and desktop

Difficulty Levels

Difficulty Grid Size Mines
Easy 8×8 10
Medium 12×12 30
Hard 16×16 99

How to Play

  1. Click a cell to reveal it
  2. Right-click to place or remove a flag on a cell
  3. Numbers indicate how many mines are in adjacent cells
  4. Goal: Reveal all non-mine cells without hitting a mine
  5. The first click is always safe

Game Rules

  • Left-click to reveal a cell
  • Right-click to flag/unflag a cell
  • Flagged cells cannot be revealed
  • Empty cells (0 adjacent mines) auto-reveal adjacent cells
  • Hitting a mine ends the game
  • Revealing all non-mine cells wins the game

Deployment

Netlify (Recommended)

  1. Fork or clone this repository
  2. Connect your GitHub repository to Netlify
  3. Netlify will automatically deploy the site
  4. Your site will be live at a unique Netlify URL

GitHub Pages

  1. Go to repository Settings → Pages
  2. Select main branch as the source
  3. Your site will be available at https://yourusername.github.io/miniHack

Local Development

# Simply open index.html in your browser
open index.html

# Or use a local server
python -m http.server 8000
# Visit http://localhost:8000

Project Structure

.
├── index.html       # Main game HTML
├── styles.css       # Game styling (Google-inspired)
├── script.js        # Game logic and interactions
└── README.md        # This file

Browser Support

  • Chrome/Chromium
  • Firefox
  • Safari
  • Edge
  • Mobile browsers (iOS Safari, Chrome Mobile)

Technologies Used

  • HTML5 - Game structure
  • CSS3 - Styling with Grid layout
  • Vanilla JavaScript - Game logic (no dependencies)

Game Mechanics

Board Generation

  • The first click determines safe zones
  • Mines are placed after the first click to guarantee a winnable game
  • Numbers are calculated based on adjacent mine positions

Flood Fill

  • When you click an empty cell (0 adjacent mines), adjacent cells are automatically revealed
  • This continues recursively for all connected empty cells

Win Condition

  • Reveal all non-mine cells
  • A flag counter shows how many flags you can place

Styling

The game uses a clean, modern design inspired by Google's Minesweeper with:

  • Google-like color scheme
  • Smooth animations and transitions
  • Responsive grid layout
  • Mobile-friendly interface

Future Enhancements

  • High score tracking (localStorage)
  • Sound effects
  • Leaderboard
  • Custom difficulty settings
  • Multiplayer mode
  • Dark mode

License

MIT License - Feel free to use and modify this project!

Contributing

Feel free to fork, modify, and submit pull requests to improve the game!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors