Discuss Scratch

TBNRFrags_9
Scratcher
55 posts

I Want my Pac-Man to stop going through walls and freezing in place

https://scratch.mit.edu/projects/432329072/ this is my pac man game he will run into a wall and will either go through it or will stop and will be unable to go anywhere please help me with this problem
mlcreater
Scratcher
1000+ posts

I Want my Pac-Man to stop going through walls and freezing in place

The color selected in that last <touching color ?> block is not the actual wall color.
The second problem is that the move (3) steps block is before the controls, while the move (-3) steps is after.
This might let the player hit a wall, change direction, and let Pac-Man try to escape by moving parallel to the wall.
The third problem is that even with move (3) steps and move (-3) steps, 3 - 3 = 0, so Pac-Man will stay stuck in the wall.
To fix this, move (-3) steps could be changed to move (-5) steps.
TBNRFrags_9
Scratcher
55 posts

I Want my Pac-Man to stop going through walls and freezing in place

this helped but he is now glitching
Wyan100
Scratcher
1000+ posts

I Want my Pac-Man to stop going through walls and freezing in place

Once he hits a Blue wall you should move him back and THEN make him stop moving until another Key is pressed. Right now he moves forward and if he hits a wall he moves back, but then he moves forward again and hits the wall again and moves back again and then moves forward again and hits the wall again…

That's why he shakes violently everytime he hits a wall.

Powered by DjangoBB