Polish up behaviour tree, add docs

This commit is contained in:
2024-01-11 09:33:51 +01:00
parent 36d8bac7c4
commit 25a3229bb2
5 changed files with 192 additions and 37 deletions

View File

@@ -26,12 +26,12 @@ bool init(int *game) {
// delay 1s
// print "Hello, world!"
printBT = bzBTMakeRoot(nodePool);
BzBTNode *pseq = bzBTCompSelector(nodePool, printBT, true);
BzBTNode *pseq = bzBTCompPSelector(nodePool, printBT);
bzBTDecorDelay(nodePool, pseq, 2.0f);
BzBTNode *node = bzBTDecorRepeat(nodePool, pseq, 5);
BzBTNode *seq = bzBTCompSequence(nodePool, node, false);
BzBTNode *seq = bzBTCompSequence(nodePool, node);
bzBTDecorDelay(nodePool, seq, 1.0f);
node = bzBTAction(nodePool, seq, printAction);
@@ -155,9 +155,9 @@ void igVisualizeBTState(const BzBTNode *node, const BzBTNodeState *state,
}
bool isComposite = type == BZ_BT_COMP_SELECTOR ||
type == BZ_BT_COMP_P_SELECTOR ||
type == BZ_BT_COMP_PSELECTOR ||
type == BZ_BT_COMP_SEQUENCE ||
type == BZ_BT_COMP_P_SEQUENCE;
type == BZ_BT_COMP_PSEQUENCE;
while (child) {
if (hasSingleChild) igSameLine(0, 0);