Basic pathfinding working for crying ghosts
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user