Skip to Main Content
Killer Game Programming in Java
book

Killer Game Programming in Java

by Andrew Davison
May 2005
Intermediate to advanced content levelIntermediate to advanced
998 pages
26h
English
O'Reilly Media, Inc.
Content preview from Killer Game Programming in Java

Class Diagrams for Mover3D

Figure 20-7 shows the class diagrams for the Mover3D application. The class names, public and protected methods, and data are shown.

Class diagrams for Mover3D

Figure 20-7. Class diagrams for Mover3D

Mover3D is the top-level JFrame for the application, containing two JPanels. The 3D scene is created in WrapMover3D and displayed in its panel, the text field for entering commands and Reset button are managed by CommandsPanel. The LocationBeh behavior deals with user input via the keyboard, and enables the figure to be moved and rotated.WrapMover3D creates the usual checkerboard scene, using the CheckerFloor and ColouredTiles classes (first used in Chapter 15) to create the floor.

The scene contains one Figure object that represents the figure as a series of connected shapes created from the Limb class and its subclasses (MoveableLimb , MoveableEllipticLimb , and EllipticLimb ). The shape of a limb is specified using a LatheShape3D or EllipseShape3D object, both described in Chapter 17. The choice depends on the cross-sectional shape you want for a limb: LatheShape3D offers a circular cross-section suitable for arms and legs, and EllipseShape3D is a better choice for a torso (which is closer to elliptical).

Tip

The code for this example can be found in the Mover3D/ directory.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Game Development with LibGDX: From Beginner to Professional

Java Game Development with LibGDX: From Beginner to Professional

Lee Stemkoski

Publisher Resources

ISBN: 0596007302Supplemental ContentErrata Page