- This is a sokoban game made in Java with JavaFx.
- AE2DMS-Coursework 2020.
- Generated by Xi WANG(scyxw5@nottingham.edu.cn) using IntelliJ IDEA.
- All the pictures used in the game are drawn by myself.
- WASD/Keys : Keeper move
- U/R : undo/reset
- C/T : Show current/total moves count
- O : background music on/off
-
Start Page
-
User can finish the level only when all the balls were picked and all the crate on diamonds.
-
Show Current/Total movement
Click menu bar or type 'C' or 'T'.
-
Save/Load Game Archive
-
Load Own Map from local
-
load their own map by clicking this menu.
-
Notice that the map type shod match the demo map type inside resources package.
-
To be fair, score can't be saved if user is playing their own map and finished.
-
-
Level Completed message
Shown every time you completed the current level.
-
Game Complete message
Shown every time you completed the whole game.
-
Save Score
This page will show after user completed the game
-
Cancel button to back to Start Page
-
Confirm button to save his score to ranking list.
-
-
Ranking List Show/Clear
Ranking list can be arranged in either positive or reverse order with the three items in the header (click the head and arrow will appear).
The Ranking table will show words"No record here" if no file 'score.dat' found or the file is empty. User can clear all records by clicking ClearAll .
-
Choose Level
But to be fair, if user didn't start the game from the first level and complete each level, the score will not allowed to save. In this case, my program will show you a error alert.
-
Show Operation Introdation
-
Game Option Page
-
Choose Keeper
Chosen keeper will be added in game.
Choose Background Music
Music apply/stop
- Apply button : start play the chosen music.
- Stop button: stop playing current music.
--module-path
/.../javafx-sdk-15.0.1/lib
--add-modules
javafx.controls,javafx.fxml
--add-modules
javafx.controls,javafx.media
| Design Pattern | Description |
|---|---|
| MVC Pattern | - Follows the Model-View-Controller architectural pattern. - Has controller (with classes like ChangePage, ChooseKeeper, etc.), model (with classes like GameEngine, GameGrid, etc.), and view (with ui_file and ui_image folders) components.- Refactored GameEngine into GameEngine, MapLoader, and KeysHandler.- Added MoveHistory and MoveObject to handle undo movement. |
| Singleton Pattern | - Utilizes the Singleton design pattern. - Exemplified by the alert module with classes ShowAlert and SingleObject.- Allows having a unique object (alert) directly without instantiating class objects. |
| Factory Pattern | - Applies the Factory design pattern. - Seen in the dialog module with DialogFactory and classes like ShowAbout, ShowCurrent, etc.- Can build different dialogs. |