Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » maze
- rob247666
- New to Scratch
17 posts
maze
the robot is suppose to stop when it hits a wall, but its not?
- kingofdallamas
- Scratcher
45 posts
maze
If black is your wall and
If you're just using color sensors, then…
example:
if key right arrow pressed
move x=10
if key right arrow pressed and touching color __
move x=-10
or
example: (if this script also contains moving scripts)
if touching wall
repeat 10
change ghost effect 10
broadcast win
I put the ghost effect just for fun, but I don't know if this fits what you want. I hope this helps though!
And, of course, I probably don't have the most efficient scripts… Good luck!
-Kingofdllamas
If you're just using color sensors, then…
example:
if key right arrow pressed
move x=10
if key right arrow pressed and touching color __
move x=-10
or
example: (if this script also contains moving scripts)
if touching wall
repeat 10
change ghost effect 10
broadcast win
I put the ghost effect just for fun, but I don't know if this fits what you want. I hope this helps though!
And, of course, I probably don't have the most efficient scripts… Good luck!
-Kingofdllamas
Some day tonight.
- Discussion Forums
- » Help with Scripts
- » maze