COMP 303 Software Development - Fall 2011: Milestone 2
Due: 18:00, Monday, November 14, 2011
In this milestone you will add significant usability features to your game code. This milestone assumes you have a satisfactory code-base from your efforts on the
previous milestone (not all the previously required features need to be present, but basic functionality is necessary).
If you need help improving your code to reach an appropriate level, please see a TA or the instructor.
Requirements
- Game boards are currently created randomly, but this potentially results in boards that cannot be solved. Modify your game generation so only boards for which a solution exists are generated. Your design should allow for randomized generation of as wide a variety of initial boards as possible, and should work for (almost) any layout.
- Add the ability to save and restore the current game state to the file-system. For this you need to add both the functionality to save/restore, as well as an appropriate user interface. Your design must be based on serialization.
- Solitaire Mahjong can be made competitive by adding timing features, so players can compare their ability to complete the game in a given time limit:
- Add a timer GUI component, which continuously displays the current amount of time the player has taken.
- The timer should start once the first valid mouse-click is performed on the board of a new game.
- The timer should stop once once the game is terminated, either through win, loss or restart.
- A pause/continue interface should be added to the game interface, so a player can pause the timer and then continue it. While the timer
is paused the game should not allow user actions other than quit, restart, save, or restore.
- Add a hint mode:
- Clicking the hint button should toggle hint mode on/off. The hint-state is persistent until toggled off, a game is loaded, or a new game is started.
- In hint mode all tiles that have available matching pairs should be indicated in some fashion.
- In hint mode all tiles where the entire group of 4 is available should be indicated in some (other) fashion.
- Add an undo/redo facility:
- Define an appropriate and obvious interface to let the player undo (and subsequently redo) tile-pair removals.
- Undo and redo should be unbounded; that is, undo should allow tracing back to the board starting state, and redo should allow replaying undone moves in (reverse) order.
- Undo/redo information should be contained within the game save files.
- Add a high-score list:
- When a player is one of the 10 fastest to win a game he or she should be given the opportunity to enter his or her name in a high score list.
- High scores should not be recorded if the user has ever turned on hint mode, or used undo within the current game, or has loaded the game from a save file.
- High scores should be separately maintained for each board layout.
- High scores should be persistent (so restarting the application does not change high scores).
- An in-game interface needs to be provided to display the current high scores for the current board layout.
- All code must be well documented, including javadoc and internal comments as appropriate.
- You must incorporate (extensive) unit testing into your project. All important game behaviour and all significant methods should have associated unit tests based on JUnit. All tests must be linked from a class named
Milestone2Test.java
to make it easy to run all of them as a single suite.
What to hand in
You should hand in one archive-file and one document per group. Recall we are using moodle to handle the submissions.
- An exported project in a
zip
or tar.gz
file. This must include all files necessary to build and run your project, as well as all javadoc output. Please include your group number in the archive filename.
- A 1--2 page document describing your design. This should include components:
- a textual description of your strategy for building only solveable boards. Does your strategy allow you to generate all possible solveable boards (at least for, say, the turtle layout)? Give a convincing argument either way.
- an application state-diagram. There are now many buttons and options changing the state of your application. Show a state-diagram for your application (as a whole), adding states as appropriate with transitions to indicate how the state changes for each possible user interface action.
- a brief description of the specific contributions of each group member.
- Note: All documents should be provided using only common, OS-neutral format(s): pdf or ASCII text for textual documents, and pdf, png, gif, or jpg for images.
Evaluation
This milestone is worth 30% of the project component of your course grade. Grading will take the following into account:
- Code is well documented, clear and uniformly structured.
- Code provides the functionality listed above.
- Code is correct and does not exhibit bugs or other failures. Note we may apply tests of our devising (ie outside of your unit tests).
- Code is well-designed following the principles discussed in class.
- Unit tests provide extensive and relevant coverage of potential bugs and problems.
- The document supplied includes all components, correctly and cleanly expressed.
Note that all team members are expected to contribute in some fashion to all milestones. Your contribution to each milestone may be somewhat uneven, but your final project grade will be scaled according to your overall contribution throughout all the milestones.