Discuss Scratch

Aletrobby
New Scratcher
3 posts

Undiscoverable bug !!!

I have a problem with the scripts of my Pac Man - Like, I would like to make my pacman bounce on the blue wall, but , when i go up and down, it works well, the problem is when he goes left or right and it does not bounce on the wall and the pacman goes inside the wall, how can i make it bounce back on the black field without make it going on the wall?

Thank you very much.

PS: work in progress !!!
drmcw
Scratcher
1000+ posts

Undiscoverable bug !!!

try adding a repeat until not touching black move 1 instead of just a move 15
Bruch1978
Scratcher
3 posts

Undiscoverable bug !!!

Hello,

The solution is to add an event:
“When green flag clicked” > “forever” > “if touching color (blue) then” > “move -10 steps”

Remove all the other blocks “When () key pressed” > “if touching color (blue) then” >…

Try it! Works!
Aletrobby
New Scratcher
3 posts

Undiscoverable bug !!!

drmcw wrote:

try adding a repeat until not touching black move 1 instead of just a move 15

Unfortunately it doesn't work: when the pacman hits the blue wall it goes on all the same …
Aletrobby
New Scratcher
3 posts

Undiscoverable bug !!!

Bruch1978 wrote:

Hello,

The solution is to add an event:
“When green flag clicked” > “forever” > “if touching color (blue) then” > “move -10 steps”

Remove all the other blocks “When () key pressed” > “if touching color (blue) then” >…

Try it! Works!

Great, It works perfectly !

I'm going to add the same script for the ghosts too.

Powered by DjangoBB