Racing Game

Zach Rose

Project Description

My final project for CPE471 Fall 2016 was a racing game. The game is a one lap track where the user goes around collecting coins in a set order. The car goes full speed only when on the track, if the car ventures off course, the speed of the car is greatly diminished. When the user obtains all the coins, the game will quit and will print out the time it took.

Game Controls

Graphics Technology

The new technology that I used in this project was splines. Splines were helpful here to get nice smooth curves for the track. For splines, I used Catmull-Rom splines. For Catmull-Rom splines, we need four control points, two end points and two middle points where the curve will be drawn across. Each of these control points are represented with a coin. I iterate through the coins drawing a curve between each two. For example, we use coin 1, 2, 3, and 4 for a spline with 1 and 4 as the endpoints. For the next spline, I use coin 2, 3, 4, and 5 as control points with 2 and 5 as endpoints. The endresult is a smooth curve along the track

Other technologies that I used before include hierarchial modeling on the car, phong shading on the trees and car, and textures for the ground and track. Collision detection in this game is basic since the car will never leave the y-axis. Due to this, a simple distance calculation for testing if the car is on the track or not and for collecting the coins suffices. This distance calculation is also used for testing if the car is on the track or not Some basic physic calculations were used for calculating the car's inertia. The car will coast to a stop if the car releases the gas pedal. Likewise braking is not immediate. Some calculations were given so that the car's wheels will look functional.

Project Screenshots

The sharpest turn in the track. Demonstrates the cuves created by the splines. The red coin is the next coin to collect and the yellow coin is not. The splines are flattened down spheres with a cobble texture over it.

The same scene of the previous screenshot but in first person view.

One part of the track where you can see the opposite side of the track through the trees.

One turn of the track showing the wheels turning as I turn to the right.