Interface IMovementController

All Superinterfaces:
IEntityController, IUpdateable
All Known Implementing Classes:
GamepadEntityController, KeyboardEntityController, MousePathController, MovementController, PlatformingMovementController

public interface IMovementController
extends IEntityController
The Interface IMovementController is used for moving entities by applying forces to them.
  • 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

      void apply​(Force force)
      Apply the force to the entity.
      Parameters:
      force - the force being applied to the entity
    • getActiveForces

      java.util.List<Force> getActiveForces()
      Gets the active forces.
      Returns:
      the active forces
    • getForce

      Force getForce​(java.lang.String identifier)
    • getMoveAngle

      double getMoveAngle()
    • onMovementCheck

      void onMovementCheck​(java.util.function.Predicate<IMobileEntity> predicate)
      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.