How do I make my walls solid?
Offline
You could try color sensing, sprite sensing, or x and y position sensing :S
Offline
If sprite1 touching color (wall color), move 0 steps.
Offline
Jonathanpb wrote:
You could try color sensing, sprite sensing, or x and y position sensing :S
I would recommend the ones I underlined, only because it's pretty basic. I actually use variables, but i'm bad at explaining how. XD
Offline
<when green flag clicked>
<if><key[ ]pressed?>
<change x by( 1)>
<if> <touching color[ wall ]>
<change x by( -1)>
<end>
<end>
Last edited by shiguy101 (2011-12-25 22:08:27)
Offline
Here's a method that I use a lot that's pretty simple...
http://scratch.mit.edu/projects/Paddle2SeeFixIt/188825
Offline
Try a little something like this:
<when green flag clicked>
<wait until><touching color[
<go to x 0 )y
0
What this does, is it makes it so that when the sprite is touching a color, it goes back to a certain point, like the start of a maze.
Offline
You could add a script to the wall by doing this (must have a variable for all sprites)
When green flag clicked
set (variable to 0)
forever start
if touching (the sprite you want it to stop) start
set (variable) to 1
if end
if not touching (the sprite you want it to to stop) start
set (variable to 0)
forever end
and in the moving sprite you could do this
when green flag clicked
forever
if key right key pressed start
change x by 10
if (variable) equals 1 start
change x by -10
both ifs end
forever end
That way it doesn't need to be color sensing or hard to do x y position sensing
Offline