Game Development Reference
In-Depth Information
if(Amount < 0)
{
if(!isSuspicious)
{
isSuspicious = true;
ChangeBehavior(Behaviors.Guard);
}
}
}
This function takes a string and an integer. The string is used to search for the spe-
cific stat that we want to affect and the integer is how much we want to affect that stat
by. It works in a very similar way to how the ChangeHealth function works, except
that we first search for a specific stat. We also check to see if the amount is negative.
This time, if it is negative, we change our AI behavior to Guard . This seems to be an
appropriate response for the AI after being hit by something that negated one of its
stats!
Search WWH ::




Custom Search