using GameCore.ECS; using GameCore.ECS.Interfaces; using GameCore.Physics; namespace GameCore.Movement; public class GravitySystem : ISystem { public void Update(World world, float deltaTime) { var entities = world.GetEntitiesWith(); foreach (var entity in entities) { var velocity = world.GetComponent(entity); var characterState = world.GetComponent(entity); if (velocity == null || characterState == null) continue; if (!characterState.IsOnFloor) velocity.DesiredVelocity.Y -= world.Config.GravityStrength * deltaTime; } } }