Game Development Reference
Figure 11.9 Flows added to get both gun and ammo.
arises is whether the ammo stays in your inventory or is lost when the gun is dropped.
This test is based on the ammo automatically loading when you have the matching
weapon, so the DropGun event will take you all the way from HaveGunHaveAmmo to NoGunNoAmmo .
Be careful not to get caught up in the symmetry that sometimes arises from the
diagram. Flows coming out of states don't always return to the previous state. The TFD
with these additional flows is shown in Figure 11.10.
At this point, evaluate whether there's anything else that could be added that remains
consistent with the purpose of this test. That is, are there any ways to manipulate the
ammo or the gun that would require new flows and/or states on the TFD? Start from
the furthest downstream state and work your way up. If you have the gun and ammo,
is there any other way to end up with the gun and no ammo besides dropping the
ammo? Well, shooting the gun uses ammo, so you could keep shooting until all of the
ammo is used up and then end up back at HaveGun . Since both of the states involved in
this transition are already on the diagram, you only need to add a new flow from
HaveGunHaveAmmo to HaveGun . Likewise, besides picking up an empty gun, you might get
lucky and get one with some ammo in it. This creates a new flow from NoGunNoAmmo to
HaveGunHaveAmmo . Figure 11.11 shows the diagram with these new interesting flows added.