Introduction
In labs 7, 8 and 9 you will build a version of the game KeyBricks, which you can play
here:
[login to view URL]
Each of these labs sets out milestones which you are expected to reach along the way
to building a fully functional game.
In these labs you will put into practice things we have discussed in lecture, among
them these recent topics:
Collections
Control structures (conditionals and loops)
The observer pattern
Primitives
This sequence of labs is the culminating project of the semester, so you will of course
have to draw on all your knowledge from the course to build your solution. Recall the
discussions we’ve had about good code design: use methods and classes to modularize
your code, so that each method/class has a clear, well-defined role to play in the
overall system. Avoid both code and data duplication!
By the end of lab 7 your game must, at least:
• Have a 1 by 4 board (a single column of four rows).
• Place a tile, each with a distinct letter, into each of the four positions.
• Respond as keys are typed by removing a tile when its letter is typed.
• Have tiles above the removed tile drop down.
• End the game when all tiles have been removed.
In labs 8 and 9 you will add the remaining functionality of the game, and maybe some
more! :-)
Hints for lab 7
Here is a list of hints on how to build for lab 7. You don’t have to do things as
suggested, but you might find it helpful.
1) Keep the data model and the user interface separate. Your TA will describe this
in more detail. Build a representation of the data on the board independently of any
graphical visualization of that data. Build a separate graphical user interface (GUI)
which simply displays the data stored in the model. Make the GUI an observer of the
data model, so that when the data model changes the GUI receives notification. To
update the GUI simply updates what it displays. The GUI