Java implementation of the classic Minesweeper game, using JavaFX for the graphics. Created as part of a course on object-oriented programming at NTNU Trondheim, spring 2019. Updated for readability and distributability spring 2022.
Table of Contents
-
Download the latest
minesweeper.jar
from Releases (https://github.com/hermannm/minesweeper/releases) -
Double click the downloaded
.jar
to run it!- Mac users may have to allow it through
System Preferences -> Security & Privacy
- Mac users may have to allow it through
You can also run the JAR from the terminal:
java -jar minesweeper.jar
- Clone the repo
git clone https://github.com/hermannm/minesweeper.git
- Navigate to the new folder
cd minesweeper
- Build the project
./gradlew build
- Run the app
./gradlew run
src
contains the Java packages for the project.- Package
dev.hermannm.minesweeper
contains the entry point of the application, as well as its controller and game mode configuration.- Subpackage
game
contains the game logic for Minesweeper. - Subpackage
gui
contains the JavaFX graphical user interface for the game. - Subpackage
io
contains a class for saving and loading games to and from text files.
- Subpackage
- Package
resources
contains the static assets for the app.styles.css
is the JavaFX CSS stylesheet for the UI.fonts
contains the font files used in the stylesheet.img
contains the Minesweeper icons used in the stylesheet and the game.
build.gradle.kts
contains the Gradle build config for the project.
- The team behind OpenJFX
- Gezoda for the wonderful Minesweeper font
- Wikimedia for hosting the Minesweeper icons