Skip to content

Instantly share code, notes, and snippets.

@BobTheBuilderBot
Created September 24, 2012 10:02
Show Gist options
  • Select an option

  • Save BobTheBuilderBot/3775248 to your computer and use it in GitHub Desktop.

Select an option

Save BobTheBuilderBot/3775248 to your computer and use it in GitHub Desktop.
@Override
public void update(float tpf) {
if(action.getSource() instanceof PlayerCharacter) {
PlayerCharacter character = (PlayerCharacter) action.getSource();
Vector3f direction = action.getTargetPosition().divide(action.getTargetPosition()).setY(0);
character.getControl().setWalkDirection(direction.multLocal(character.getVelocity()));
}
if(action.getTargetPosition() == action.getSource().getPosition()) {
actionHandler.onFinished(action);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment