Interface IMovementController
- All Superinterfaces:
IEntityController,IUpdateable
- All Known Implementing Classes:
GamepadEntityController,KeyboardEntityController,MousePathController,MovementController,PlatformingMovementController
The Interface IMovementController is used for moving entities by applying forces to them.
-
Method Summary
Modifier and TypeMethodDescriptionvoidApply the force to the entity.Gets the active forces.floatgetDx()Gets the delta x for each horizontal movement.floatgetDy()Sets the delta y for each vertical movement.Gets the force with the specified identifier.doubleGets the angle of movement.doubleGet the current velocity.voidonMovementCheck(Predicate<IMobileEntity> predicate) Checks given conditions before moving.voidsetDx(float dx) Gets the delta x for each horizontal movement.voidsetDy(float dy) Sets the delta y for each vertical movement.voidsetVelocity(double velocity) Sets the current velocity.Methods inherited from interface de.gurkenlabs.litiengine.entities.IEntityController
attach, detach, getEntityMethods inherited from interface de.gurkenlabs.litiengine.IUpdateable
update
-
Method Details
-
getDx
float getDx()Gets the delta x for each horizontal movement.- Returns:
- the dx
-
setDx
void setDx(float dx) Gets the delta x for each horizontal movement.- Parameters:
dx- the new dx
-
getDy
float getDy()Sets the delta y for each vertical movement.- Returns:
- the dy
-
setDy
void setDy(float dy) Sets the delta y for each vertical movement.- Parameters:
dy- the new dy
-
getVelocity
double getVelocity()Get the current velocity.- Returns:
- The current velocity.
-
setVelocity
void setVelocity(double velocity) Sets the current velocity.- Parameters:
velocity- The velocity to set.
-
apply
Apply the force to the entity.- Parameters:
force- the force being applied to the entity
-
getActiveForces
-
getForce
-
getMoveAngle
double getMoveAngle()Gets the angle of movement.- Returns:
- the angle of movement
-
onMovementCheck
Checks given conditions before moving.- Parameters:
predicate- the conditions that need to apply before moving. If they don't apply, the entity won't be moved.
-