Class MoveAction

java.lang.Object
me.arcademadness.omni_dungeon.actions.MoveAction
All Implemented Interfaces:
Action

public class MoveAction extends Object implements Action
An Action that moves an entity in a given direction.

When executed, this action posts an EntityMoveEvent to the EventBus, allowing systems to handle movement and collisions.

See Also:
  • Constructor Details

    • MoveAction

      public MoveAction(com.badlogic.gdx.math.Vector2 direction)
  • Method Details

    • canExecute

      public boolean canExecute(Environment environment, Entity entity)
      Description copied from interface: Action
      Checks whether this action can be executed by the specified entity in the given environment.
      Specified by:
      canExecute in interface Action
      Parameters:
      environment - the environment in which the action would occur
      entity - the entity attempting to perform the action
      Returns:
      true if the action can be executed, otherwise false
    • execute

      public void execute(Environment environment, Entity entity, float delta)
      Executes the movement action by posting an EntityMoveEvent.
      Specified by:
      execute in interface Action
      Parameters:
      environment - the environment in which the entity moves
      entity - the entity that is moving
      delta - the frame delta time