Can someone explain to me how to use monkey brains because the wiki is not complete?
This is the example code:
public class Example extends SimpleApplication {
//defining game
private MonkeyBrainsAppState brainsAppState = MonkeyBrainsAppState.getInstance();
public static void main(String[] args) {
Example app = new Example();
app.start();
}
@Override
public void simpleInitApp() {
//defining app
brainsAppState.setApp(this);
//initialization of Agents with their names and spatials
Agent agent = new Agent("First agent", createAgentSpatial());
//there isn't any method in framework like createAgentSpatial()
//user is supposed to build his own spatials for game
//adding agent to MonkeyBrainsAppState
brainsAppState.addAgent(agent);
//setting moveSpeed, rotationSpeed, mass..
agent.setMoveSpeed(20);
agent.setRotationSpeed(30);
//used for steering behaviors in com.jme3.ai.agents.behaviors.npc.steering
agent.setMass(40);
agent.setMaxForce(3);
//creating main behavior
//agent can have only one behavior but that behavior can contain other behaviors
agent.setMainBehavior(new MyCustomBehavior(agent));
//starting agents
brainsAppState.start();
}
@Override
public void simpleUpdate(float tpf) {
brainsAppState.update(tpf);
}
}
I get an error saying that method createAgentSpatial() doesn’t exist. Should I replace it by a Spatial?
And the following line:
agent.setMainBehavior(new MyCustomBehavior(agent));
has a class MyCustomBehavior that doesn’t exist. Should I make my own class and how?
Can somebody help me?