Class Diagrams for Tour3D


Chapter 18. 3D Sprites

In this chapter, I'll develop a Sprite3D class, which can be subclassed to create different kinds of sprites. The user's sprite (a robot) and a chasing sprite (a hand) are shown in action in Figure 18-1 sharing the checkerboard with some scenery (a palm tree and castle) and obstacles (the red poles).

Figure 18-1. 3D sprites in action


Features illustrated by the Tour3D application include:


Sprite behavior

The sprites are controlled by Behavior subclasses.


A third-person camera

A simple third-person camera automatically adjusts the user's viewpoint as the user's sprite moves around the scene. The camera can be zoomed in and out by keyboard controls.


Obstacles

The scene contains obstacles that a sprite can't pass through. (They're represented by cylinders in Figure 18-1.) Sprites are prevented from moving off the checkered floor.


Collision detection

Collision detection between a sprite and the obstacles is implemented by bounds checking.


Scenery configuration

A "tour" text file loaded at start time contains obstacle and scenery information. The scenery models (e.g., the castle and the palm tree in this example) are loaded with PropManager objects.


A background image

The scene's background is drawn using a scaled JPEG.


Full-screen display

The application is configured to be full-screen.



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