Skip to content

mujaddidfa/JavaMineSweeper

Repository files navigation

JavaMineSweeper

JavaMineSweeper is a classic Minesweeper game implemented in Java with a graphical user interface using Swing. This game allows players to enjoy the timeless challenge of uncovering tiles while avoiding hidden mines.

Features

  • Three difficulty levels: Beginner, Intermediate, and Expert.
  • Customizable tile size, providing a personalized gaming experience.
  • Timer to track the time spent on each game.
  • Reset button for restarting the game at any time.
  • Visual indicators for mines, flagged tiles, and question marks.

How to Play

  1. Run the App class to start the game.
  2. Choose the difficulty level (Beginner, Intermediate, or Expert) to start a new game.
  3. Left-click on a tile to reveal its content. If it contains a mine, the game ends.
  4. Right-click on a tile to flag it as a potential mine. Right-click again to mark it with a question mark.
  5. The objective is to uncover all tiles without revealing any mines.
  6. The timer keeps track of the time spent on the current game.

Sound Effect

The game features an explosion sound effect when a mine is revealed. The audio file (explosion.wav) is included in the audio folder.

Customization

Feel free to modify the code and experiment with different tile sizes, fonts, or even add new features. The structure is designed to be easily extendable.

Notes

  • The game may prompt you to select a difficulty level when started.
  • The game ends when a mine is revealed, and the last game time is displayed.
  • The "Mines Cleared" message appears when all non-mine tiles are revealed.

Dependencies

  • Java Runtime Environment (JRE) 8 or higher.

Acknowledgments

  • The project utilizes the Swing library for creating the graphical user interface.
  • Sound effects obtained from mixkit.co.

YouTube Presentation

YouTube-Presentation

https://www.youtube.com/watch?v=ge-lmn8FQ_Q

Credits

This program was obtained from Kenny Yip Coding (ImKennyYip) and developed by myself.

Enjoy playing JavaMineSweeper! If you have any feedback or suggestions, feel free to contribute or open an issue.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages