This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-15 17:35:09

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

One-way wall

How do I make a one-way wall?  I am making a game that needs one.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#2 2012-01-15 18:13:49

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: One-way wall

Simply add a qualifier to the wall sensing, specifying that you are going in a certain direction.

For instance, if you are using velocity, you can do something like this:
http://img828.imageshack.us/img828/7279/scriptxa.gif
Note:  this example is a one way wall that you can go through when going left, but can't go through when going right.  Change the velocity > 0 to < 0 to reverse it.

If you are not using velocity, you can do something like this:
http://img580.imageshack.us/img580/6850/script.gif
And simply don't add that qualifier into the opposite direction's script.

Last edited by Kileymeister (2012-01-15 18:15:57)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2012-04-23 21:37:55

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: One-way wall

Well, my game has randomly bouncing bubbles that say

forever
   glide (3) secs to x: <pick random (-250) to (250)> y: <pick random (115) to (-180)>
   glide (3) secs to x: <pick random (-250) to (250)> y: <pick random (115) to (-180)>
end

Last edited by Firedrake969 (2012-04-23 21:39:17)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

Board footer