Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to stop Sprite 1 going through a Sprite 2 but also allowing Sprite 1 to travel elsewhere.
- FishingPro98
- Scratcher
54 posts
How to stop Sprite 1 going through a Sprite 2 but also allowing Sprite 1 to travel elsewhere.
Say Sprite 1 is a man and Sprite 2 is a wall. If the man walks into a wall he has to stop but he must also be able to walk away in another direction. I can't put “If not touching Sprite 2 move 5 steps” because when Sprite 1 touches Sprite 2 he can't move at all. Can some one help me with this? Thank you.
- catlover1123
- Scratcher
39 posts
How to stop Sprite 1 going through a Sprite 2 but also allowing Sprite 1 to travel elsewhere.
if <touching [sprite 2 v]?> then
turn left (180) degrees
move (10) steps
end
- Discussion Forums
- » Help with Scripts
- » How to stop Sprite 1 going through a Sprite 2 but also allowing Sprite 1 to travel elsewhere.