Game Development Reference
In-Depth Information
2.6 Implementing car racing games input system
Car racing input systems are similar to some extent to third person input systems, espe-
cially in terms of the position of the camera. However, there are still few differences as we
are going to see. Let's begin with an object that represents the car, and here I am going to
use a cube with dimensions of (2, 1, 3.5). Let's also add a ground, which is a plane with
a scale of (100, 1, 100). Remember that the default side length of the plane is 10 units, so
the total side length after scaling is going to be 100 * 10 = 1000 units. This is equal to one
square kilometer, since each unit equals one meter. I am going also to use an asphalt texture
for the ground, in addition to a directional light. Finally, we add two empty game objects
as children to the car object, and these are going to be used as axes for car rotation. First
object is RotationAxisR , which is located to the right of the car and has the local position
(1, 0, 0), and the other is RotationAxisL , which has the local position (-1, 0, 0). The scene
we are going to use is shown in Illustration 25.
Illustration 25: A scene to demonstrate the car racing input system
The difference is that we are not going to add the camera as a child to the car like we have
done with the player character in the third person input system, and this is going to serve
a nice effect as we are going to see. Another difference is the way the car moves, which is
not similar to the persons' movement we have seen so far. Car speed is not constant, but
Search WWH ::




Custom Search