Jump to content

Activating Run?


Varies

Recommended Posts

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
Link to comment
Share on other sites

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();
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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