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
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Actor
Animation imagesprotected BasicCharacterController.Mode
static final float
protected boolean
protected boolean
protected boolean
protected float
protected boolean
-
Constructor Summary
ConstructorDescriptionBasicCharacterController
(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 TypeMethodDescriptionvoid
begin()
void
float
getSpeed()
void
setControlMode
(BasicCharacterController.Mode controlMode) void
setSpeed
(float speed) Change the speed of the controllervoid
update()
-
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:
fixedUpdate
in 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
-