Game Development Reference
In-Depth Information
Now how about adding a Startup trigger? The TFD Enter flow jumps right to the
point where the player is active in the match. In reality, there is a “pre-game�? period
where the player can run around the arena before hitting the “fire�? button (usually the
left mouse button) to initiate the match. This is relevant to the purpose of the test
because a player who runs over weapons or ammo during this time should not accu-
mulate any items as a result.
Represent this startup process on the TFD by performing “mitosis�? on the NoGunNoAmmo
state. That is, split it into two connected states. One state retains the original name
and connections (except for the Enter flow) while the other captures the dry run and
countdown behavior. Figure 15.11 shows the process of splitting this portion of the
The new PreMatch state can be
introduced to the TFD. Start by
disconnecting the Enter flow from
NoGunNoAmmo and attaching it to
PreMatch . Then add flows to attempt
GetAmmo and GetGun during the PreMatch
period. These flows are Startup
triggers. Figure 15.12 shows how
this looks.
Next add the Restart trigger to the
diagram. It's possible to change
your status to Spectator in the mid-
dle of a match and then Join back
in as a participant. Spectator mode
takes your character out of the
game and lets you follow players in
the game while you control the
camera angle. Any guns or ammo
picked up prior to entering Spectator mode should be lost when you Join to return to
the same match in progress. Rejoining the game from Spectator mode is done instant-
ly without the countdown timer that you get when you start the match for the very
first time. Suspending and rejoining can be done at any time during the match after
the initial countdown timer has expired. Add a SpectateAndJoin flow from each of the
in-game states on the TFD and tie it back to NoGunNoAmmo . Don't forget the loop flow
from NoGunNoAmmo back to itself. A TFD with these updates is shown in Figure 15.13.
Figure 15.11 NoGunNoAmmo state mitosis.
Search WWH ::

Custom Search