The Sound of Shooting


Class Diagrams for Shooter3D

Figure 23-2 shows the class diagrams for the Shooter3D application. The class names and public methods are included.

Figure 23-2. Class diagrams for Shooter3D


Shooter3D 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.

All the code for this example can be found in the Shooter3D/ directory.




Killer Game Programming in Java
Killer Game Programming in Java
ISBN: 0596007302
EAN: 2147483647
Year: 2006
Pages: 340

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net