Game Development Reference
In-Depth Information
A simple, finite state machine
Now that we've implemented the internals of each state, we can flush out the basic FSM
that controls when each state function is to be called. We'll begin by getting some local
variables out of the way and different flags for stance variation:
DirectSoldierAgent.lua :
local _soldier;
local _soldierAsm;
local _soldierStance;
local _soldierState;
local _weaponAsm;
-- Supported soldier stances.
local _soldierStances = {
CROUCH = "CROUCH",
STAND = "STAND"
};
Search WWH ::




Custom Search