Class Diagrams for the WormChase Application

Figure 3-2 shows the class diagrams for the WormChase application. The class names and public methods are shown.

Class diagrams for the WormChase application

Figure 3-2. Class diagrams for the WormChase application

Tip

The code for this version of WormChase is in the directory Worm/WormP/.

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.

Get Killer Game Programming in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.