3D Game Programming

(C. Jardin) #1

CHAPTER 16


Project: Tilt-a-Board


In this chapter we’ll build a 3D game in which a ball lands on a game board
in space. The object of the game is to use the arrow keys to tilt the board so
that the ball falls through a small hole in the center of the board—without
falling off the edge. It will end up looking something like this:

We’ll make this game pretty, so we’ll be using skills from Chapter 12, Working
with Lights and Materials, on page 109. We’ll need physics to make the ball
fall, to make it slide back and forth on the game board, and to detect when
it hits the goal, so we’ll use some of the skills from Chapter 15, Project: The
Purple Fruit Monster Game, on page 133. And we’ll be adding a lot of shapes
and moving them around, so we’ll need the skills from the first half of the
book, as well.

A word to the wise: there’s a ton going on in this game, which means we’ll be
typing a lot of code. We won’t be talking much about the code since a lot of
it uses concepts from earlier chapters. If you haven’t already worked through
those earlier chapters, coding this game may be frustrating!

When you’re done with this chapter, you will


  • Know how to build a full 3D game

  • Know how to build complex 3D shapes

  • Begin to understand how interesting
    shapes, materials, lights, and physics work
    together in a game


Prepared exclusively for Michael Powell report erratum • discuss

Free download pdf