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

#1 2010-06-18 15:12:49

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

How do I do when all brodcasts are sent then do something

Im trying to make a game to make a flower blossom. Of course I used a sun and a rain cloud and I need help. Whenever it rains It sends a broadcast to tell the flower to change to the bigger part. But I want when both sun and water brodcasta are sent then to change. Help plz!

Offline

 

#2 2010-06-18 15:13:36

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: How do I do when all brodcasts are sent then do something

Why is this in Requests? This should be in All About Scratch.


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#3 2010-06-18 15:16:18

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: How do I do when all brodcasts are sent then do something

meew0 wrote:

Why is this in Requests? This should be in All About Scratch.

Agreed, but don't worry, Gveradux, I'll move it over to All About Scratch for you  smile

Try creating a variable for each broadcast. Then, when the green flag is clicked, set each variable to 0, then when a broadcast is recieved that matches that variable, it sets to 1. Then, you can make a script that says:

if <(variable1)= (1) > and <(variable2)= (1) > (repeat the "and"s however many times you need)
Do something here.

Hope that helps  big_smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#4 2010-06-18 15:47:15

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

Re: How do I do when all brodcasts are sent then do something

I dont get it, could you send it in pictures?

Offline

 

#5 2010-06-18 15:51:40

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: How do I do when all brodcasts are sent then do something

I have to go in ten minutes  hmm ... maybe someone else who understands what I'm saying could post a picture of the script?


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#6 2010-06-19 03:55:51

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: How do I do when all brodcasts are sent then do something

<when I receive[ sun
<set{  v1     }to( 1

<when I receive[ rain
<set{ v2       }to( 1


<when green flag clicked>
<forever>
          <if> << <( <{ v1 }> <=> 1)> <and> <( <{ v2 }> <=> 1)> >>
          <broadcast[ flower
          <end>
<end>

Last edited by Subh (2010-06-19 05:29:00)


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#7 2010-06-19 05:47:55

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

Re: How do I do when all brodcasts are sent then do something

Thankyou, This helpe me very much!

Offline

 

#8 2010-06-19 12:05:28

cooljj100
Scratcher
Registered: 2009-10-10
Posts: 55

Re: How do I do when all brodcasts are sent then do something

there is a simpler way to do it:
<when green flag clicked>
<set{ a }to( 0 )
<when I receive[ fun ]
<change{ a }by( 1 )
<when I receive[ more fun ]
<change{ a }by( 1 )
<when green flag clicked>
<forever>
<if><( 2 <=> a )>
<broadcast[ i had fun! ]
<end>
<end>


Summertime is almost here!
My Stuff

Offline

 

Board footer