Ok so i have looked for a lot of topics and code online, but i can't seem to find anything decent..
Would this be a correct logic to move the snake around in the game "Snake"? (the game is tile-based so not all 'parts' of the snake are the same: turns/head/tail/body have different graphics)
- Move the head one forward in the direction it's going
- if the head just went left or right, turn the second body part into a body part that's turning
- move all the other body parts, including tail to the position of the body part that was preceding it. Some body parts could become a part that is turning and vice versa.
- check if the part preceding the tail was a part that was turning and change the orientation of the tail accordingly
If this isn't clear i'll try to explain it somewhat different..![]()