mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 18:55:54 +00:00
Directional shooting
This commit is contained in:
parent
155d210e31
commit
65ce30a2a4
7 changed files with 158 additions and 10 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue