Game Development Reference
In-Depth Information
The random movement state
A random movement state is only responsible for picking a location to move to; once a loc-
ation is found, our agent will proceed to the move position state to complete the action.
The soldier's FSM random move state
Separating position selection and processing of a position allows us to minimize all pos-
sible transitions that need to be taken care of from the random movement state:
SoldierLogic.lua :
function SoldierLogic_FiniteStateMachine(userData)
...
-- random move action
fsm:AddTransition(
"randomMove", "die", SoldierEvaluators_IsNotAlive);
fsm:AddTransition(
"randomMove", "move", SoldierEvaluators_True);
fsm:SetState("idle");
Search WWH ::




Custom Search