I'm new to Godot. Using v3.2.1
I'm working on game which is a Qix engine / Gals Panic like clone.
It is a 2D games with a cursor drawing rectilinear shape revealing an hidden background.
So reducing the area where a monster is moving.
I need to create a trail for my player (yellow on the screenshot). I'm thinking of using a Line2D with an associated StaticBody2D with a CollisionShape2D. So I added the CollisionPolygon2D at runtime matching the points of the line.
And the gdscript, that will set the shape at runtime:
# copy line points to a new polygon
var pol : PoolVector2Array
# recopy all points back to origin
var n = points.size()
for i in range(n-1, 0, -1):
$StaticBody2D/CollisionPolygon2D.polygon = pol
Is it the way to go or should I use other object?