The Simulation Classes

As usual we'll create a single class for each object in our world. We have the following:

■ Shield Blocks

The orchestration is performed by an all-knowing World class. As you saw in the last chapter, there's really not such a huge difference between 2D and 3D when it comes to object representation. Instead of GameObject and DynamicObject, we'll now use GameObject3D and DynamicObject3D. The only difference is that we use Vector3 instances instead of Vector2 instances to store positions, velocities, and accelerations, and that we use bounding spheres instead of bounding rectangles to represent the shapes of our objects. All that's left to do is implement the behavior of the different objects in our world.

0 0

Post a comment