CS 124, Spring 2014
Labs 13 and 14: Hangman Continued
For the final two labs of the semester, you should continue working on the final project that was begun in Lab 12. You should not create a new Eclipse project for Labs 13 and 14. You should continue working in your lab12 folder, and you should submit lab12 to your homework folder in /classes/cs124/homework when you are done. Remember that you must turn in your work by Monday, May 12, the day after the final exam. Also, remember that the work that you do for this project should be entirely your own.
Lab 13: Game Logic
You should already have the GUI for your program ready to go. The next part of the project is to implement the game logic. That is, you should make it possible for the user to play the game. You should have a working game by the start of Lab 14.
We briefly discussed in class some of the global data that you will need to implement the game. In addition to the buttons, this includes at least the word that the user is trying to guess, the letters that the user has guessed so far, the number of incorrect guesses that the user has made, and a boolean variable to record whether or not the game is over. Remember that global data are stored in instance variables. The values of the variables change in response to events, and they can be used by paintComponent to decide what to draw. You should carefully analyze what has to happen in your event handler and what the paintComponent method is supposed to display at any given time during a game and when a game is over.
You will also need a source of words for the game. If you have not already done so, you can copy the folder named words from /classes/cs124/lab12-files into the src folder in your project. This package and how to use it were already discussed in Lab 12
Lab 14: Polish
We meet for a final lab on the very last day of classes for the semester, Tuesday, May 6. Hopefully you will have a working game by the time you arrive at the lab. You can use the time to add polish and maybe some additional features to your program.
The program that you turn in for this project should be well-documented, and it should carefully follow all the other rules of good programming style. The code should be well-organized and efficient.
A correct but minimalistic game will not receive full credit. The game should be fun to play, and it should keep the user informed about exactly what is going on.
Think about adding some extra features. I've mentioned providing the user with a choice of several different word lists to choose from. You might implement levels of difficulty by varying the number of incorrect guesses that are allowed. You could think about adding sound effects (Section 13.1.3). Maybe even some animation (Section 6.5.1).