Your first task is to choose a simple one-player, two-dimensional (2D) board game, and then implement the 'engine' of that game in Java. You should write some unit tests to check that your game logic works correctly.
You second task is to use JavaFX to add a graphical user interface (GUI) to your game, which displays the 2D board and allows the user to play the game. So you must keep the basic game idea fairly simple, and ensure that it is not too hard to add the GUI to it. You MUST use JavaFX, not any other Java GUI libraries.
You must implement the game called "FullHouse" from:
This is a simple 2D puzzle game that uses a discrete 2D grid for the playing board. The game requires the player to move one blue piece around the board (using arrow keys or mouse clicks) to try and visit ALL the empty squares. To make the puzzles more challenging, the player can click at the beginning to choose a starting location. This game was invented in 2004 by Erich Friedman.
Hint: to solve Puzzle 1, try starting at position (2,2)?
1.Set up your Git Repository. When you click on the Blackboard link for this assignment, you will automatically create your own private GitHub repository containing two simple modules: boardgame_engine and boardgame-gui.
2.Check you can run JavaFX. I have set up the boardgame-gui project to use the 'Gradle' build tool, which means that it should automatically download and install the necessary JavaFX and JUnit libraries when you build and run the project on each new computer. (You may see a popup message down the bottom of IntelliJ: "Gradle projects need to be imported". Click on "Enable Auto-Import" and IntelliJ will automatically download and install JavaFX for you! If IntelliJ asks you for the location of Gradle, you may need to turn off the "Use local gradle distribution" and select the alternative option: "Use gradle 'wrapper' task configuration" - this uses the gradle that is built into IntelliJ). Run the RunGame class to check that you can run the GUI it should show a simple GUI with a single button that says: "Amazing Board Game coming soon".
3.Data Design Decisions: Think carefully about whether each cell in your board should be a primitive value (like a boolean, an integer, or an enum value), or should it be an object? Using objects is more flexible, since it allows you to use Java subtyping to make different cells have different behaviour. But many of the games suggested above do not require the cells to have fancy behaviour, so a primitive value might be sufficient for your game.
4.Implement and Test Your Game Engine: I strongly suggest that you use TDD to develop your unit tests and game engine at the same time, in parallel. Recall: Write a test for each new feature and check that it fails, then implement that feature in your engine classes and rerun the test to check that it now passes. Repeat You can refactor (rename and reorganise) your code at any stage, if you see a way of making it simpler and more elegant. By the time you have finished implementing your game engine, one (or several) of your tests should be stepping through a complete game from start to end, calling the methods of your engine API and checking the results, including the game win/lose verdict at the end.
5.Class Relationships: To get high marks, your engine needs to include several Java classes, with some association/composition relationships between them, and if possible, some inheritance relationships. Think about where you can best use these Java features.
The goal of this stage is to use JavaFX to add an elegant and fully functional GUI to your game so that it can more easily be played on desktop computers. Your GUI should have the following features:
Start by drawing one or two paper sketches of the GUI you plan to build. Take a photo of each sketch, as you will need to include these in your final report.