Class MoveAction
java.lang.Object
me.arcademadness.omni_dungeon.actions.MoveAction
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecute(Environment environment, Entity entity) Checks whether this action can be executed by the specified entity in the given environment.voidexecute(Environment environment, Entity entity, float delta) Executes the movement action by posting anEntityMoveEvent.
-
Constructor Details
-
MoveAction
public MoveAction(com.badlogic.gdx.math.Vector2 direction)
-
-
Method Details
-
canExecute
Description copied from interface:ActionChecks whether this action can be executed by the specified entity in the given environment.- Specified by:
canExecutein interfaceAction- Parameters:
environment- the environment in which the action would occurentity- the entity attempting to perform the action- Returns:
trueif the action can be executed, otherwisefalse
-
execute
Executes the movement action by posting anEntityMoveEvent.
-