Add AI components and systems for enhanced enemy behavior and pathfinding
This commit is contained in:
@@ -8,14 +8,17 @@ public class GravitySystem : ISystem
|
||||
{
|
||||
public void Update(World world, float deltaTime)
|
||||
{
|
||||
var entities = world.GetEntitiesWith<VelocityComponent>();
|
||||
var entities = world.GetEntitiesWith<CharacterStateComponent>();
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
var velocity = world.GetComponent<VelocityComponent>(entity);
|
||||
var characterState = world.GetComponent<CharacterStateComponent>(entity);
|
||||
|
||||
if (velocity == null || characterState == null)
|
||||
{
|
||||
world.Logger.Warn("GravitySystem: Missing VelocityComponent or CharacterStateComponent.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!characterState.IsOnFloor) velocity.DesiredVelocity.Y -= world.Config.GravityStrength * deltaTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user