mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 07:45:54 +00:00
Enemy Gravity
This commit is contained in:
parent
b3bfc1a888
commit
d1517f864a
9 changed files with 65 additions and 9 deletions
|
|
@ -10,6 +10,8 @@ public partial class Idle : EnemyStateBase3D
|
|||
[Export] public EnemyStorage3D Storage { get; private set; }
|
||||
[Export] public PlayerDetection3D PlayerDetection { get; private set; }
|
||||
|
||||
[Export] public GravityProvider GravityProvider { get; private set; }
|
||||
|
||||
[Export] public bool DebugEnabled { get; set; } = false;
|
||||
|
||||
private bool _isPlayerInRange = false;
|
||||
|
|
@ -84,6 +86,10 @@ public partial class Idle : EnemyStateBase3D
|
|||
DebugDraw3D.DrawText(MainObject.GlobalPosition - new Vector3(0,16,0), "Idle");
|
||||
|
||||
}
|
||||
|
||||
MainObject.Velocity = new Vector3(MainObject.Velocity.X, GravityProvider.CalculateGravityVelocity(MainObject.Velocity.Y, delta), MainObject.Velocity.Z);
|
||||
|
||||
MainObject.MoveAndSlide();
|
||||
}
|
||||
|
||||
public override void ProcessState(double delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue