mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Shoot through
This commit is contained in:
parent
b3070cd71e
commit
92a82b05df
6 changed files with 31 additions and 42 deletions
|
|
@ -20,10 +20,10 @@ public partial class Bullet : Area2D
|
|||
|
||||
//private void OnBodyEntered(Node body)
|
||||
//{
|
||||
// When a body is entered, invoke the event and pass the collided body
|
||||
// When a body is entered, invoke the event and pass the collided body
|
||||
// BulletHit?.Invoke(body);
|
||||
|
||||
// Then remove the bullet
|
||||
|
||||
// Then remove the bullet
|
||||
// QueueFree();
|
||||
//}
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public partial class Bullet : Area2D
|
|||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
this.Position += ((float) (Speed * delta) * _direction);
|
||||
this.Position += ((float)(Speed * delta) * _direction);
|
||||
}
|
||||
|
||||
private void _on_visible_on_screen_notifier_2d_screen_exited()
|
||||
|
|
@ -49,7 +49,19 @@ public partial class Bullet : Area2D
|
|||
QueueFree();
|
||||
}
|
||||
|
||||
private void _on_body_entered(Node2D body)
|
||||
{
|
||||
if (body.IsInGroup("Solid"))
|
||||
{
|
||||
Debug.WriteLine("Collision");
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue