packages/flame_behavior_tree/behavior_tree/README.md
Behavior tree is a very common way of implementing AI behavior in game and robotics. Using this, you can break-down a complex behavior of an in game AI, into multiple smaller nodes.
Add this package to your dart project using,
dart pub add behavior_tree
final treeRoot = Sequence(
children: [
Condition(() => isHungry),
Task(() => goToShop()),
Task(() => buyFood()),
Task(() => goToHome()),
Task(() => eatFood()),
]
);
final treeRoot = ...;
treeRoot.tick();