Skip to content

MovementState ​

Inherits: RefCounted

Inherited by: ClimbingState, DirectionalMovementState, FallingState, IdleState, IdleTurningState, MovingState

The base of the movement states of an entity (idle, moving, falling, climbing ...). It keeps the manager, the entity and the animation player, and plays the animation of the state; the states only decide what to play, the physics is not here.

Variables ​

MovementStateComponentmanagernull
Entityentitynull
EntityAnimationPlayeranimation_playernull

Methods ​

voidsetup_state( movement_manager: MovementStateComponent, state_entity: Entity )
voidenter()
voidexit()
voidreturn_all_timer()

Variable descriptions ​

MovementStateComponent manager = null ​

Reference to managers

Entity entity = null ​

The entity this state moves.

EntityAnimationPlayer animation_player = null ​

Animation-related properties

Method descriptions ​

void setup_state( movement_manager: MovementStateComponent, state_entity: Entity ) ​

Sets the manager reference for the new architecture

void enter() ​

Called when entering the state

void exit() ​

Called when exiting the state

void return_all_timer() ​

Timer clean up class