Directional shooting

This commit is contained in:
MaddoScientisto 2024-05-01 11:48:04 +02:00
commit 65ce30a2a4
7 changed files with 158 additions and 10 deletions

View file

@ -12,9 +12,19 @@ public partial class Bullet : Area2D
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Debug.WriteLine("Bullet Shot");
}
public void SetDirection(Vector2 direction)
{
var normalized = direction.Normalized();
_direction = normalized;
Debug.WriteLine($"Bullet Shot at direction {direction.X} {direction.Y}");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{