Game Development Reference
In-Depth Information
The animation controller
Creating an animation controller will follow an object-oriented style that is similar to the
ASM. First, we create a new function that creates variables for holding commands and
command callbacks for the controller:
SoldierController.lua :
require "AnimationStateMachine"
require "Soldier"
function SoldierController.new(agent, soldier, weapon)
local controller = {};
-- The SoldierController's data members.
controller.commands = {};
controller.commandCallbacks = {};
controller.asms = {};
controller.executingCommand = nil;
controller.previousCommand = nil;
return controller;
end
Search WWH ::




Custom Search