Skip to content

xxiixi/Sokoban2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sokoban-20127004

Introduction

  • 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.

Controls

  • WASD/Keys : Keeper move
  • U/R : undo/reset
  • C/T : Show current/total moves count
  • O : background music on/off

Features

  • Start Page

    shot0
  • Pick balls and push cratesshot22

    User can finish the level only when all the balls were picked and all the crate on diamonds.

  • Show Current/Total movement

shot28shot3

​ Click menu bar or type 'C' or 'T'.

  • Save/Load Game Archive

    shot24
  • Load Own Map from local

    shot23
    • 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

    shot2

    Shown every time you completed the current level.

  • Game Complete message

    shot4

    Shown every time you completed the whole game.

  • Save Score

    shot5

    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

    shot6

    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).

    shot9

    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 .

shot30

  • Choose Level

    shot7

    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.

    shot16
  • Show Operation Introdation

    shot13shot14shot15

  • Game Option Page

    shot8
  • Choose Keeper

    shot11

    Chosen keeper will be added in game.

    Choose Background Music

    shot12

    Music apply/stop

    • Apply button : start play the chosen music.
    • Stop button: stop playing current music.

Edit Configuration

--module-path
/.../javafx-sdk-15.0.1/lib
--add-modules
javafx.controls,javafx.fxml
--add-modules
javafx.controls,javafx.media

config

configg

Design Patterns

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.

About

This is a Sokoban game made in Java with JavaFx. [University of Nottingham Ningbo China AE2DMS-Coursework 2020 ]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors