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

#1 2010-07-08 00:30:33

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

On/Off Switch?

How can I make an on/off switch? I want it to be so whenever sprite is on top of/touching color, on/off changes. If on, it turns off, and if off, it turns on. This is easy enough to do, but my problem is that it will endlessly switch until the sprite is not touching the color. Help?


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#2 2010-07-08 00:35:31

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: On/Off Switch?

Do:

If touching color (color
Switch (switch) to 1
else
Switch (Switch) to 0

big_smile  I hope that helps  tongue

Offline

 

#3 2010-07-08 02:16:13

markyiscool
Scratcher
Registered: 2008-04-09
Posts: 100+

Re: On/Off Switch?

As far as I understand, this should fix the problem:
http://i992.photobucket.com/albums/af48/markk7/Script.gif

Where off=0, on=1


Wanted the Netherlands to win or want to re-experience Spain's victory? Do it withthis!
Projects not being loved, here's an idea!

Offline

 

#4 2010-07-08 03:14:47

ChuxXxliciousness
Scratcher
Registered: 2010-02-25
Posts: 90

Re: On/Off Switch?

Or just keep it short sweet and to the point and put:
http://img180.imageshack.us/img180/4397/scripty.png


http://img443.imageshack.us/img443/676/continent2.pnghttp://img180.imageshack.us/img180/9229/button2a.png

Offline

 

Board footer