I'm developing a Pacman game using C++ and SFML, and I've managed to implement collision detection. However, I'm struggling with making the player's movement smooth. I've set up a 2D vector to access different tiles on the tile map, but I can't seem to replicate the arcade version's movement mechanics. In the original game, the player seamlessly turns without bumping into walls, and they always seem to make turns at the right moment at intersections. Any advice on aligning movement with the grid would be greatly appreciated!
1 Answer
The key is to separate the current direction from the desired direction. When you press a key, just store that input. Only switch the direction when the character reaches the center of a tile and if the next tile in that direction is open. That’s what gives it the smooth feeling!

Got it! But I've seen some tutorials talk about using a lerp function or interpolation. Would that add any value, or is it just going to complicate things unnecessarily?