Morning-Murder/Scripts/Arrow.cs

29 lines
574 B
C#

using Godot;
using System;
public partial class Arrow : RigidBody2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public override void _PhysicsProcess(double delta)
{
base._PhysicsProcess(delta);
Godot.Collections.Array<Node2D> node2Ds = GetCollidingBodies();
if (node2Ds.Count == 0)
return;
foreach (var node2D in node2Ds)
node2D.QueueFree();
QueueFree();
}
}