Game Development Reference
An incomplete monster attempts to think.
Our lobotomized monster complains about missing two-thirds of its brain, but
other than that, it performs reasonably well. The second error check we added to
RunAI in the FSM has proven its worth. If your monster is having trouble thinking
even that much, add Debug.Writeline statements anywhere in the code. The
output appears in the Immediate window at the bottom of the development
environment. (You can see this window in Figure 3.5, although it has nothing
written in it.) Now that our monster thinks, we should enhance it with more
brain power by finishing the other two states and their transitions.
According to Figure 3.2, the Attack state needs two transitions. Go to Attack
State.vb and add the following two classes after the End Class line. VB will help
you by supplying End Class lines as well as the skeletons for the ShouldTransition
members. There are no new concepts in any of this code; it asks the same
questions of the world we saw in SeePlayerHighHealthTxn . With good classes,
once the hard part of creating the structure is complete, bolting in the rest is
simple and straightforward.
Public Class NoPlayersTxn