3D Game Programming

(C. Jardin) #1

CHAPTER 18


Project: Cave Puzzle


In this chapter we’ll build an action-based puzzle game. In the game, the
avatar can only move left or right, but to win, the avatar needs to reach the
top of the screen. The person playing the game can move and rotate ramps
to help the avatar reach the top of the screen and win. To make it even more
challenging, the game board includes some objects that can’t be moved.

A sketch of the game might look something like this:


We’ll be putting all our newly acquired object-oriented programming skills to
good use in this chapter, so refer back to Chapter 17, Project: Learning about
JavaScript Objects, on page 159, as needed.

19.1 Getting Started


We begin by creating a new project in the ICE Code Editor. Let’s use the 3D
starter project (with Physics) template (you need to change the template this time)
and call it Cave Puzzle.

When you’re done with this chapter, you will


  • Know how to move things with a mouse

  • Have another full-featured game to share


Prepared exclusively for Michael Powell report erratum • discuss

Free download pdf