Figure 3-2 shows the class diagrams for the WormChase application. The class names and public methods are shown. Figure 3-2. Class diagrams for the WormChase application
WormChase is the top-level JFrame, managing the GUI, and processing window events. WormPanel is the game panel holding the threaded animation loop. The Worm class maintains the data structures and methods for the on-screen worm. The Obstacles class handles the blue boxes. Worm and Obstacles have their own draw( ) method, which is called by WormPanel to render the worm and boxes. |