Game Development Reference
In-Depth Information
Adding Detail
This chapter explains how to manage external assets such as 3D models, as well as
add details to your worlds with particle systems, sound, and graphic effects. It will
also elaborate on the arena first-person shooter game we built in Chapter 3 , Exploring
and Interacting , to turn it into a Capture-the-Flag game.
Setting up CTF
In order to have a proper Capture-the-Flag game, we first need to have teams. There
are several things that need to be associated with a given team:
• Flags (and the flag color)
• Players (and the player skins)
• Spawn points
• Bullets (if you want to avoid same-team damage)
• Potentially map decorations/materials
The simplest way to associate each of these elements with a team is to just add
a property with a simple value such as R or B to represent Red or Blue (or some
other team name). A more advanced approach could be to create a Team class
that holds references to everything that belongs to that team, since that could
offer optimizations such as limiting the number of collision checks that need to
be performed. If you do that, however, make sure you remove all the appropriate
references from the Team container when removing something (such as a bullet)
from the world in order to avoid memory leaks.
Search WWH ::




Custom Search