My snake will not turn on a dime instead you have to wait until a complete movement which causes issues when the player is trying to move quickly to avoid obstacles.
My snake game used to have an issue where if you turned too quickly the body of snake would seemingly implode, the reason for this was because due to my collision check the code would read the snake hitting its own body. To combat this I implemented a mutex to restrict movement until the snake has completely changed direction, preventing a collision with the body of the snake. I find this to be better than the original issue but I want a better way of doing it while keeping the game smooth.
Nicholas Lermon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.