Basic pathfinding working for crying ghosts

This commit is contained in:
2026-01-17 23:37:33 -06:00
parent dd4ce5fcf4
commit 3a63bb6709
46 changed files with 691 additions and 34 deletions

View File

@@ -18,6 +18,8 @@ public abstract partial class CharacterBase : CharacterBody2D
=> (GetGlobalMousePosition() - GlobalPosition).Angle();
protected bool IsPrimaryOnCooldown
=> primaryCooldown > 0f;
protected bool IsMoving
=> Velocity != Vector2.Zero;
float primaryCooldown;
@@ -34,7 +36,7 @@ public abstract partial class CharacterBase : CharacterBody2D
void HandleInput(double delta)
{
var direction = Input.GetVector(InputLeft, InputRight, InputUp, InputDown);
var direction = Input.GetVector(InputLeft, InputRight, InputUp, InputDown).Normalized();
Velocity = direction * Speed;