Skip to content

Xinrt/UNNC_sokoban_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AE2DMSCW-20126518

(word counts: 500 number of figures: 3)

[TOC]

Refactoring

1. OO design pattern

1.1 Factory Pattern

1.1.1 event

​ I applied factory design pattern for game events.

​ One eventHandleInterface.java interface, one eventFactory.java factory and 9 entities: closeGame, loadGame, resetLevel, saveGame, showAbout, showVictoryMessage, toggleDebug, toggleMusic and undo

1.1.2 music

​ I applied factory pattern for two kinds of music: background music and bomb music.

​ One Music.java interface, one MusicFactory.java factory and 2 entities: backgroundMusic and bombMusic.

1.1.3 engine

​ I applied factory pattern to move functions:

​ One abstract class Engine.java , one factory engineFactory.java and three entities: moveEngine, moveRedEngine and removeObject

2. GUI design pattern

I applied MVC for GUI design pattern.

2.1 V - Version

2.1.1 In InfoScreen.fxml view:

InfoScreen

2.1.2 In StartScreen.fxml view:

startScreen

2.1.3 In TouristMode.fxml view:

TouristMode

2.2 C - Controller

InfoScreenController

StartScreenController

TouristController

3. Refactoring methodologies

3.1 Corrective Maintenance -finding and fixing errors

3.1.1 complete toggle music function

​ I use an integer variable toggleMusicTimes to count the click times.

3.1.2 complete undo function

​ I use an ArrayList<String> to store all current levels and if user choose undo, remove the last element and assign the newly last element value to current level then reload game grid.

3.1.3 complete reset level function

​ I use the ArrayList<String> created in undo

3.1.4 complete save game function

​ I write the levels including current level and the remaining to a new .skb file.

3.1.5 correct codes

​ I corrected some codes for passing game levels.

3.1.6 remove unused codes

3.2 Dividing all classes into packages

​ I divided whole program codes into four big packages: controller, entity, enums and util.

3.3 using encapsulation

​ I made some fields to be private in a package.

3.4 make classes have single responsibility

Addition

​ A Top5 high scores dialog after each game level (5 minimum moves counts), and Top1 if there are less than 5 playing times.

​ A start screen with background and two button: Start, Info.

​ A screen shows how to play this game.

​ Keepers can be transfered from one door to another side.

​ Keepers cannot stand on the ice floor.

​ Provide red and blue two keepers.

​ Keepers can use bomb to blow up any object in four directions (up, down, right, left)

​ all functions at menu bar have their own corresponding shortcut key.

​ LevelName: Add a new Level ~ as the final game level

10. add UI

​ add pictures for game objects

11. add Maven

​ A ae2dms-cw-20126518-1.0-SNAPSHOT.jar package used to run program directly.

Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published