Game Development Reference
In-Depth Information
Creating a behavior tree object
Creating a behavior tree object is simple, as it primarily consists of a root node, evaluation
function, and update function:
BehaviorTree.lua :
require "BehaviorTreeNode"
BehaviorTree = {};
local _EvaluateSelector;
local _EvaluateSequence;
function BehaviorTree.SetNode(self, node)
tree.node_ = node;
end
function BehaviorTree.new()
local tree = {};
-- The BehaviorTree's data members.
tree.currentNode_ = nil;
tree.node_ = nil;
return tree;
end
Search WWH ::




Custom Search