SupaLidlGame/Utils/Trail.cs

22 lines
389 B
C#
Raw Normal View History

2022-11-19 21:21:12 -08:00
using Godot;
public partial class Trail : Line2D
{
[Export]
public int MaximumPoints { get; set; }
[Export]
public Node2D Tracking { get; set; }
public override void _Process(double delta)
{
Vector2 point = Tracking.Position;
AddPoint(point);
while (Points.Length > MaximumPoints)
{
RemovePoint(0);
}
}
}