Optional_world: Wconst ecs = ECSpresso.create()
.withPlugin(createBehaviorTreePlugin())
.withComponentTypes<{ enemy: { hp: number } }>()
.build();
const { defineBehaviorTree, action, condition, guard } = ecs.getHelpers(createBehaviorTreeHelpers);
action('read enemy', ({ ecs, entityId }) => {
const enemy = ecs.getComponent(entityId, 'enemy');
return enemy ? NodeStatus.Success : NodeStatus.Failure;
});
Create typed behavior tree helpers bound to a specific world type.