Class BasicCharacterController

java.lang.Object
buildengine.engine.stage.scene.Director
buildengine.engine.stage.director.BasicCharacterController

public class BasicCharacterController extends Director
Director containing a basic character controller functionality.
  • Field Details

    • DEFAULT_SPEED

      public static final float DEFAULT_SPEED
      See Also:
    • up

      protected boolean up
    • down

      protected boolean down
    • left

      protected boolean left
    • controlling

      protected final Actor controlling
      Animation images
    • speed

      protected float speed
    • controlMode

      protected BasicCharacterController.Mode controlMode
  • Constructor Details

    • BasicCharacterController

      public BasicCharacterController(Actor controlling, BasicCharacterController.Mode controlMode)
      Creates a basic character controller
      Parameters:
      controlling - The actor controlling
      controlMode - The keys to use
    • BasicCharacterController

      public BasicCharacterController(Actor controlling, BasicCharacterController.Mode controlMode, float speed)
      Creates a basic character controller
      Parameters:
      controlling - The actor controlling
      controlMode - The keys to use
      speed - The speed of the actor in units/second
  • Method Details

    • begin

      public void begin()
      Specified by:
      begin in class Director
    • update

      public void update()
      Specified by:
      update in class Director
    • fixedUpdate

      public void fixedUpdate()
      Overrides:
      fixedUpdate in class Director
    • getSpeed

      public float getSpeed()
    • setSpeed

      public void setSpeed(float speed)
      Change the speed of the controller
      Parameters:
      speed - speed in units per seconds
    • getControlMode

      public BasicCharacterController.Mode getControlMode()
    • setControlMode

      public void setControlMode(BasicCharacterController.Mode controlMode)