BehaviorTree

BehaviorTree

Creates behavior trees.

Constructor

new BehaviorTree($node)

Description:
  • Creates a new behavior tree.
Source:
Example
const first = new BehaviorTreeNodeAction(handler);
const second = new BehaviorTreeNodeAction(handler);

const selection = new BehaviorTreeNodeSelector([first, second]);

const tree = new BehaviorTree(selection);

const success = tree.tick(timetick);
Parameters:
Name Type Description
$node BehaviorTreeNode The root node.

Methods

tick($timetick) → {boolean}

Description:
  • Updates the behavior tree by one tick update.
Source:
Parameters:
Name Type Description
$timetick number The tick duration (in ms).
Returns:
Type
boolean