Hi everyone !!! Hope you’re fine and doing good! I might need some help…
How do I…
I’d like to make a Snake that follows my Player,being behind him with only 1px behind and grows up. On Discord, got recommended to ask here^^
What is the expected result
If it works, it would work that way: Game is on a 320x320 grid, of 10x10 tiles.
You control a player, that collect diamonds. However, He’s followed by a Snake, that follows every movement of the player and stay behind. The Snake must grow up everytime a diamond is collected.
What is the actual result
Best result so far, is using tween to move my player and pathfinding on each part of Snake, folowing each other: Snake Tail follow Snake Part that follows SnakeHead, that follows Player. It mostly looks like what i want.
Problem, is turns! Snake must do squared turns since it’s on a grid (called L Shape turns, showed on a screenshot). But pathfinding wouldn’t work with it, as a L shape shouldn’t move.
My current idea, now, is to put topdown behavior on my player, AND on my Snake. Except a hybrid version, like putting a static L turn sprite and giving impression of movement around it.
But are there better ideas?
It’s been 3 months that i’m stuck.
Related screenshots
Here are events and vid of my tweenPlayer/ Pathfinding Snake:
Exemple of L-Turn Sprite:
My start of making my player topdown, for then doing the snake after it:
Project files (optional)
Can’t seem to upload the Project Files tho…
Insert a minimal game showing your issue in a .zip or .rar.