gamai 0.1.32

A flexible task switching library suitable for game AI & robotics
Documentation

gamai

made with ❤️‍🔥 by mrchantey

Usage

#[tree_builder]
pub fn MyTree() -> impl AiNode {
	tree! {
		<sequence>
			<say_hello/>
			<say_world/>
		</sequence>
	}
}

#[node_system]
fn say_hello<Node: AiNode>(mut query: Query<&mut NodeState<Node>>){
	
	for mut state in query.iter_mut(){
		println!("hello");
		//tell parent it can go to the next node now
		**state = NodeState::Success;
	}
}