Animation Enter Player System
Source file: client/engine/systems/systems_functions/AnimationEnterPlayerSystem.cpp
Purpose: Move players from off-screen into the play area, then enable their controls once they reach the target position.
Components used:
AnimationEnterPlayer(entry flag)Transform(current position)Velocity(applied speed during entry)PlayerTag(speed_max,isInPlay)Controllable(added when entry is complete)
Behavior
- While
animation_enter_player.isEnteringis true, setsvelocity.vxtoplayer_tag.speed_maxto push the entity into the screen. - When
transform.xreaches or exceeds75.0f, clamps the position, clearsisEntering, setsplayer_tag.isInPlayto true, and addsControllable. - Removes
AnimationEnterPlayerafter completion to avoid re-triggering.
Main signature
void AnimationEnterPlayerSystem(Eng::registry ®, GameWorld &game_world,
Eng::sparse_array<Com::Velocity> &velocities,
Eng::sparse_array<Com::Transform> &transforms,
Eng::sparse_array<Com::PlayerTag> &player_tags,
Eng::sparse_array<Com::AnimationEnterPlayer> &animation_enter_players);
Notes
- The system does not use
dt; velocity is later integrated byMovementSystem. 75.0fis the default X entry offset.