Scratch Forums

You are not logged in.

#1 2009-11-03 14:17:49

Maki-Tak
Member
Registered: 2008-03-10
Posts: 328

Switches

Yep.

I'm not sure if this has been suggested before, but I personally think it would be really useful.

Basically it's a kind of variable, which can "switch" on and off.

Example:

<when__clicked>
<turn__ON>

<whenIrecieve___>
<turn__OFF>

<If__=ON>
<broadcast__>


I'm not exactly sure where this would lead but I'm hoping people could take it further.


http://www.MakiTak.dragonadopters.com/dragonimage_244744_179379_pixel.gif
8 November- Scratchinal Rick Astley Day. Celebrate by rickrolling as many people as possible and have an Astley avatar.

Offline

 

#2 2009-11-03 14:21:54

jacool
Member
Registered: 2008-01-25
Posts: 1401

Re: Switches

I've been thinking about this too  big_smile

I think that it would be good if you could choose to make a variable which only can store 1 bits of data.
Then use the switch function to toggle the value...

This function exists in many other programming languages and it would be very useful in Scratch!


http://i571.photobucket.com/albums/ss159/JacobKar/SignatureStickfigures.jpg
Eat others as you would like to be eaten  smile

Online

 

#3 2009-11-06 20:10:22

qwertyperson
Member
Registered: 2009-10-13
Posts: 9

Re: Switches

I found out that vars can store true/false by putting a Boolean block inside.

Offline

 

#4 2009-11-06 22:24:38

Lucario621
Member
Registered: 2007-10-03
Posts: 1351

Re: Switches

So you basically want a boolean block. Yeah that would be really nice. That way it only serves the true/false purpose you want, and takes up less memory.


⁀―‿―⁀―‿―‿―⁀―‿―|Official RPG Forum|―‿―⁀―‿―⁀―‿―⁀―‿
You should look at the best Pathfinder on Scratch here

Offline

 

#5 2009-11-07 00:17:40

Jonathanpb
Member
Registered: 2008-07-25
Posts: 1183

Re: Switches

You can do this really easily with setting the variable (or using a special variable for the on and off stuff). So no... and it's not neccessary.


Human beings... must have action; and they will make it if they cannot find it.
Charlotte Brontë

Offline

 

#6 2009-11-07 18:17:45

scmb1
Member
Registered: 2009-03-19
Posts: 244

Offline

 

#7 2009-11-07 18:21:56

Ssbrawl700
Member
Registered: 2009-02-11
Posts: 149

Re: Switches

Jonathanpb wrote:

You can do this really easily with setting the variable (or using a special variable for the on and off stuff). So no... and it's not neccessary.

Yeah u can just make a variable called on/off or something else if u like.

1=on
0=off

or vice versa

That's why on power buttons there are two symbols that look like a 1 and a 0. They represent on/off.


Curiosity killed the cat while detemination rewarded the dog.
Moral=Dogs are better than cats

Offline

 

Board footer