Pages: 1
Topic closed
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
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
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
Offline
I have to go in ten minutes ... maybe someone else who understands what I'm saying could post a picture of the script?
Offline
<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)
Offline
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>
Offline
Topic closed
Pages: 1