Projectile System
Source: client/engine/systems/SystemsFunctions/ProjectileSystem.cpp
Purpose: Update projectile positions and remove those leaving the play area.
Components used:
TransformProjectile
Behavior
- Move projectile X position by
projectile.speed * dt. - If the projectile leaves an expanded rectangle around the window (
window_size_± 100px), mark it for removal (reg.KillEntity).
Main signature
void ProjectileSystem(Eng::registry ®, GameWorld &game_world,
Eng::sparse_array<Com::Transform> &transforms,
Eng::sparse_array<Com::Projectile> &projectiles);
Notes
- Collect entities to remove first, then call
KillEntityto avoid invalidating zippers during iteration.