Class Diagrams for BugRunnerFigure 11-2 shows the class diagrams for BugRunner application. The class names and public methods are given for the new classes, but only class names are supplied for the imaging and audio classes, which are unchanged from earlier chapters. Figure 11-2. Class diagrams for BugRunner
The top-level JFrame (BugRunner) and the games panel (BugPanel) use the windowed animation framework developed in Chapters 2 and 3. In particular, the complicated run( ) method in BugPanel is almost identical to the one in WormPanel in Chapter 3. If you're unfamiliar with it, then you should look at Chapter 3 before continuing. The new material is mostly concentrated in the Sprite class and its subclasses, BallSprite and BatSprite. BallSprite manages each ball, and BatSprite handles the ant.
The code for the BugRunner game can be found in the BugRunner/ directory. |