3D Game Programming

(C. Jardin) #1
We make a copy because we have a good, working game that took us a while
to write. We can always delete it later if this game turns out great, but it
never hurts to make a copy.

Never Throw Away Working Code
If you have working code, always make sure you have a copy
somewhere. You might think your next changes are small and
couldn’t possibly break things. It is supereasy to break things
badly when programming, though. When that happens, a backup
is like gold. You can refer to your backup or delete your new code
and start again.

After clicking Make a Copy, you’ll get the usual save dialog. Name this game
Multi-Level Cave Puzzle and click Save.

We’re now ready to code—all of the physics and camera work were already
done in the last chapter.

19.2 Building Levels


There are lots of ways for programmers to move players between levels. One
way is to remove everything from the screen—even the scene itself—before
rebuilding a new scene from scratch on the next level. For this to work, the
game has to store information like the number of points the player currently
has, items the player may have picked up, and levels already completed. This
approach works well on consoles like the Wii or Xbox.

Chapter 19. Project: Multilevel Game • 178


Prepared exclusively for Michael Powell report erratum • discuss

Free download pdf