Game Development Reference
Note that some of the existing flows were moved around slightly to make room for the
new flows and their text. ShootAllAmmo will cause sounds, graphic effects, and damage to
another player or the environment. Doing GetLoadedGun will cause effects similar to the
combined effects of separately picking up an unloaded gun and its ammo. The actions
for these new events were named AllAmmoEffects and LoadedGunEffects to reflect the fact
that these multiple effects are supposed to happen and need to be checked by the
tester. The ShootAllAmmo event illustrates that your test events do not have to be atomic.
You do not need a separate event and flow for firing each individual round of ammo,
unless that is exactly what your test is focusing on.
Do the same for HaveGun and HaveAmmo that you just did for HaveGunHaveAmmo . Question
whether there are other things that could happen in those states to cause a transition
or a new kind of action. You should recognize that you can attempt to fire the weapon
at any time whether or not you have ammo, so a flow should come out from HaveGun
to represent the game behavior when you try to shoot with no ammo. But where does
this flow go to? It ends up right back at HaveGun . This is drawn as a loop as shown in
At this point, only two things remain to do according to the procedures given earlier in
this chapter: add the OUT box and number the flows. Keep in mind that the numbering
is totally arbitrary. The only requirement is that each flow has a unique number.
Figure 11.12 Flow added to shoot gun with no ammo.