Discuss Scratch

Jedi_Edrich
Scratcher
11 posts

how do I stop my sprite from running through a wall?

Please help me with this script. Thanks!
swagpanda12
New Scratcher
2 posts

how do I stop my sprite from running through a wall?

hi
derniersamourai
Scratcher
100+ posts

how do I stop my sprite from running through a wall?

You can test if it touches the wall and stop or if it touches the color of the wall and stop.

if <touching [wall v]?> then
turn right (180) degrees
end

or if the wall is pink

if <touching color [#f0f]?> then
turn right (180) degrees
end
scubajerry
Scratcher
1000+ posts

how do I stop my sprite from running through a wall?

Move
Once you sense touching the wall, backup until you are no longer touching the wall. This contains that kind of logic. http://scratch.mit.edu/projects/12969047/ It makes sure you are no longer touching things when you complete any move.

Powered by DjangoBB