A simple JavaFX GUI of the Minesweeper game
v1.0
built by Ashley Liew
- layout similar to typical Minesweeper game
- new game button, game over modes, different sizes and densities available
- only basic commands (reveal, flag, unflag)
- Install the necessary software above.
- Take note of the directory path where you install JavaFX, specifically the
lib
folder. - In your command line, go to the directory where you download the JAR file.
- Type in this command:
java --module-path
path-to-javafx-lib--add-modules javafx.controls,javafx.graphics -jar MinesweeperGUI.jar
(view footnote) - Press 'Enter' and play!
Example: Let's say the path to your JavaFX lib file is: C:\javafx\javafx-sdk-11.0.2\lib
The command you will put in will be: java --module-path \javafx\javafx-sdk-11.0.2\lib --add-modules javafx.controls,javafx.graphics -jar MinesweeperGUI.jar
I used recursion to implement Minesweeper which limits the possible dimension sizes due to stack overflow for large sizes (80-90+ rows and columns). The grids will not reveal and the command line where you write the program will display an error.
All graphics (not including the JavaFX components) are made by me, except for the ‘7’ icon for the numbered cell, Rosé pictures on the new game button (which were sourced from Google), and the flag icon (credit below).
- "File:HistoryIcon.svg" by Ludvig14 is licensed with CC BY-SA 3.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0