I am trying to make a system where when the player moves there is a string of data points similar to a trail, and once the trail hits a certain threshold the trail stops getting longer and stays the same length. I also need a function where if the trail ever crosses itself and creates an enclosed shape the interior of the shape changes colors. the image below is a good representation of what i am attempting to create with the player at the spearhead of the line.
any help would be greatly appreciated I am very new to coding and need a lot of help.
You might look at how people have made snake games. They do the same things you want: remember where they were, be a certain length, and know when they loop back and hit themselves.
– Owen-Reynolds