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

#1 2011-10-30 02:36:25

081080117
New Scratcher
Registered: 2011-10-30
Posts: 13

How do I use varbles and broadcast squares?

Do varbles let you make new blocks? If I broadcast something, can people watching my movie see the broadcast?

Offline

 

#2 2011-10-30 02:41:14

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How do I use varbles and broadcast squares?

Variables are simply values; they can't create blocks  tongue

Broadcasts are local to each Scratch project (unless you use Mesh), and all sprites and the Stage will receive them.


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

Offline

 

#3 2011-10-30 02:42:31

081080117
New Scratcher
Registered: 2011-10-30
Posts: 13

Re: How do I use varbles and broadcast squares?

What's Mesh?

Offline

 

#4 2011-10-30 03:04:59

ZappsMcJack
Scratcher
Registered: 2011-09-27
Posts: 100+

Re: How do I use varbles and broadcast squares?

broadcasting is way of making other things do something

like lets say when a sprite moves you want the other sprite to do something
broadcast "whatever" and then for the other sprite when i receive "whatever" do this

for variables those are numbers.
a good example would be health.

and mesh is a way of connecting two local ips to run a project simultaneously.


_________________THE LENNONATER___________________________
Gateway DX4840 Case|DX4840 Motherboard|Core i5 2500k 3.2 ghz|GTX 560|8gb Ram|Corsair GS700|1TB HDD|64gb Corsair Sata II SSD w/ Win7 64 bit ultimate

Offline

 

#5 2011-10-30 04:05:04

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How do I use varbles and broadcast squares?

You can read about Mesh on the Scratch Wiki btw  tongue

Here


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

Offline

 

#6 2011-10-30 05:50:49

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do I use varbles and broadcast squares?

Variables
One use for a variable is to keep track of lives. You could put this script:

When green flag clicked
Set 'lives' to 5
Forever
If touching enemy
Change 'lives' by -1
Wait until not touching enemy
End if
If lives=0 or lives<0
Stop all
End if
End forever

Once you get the hang of it, you can change the stop all bit to a play again screen or something like that.

Broadcasts
Broadcasts send a message to all other sprites, telling them to do something.
If you had two sprites, and you wanted sprite2 to move, but only when sprite1 is clicked, then you would put this script on sprite1:

When sprite1 clicked
Broadcast move
Move 10 steps

And then this scripts on sprite 2:

When I receive move
Move 10 steps

Hope I helped!


Why

Offline

 

#7 2011-10-31 13:02:41

aldenhorbach
New Scratcher
Registered: 2011-09-22
Posts: 23

Re: How do I use varbles and broadcast squares?

a broadcast is a way to tell all sprites(or just one) that something has happened... example...
[blocks]
<when green flag clicked><broadcast[ hi ]

[/blocks]
then for a different sprite,
[blocks]
<when I receive[ hi ]<say[ hi ]for( 1 )secs>
[/blocks]

hope that helps

Offline

 

#8 2011-11-01 04:22:19

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do I use varbles and broadcast squares?

A broadcast can't be "seen"; only sensed by the program.
From there you could have the program do something though.  smile

Offline

 

Board footer