Game Development Reference
In-Depth Information
Updating the behavior tree
Now that the internals of our behavior tree are fleshed out, we can update the behavior tree
class with the Update and SetNode functions:
BehaviorTree.lua :
function BehaviorTree.new(userData)
local tree = {};
-- The BehaviorTree's data members.
tree.currentNode_ = nil;
tree.node_ = nil;
tree.userData_ = userData;
-- The BehaviorTree's accessor functions.
tree.SetNode = BehaviorTree.SetNode;
tree.Update = BehaviorTree.Update;
return tree;
end
Search WWH ::




Custom Search