Game Development Reference
In-Depth Information
The flee state
As fleeing is a state our agents cannot exit from, we can loop directly into another flee ac-
tion until our agents die.
The soldier's FSM flee state
The only way for our agent to exit from fleeing its enemy is through death:
SoldierLogic.lua :
function SoldierLogic_FiniteStateMachine(userData)
...
-- flee action
fsm:AddTransition(
"flee", "die", SoldierEvaluators_IsNotAlive);
fsm:AddTransition("flee", "move",
SoldierEvaluators_True);
fsm:SetState("idle");
return fsm;
end
Search WWH ::




Custom Search