I am working on a 2-D snake game in C++ with the SFML library. I would like to smooth out the movement of my snake as it looks extremely choppy currently.
How the Snake moves
The snake is made up of a list of parts. If I want to move the snake, I simply remove one part from the back (
.pop_back()) and then add a new part in the front accrding to the velocity. This works perfectly. The speed of the snake must be the same as the distance between the parts. So if the distance is 15, the will be 15. But a speed of 15 is extremely high, so I need to only update the snake every few frames or use
sf::Sleep(). Since the snake moves such a high distance every frame, the movement doesn’t look smooth at all. And since the speed must be equal to the distance between the parts, reducing the speed doesn’t work too. How can I come about tackling this?