Class Diagrams for Shooter3DFigure 23-2 shows the class diagrams for the Shooter3D application. The class names and public methods are included. Figure 23-2. Class diagrams for Shooter3DShooter3D is the top-level JFrame for the application, and very similar to the JFrame classes in earlier chapters. WrapShooter3D creates the 3D scene (as usual) and adds the gun, laser beam and explosion, as well as their controlling behavior. CheckerFloor and ColouredTiles manage the checkerboard as in previous chapters, but both have been modified to deal with floor picking. ExplosionsClip represents the explosion, GunTurret the gun, and LaserBeam the laser beam. ExplosionsClip uses ImagesSeries to animate the explosion. ShootingBehaviour contains the behavior triggered when the user clicks on the floor. Its picking capabilities come from being a subclass of PickMouseBehavior, a Java 3D utility class, which is itself a subclass of Behavior. The tasks of firing the laser beam and triggering the explosion are delegated to the FireBeam tHRead.
|