Game Development Reference
In-Depth Information
Figure 6-2. The collectable gun weapon
Note This chapter assumes you're resuming work from where we left off in the previous; or else you can
begin from the starting project associated with this chapter, included in the topic companion files inside folder
Chapter06/Start .
Fists/punch. Perhaps the most common default weapon in any FPS shooter
(as well as the weakest) is the fists/punch. The fists/punch is the “old reliable”
weapon: short-ranged, weak, and typically used only as a last resort—when
all other weapons have expired. The main advantage of the fists/punch is their
infinite reusability : they never run out of ammo, simply because they're not
the kind of weapon to require ammo. In CMOD, the Player begins with the
fists/punch weapon.
Gun. Now, if the gamer is smart or just very, very lucky, then he'll collect the
gun weapon, which is a marked improvement over the fists/punch. The gun
allows ranged attack and deals heavier damage than fists/a punch. But, its
ammo is limited . This means, it has a finite number of uses. After all bullets have
been fired, the weapon expires and remains unusable— unless more ammo is
collected. If the gun expires, the gamer must resort to the next best weapon,
which will be fists/punch in our work here, since we're only making
two weapons.
Object Orientation: Classes and Instances
This topic assumes you're already familiar with the basics of C# and coding in Unity. Part of that
fundamental knowledge includes a general understanding of objects and object orientation. Indeed,
we've already made extensive use of these concepts in creating many classes over previous
chapters, such as classes for events, power-ups, and player controllers. But before proceeding
further, let's revisit object orientation to reinforce our understanding. Object orientation will be critical
for our work with weapons.
 
Search WWH ::




Custom Search