If it's a certain edge, please specify which edge of the screen (top,left,right,bottom), if it's a wall you made in the game, you can use color sensing, or if it's a certain sprite that's the wall, use the touching block. Like this:
if<key [up v] pressed?> if <not<touching color[#00FF00]?>> change y by (10) end end if <key [down v] pressed?> if <not <touching [sprite1 v]?>> change y by (-10) end end
Offline
Here's what I do! So, I make a sprite that is a line, that I can put on the edge that I want to be sensed. Then I set that sprite (the line) so it's ghost affect = 99% (so it isn't visible, but it's still there) like this:
when gf clicked set [ghost v] effect to (99)Then the script I use for the sprite (sprites) who need to be able to sense this edge I do this:
when gf clicked forever if <touching color [ ]?> (do what ever you want your sprite to do when touching this edge) end endyou can also do this for part of that last script
forever if <touching [sprite on the special edge]?> (do what must be done!) end endSo, that's what I do, hope it all made sense
Last edited by tree-hugger (2012-08-25 18:39:28)
Offline