Line2D Node - Fill Texture Question

Godot Version

4.5.1

Question

I am working on a game where the enemy character leaves a permanent trail of letters behind them that, if the user-controlled character comes in contact with it, will end the game. Kind of like snake, except the trail is left anywhere the enemy character goes, and it stays there.

There is a cycle of letters that I want the trail to go through (think, “itiswhatitiswhatitiswhatitis…” etc.) so that a long, unending sentence will be behind wherever the enemy goes.

What’s the best way to go about this? Is it a texture attributed to a line2d node, or is it through particles? If anyone can point me to a resource on how to do this, or is down to write out the step by step, it would be greatly appreciated.

Follow up - how can I keep a permanent trail on the map without it making the game lag? When the trail gets long enough, things start to slow down.

Thanks! I’m obviously very new to godot, so help is appreciated.

If it’s tile based - use a tile map layer.

Could you say more? How would I set up the tile layer so the tiles appear where the enemy character has been, and so they follow a certain sequence as they generate?

Make a tile set with all letters, track the current letter in the sentence for each enemy and when it enters a new cell use set_cell() to fill in a corresponding tile.