Class BasicCharacterController
java.lang.Object
buildengine.engine.stage.scene.Director
buildengine.engine.stage.director.BasicCharacterController
Director containing a basic character controller functionality.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ActorAnimation imagesprotected BasicCharacterController.Modestatic final floatprotected booleanprotected booleanprotected booleanprotected floatprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionBasicCharacterController(Actor controlling, BasicCharacterController.Mode controlMode) Creates a basic character controllerBasicCharacterController(Actor controlling, BasicCharacterController.Mode controlMode, float speed) Creates a basic character controller -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()voidfloatgetSpeed()voidsetControlMode(BasicCharacterController.Mode controlMode) voidsetSpeed(float speed) Change the speed of the controllervoidupdate()
-
Field Details
-
DEFAULT_SPEED
public static final float DEFAULT_SPEED- See Also:
-
up
protected boolean up -
down
protected boolean down -
right
protected boolean right -
left
protected boolean left -
controlling
Animation images -
speed
protected float speed -
controlMode
-
-
Constructor Details
-
BasicCharacterController
Creates a basic character controller- Parameters:
controlling- The actor controllingcontrolMode- The keys to use
-
BasicCharacterController
public BasicCharacterController(Actor controlling, BasicCharacterController.Mode controlMode, float speed) Creates a basic character controller- Parameters:
controlling- The actor controllingcontrolMode- The keys to usespeed- The speed of the actor in units/second
-
-
Method Details
-
begin
public void begin() -
update
public void update() -
fixedUpdate
public void fixedUpdate()- Overrides:
fixedUpdatein classDirector
-
getSpeed
public float getSpeed() -
setSpeed
public void setSpeed(float speed) Change the speed of the controller- Parameters:
speed- speed in units per seconds
-
getControlMode
-
setControlMode
-