Jump to content

Activating Run?


Recommended Posts

Posted

I was wondering how to activate the run energy, I was digging around the API and found the WalkingEvent class that housed the method setEnergyThreshold(#) and was wondering how to bring it into the program.

 

I used WalkingEvent.setEnergyThreshold(#); and found out that the method is not static so that went out the window. I also was looking at anything that was inherited from this class and found quite a bit but was wondering which one I would have to "attach" onto setEnergy to allow me to turn it on.

 

Thanks again guys, I am a returning programmer and was wondering if you could get me back into the kick of things.

  • Like 1
Posted

Thanks I'll try that out later.

you can use this for a position

 

public boolean walk(Position pos, int energyThreshold) {
    WalkingEvent event = new WalkingEvent(pos);
    event.setEnergyThreshold(energyThreshold);
    return execute(event).hasFinished();
}

This should work.

 

 or this for a path

public boolean walk(Position[] path, int energyThreshold) {
    WalkingEvent event = new WalkingEvent(path); //can add .setOperateCamera(boolean)
    event.setEnergyThreshold(energyThreshold);
    return execute(event).hasFinished();
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...