|Topic was automatically imported from the old Question2Answer platform.
I’m currently making a pacman clone, I’ve made some progress this week end, but I’m stuck on something I can’t wrap my head around yet.
I’ve got a raycast for telling if pacman should try to go where the player wants him. The goal of this raycast is to not let the player try to go up or down in an horizontal corridor, and left or right in a vertical one.
It works great, the problem is when the raycast doesn’t collide with anything, but pacman actually does collide with the end of the wall. This makes him bump on the wall. What I would want is for the input to be delayed until pacman can actually fit inside the wall, similar to how it works in the recent pacman championship edition games.
Anyone has an idea for it? I’ll post a few screenshots for you to understand the predicament. Thanks in advance!
Here pacman cannot go up or down, as wanted.
Here pacman is able to go up despite making him stuck on the wall