Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
- BrodoIsAYai
- New to Scratch
2 posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
when this sprite clicked
broadcast [ PLAYERTWO]
when this sprite clicked
broadcast [ GAMESTART]My Dad says It's Only One thing Done, But can I get it to have Both?
- BrodoIsAYai
- New to Scratch
2 posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
Help Please!
- LuckyLucky7
- Scratcher
1000+ posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
- Wahsp
- Scratcher
1000+ posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
when this sprite clicked
broadcast [... v]
wait (.1) secs
wait until <<touching [mouse pointer v]> and <mouse down>>
broadcast [... v]
I am Wahsp
______________________________________________________
Formerly pretty active on the forums, probably mostly retired now…
If you see one of my posts send me a hello!
______________________________________________________
- TheRealNetherBefore
- Scratcher
1000+ posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
Or you could do this:
when green flag clicked
set [broadcast v] to [1]
when this sprite clicked
if <(broadcast) = [1]> then
broadcast [thing1 v]
change [broadcast v] by (1)
else
broadcast [thing2 v]
end
*Drinks ketchup*
there is no ethical consumption under capitalism my dudes
Small Games | Tips and Advice | Boredom Cat | Misc
Want to make a fantasy world everyone on scratch can use? Click here!
G'thorpax the Unspoken
there is no ethical consumption under capitalism my dudes
Small Games | Tips and Advice | Boredom Cat | Misc
Want to make a fantasy world everyone on scratch can use? Click here!
G'thorpax the Unspoken
- -ShadowOfThePast-
- Scratcher
100+ posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
<snip>
This would also work… <snip>
when gf clicked
wait until <<touching [mouse-pointer v]?> and <mouse down?>>
broadcast [message1 v]
wait until <not <<touching [mouse-pointer v]?> and <mouse down?>>>
wait until <<touching [mouse-pointer v]?> and <mouse down?>>
broadcast [message2 v]
wait until <not <<touching [mouse-pointer v]?> and <mouse down?>>>
...
Hello.
- mystery4000
- Scratcher
100+ posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
Good example. Or you could do this:when green flag clicked
set [broadcast v] to [1]
when this sprite clicked
if <(broadcast) = [1]> then
broadcast [thing1 v]
change [broadcast v] by (1)
else
broadcast [thing2 v]
end
But wouldn’t this cause the:when this sprite clicked
broadcast [... v]
wait (.1) secs
wait until <<touching [mouse pointer v]> and <mouse down>>
broadcast [... v]
when this sprite clickedTo activate twice?
- LuckyLucky7
- Scratcher
1000+ posts
How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?
Yes, which would cause the 2nd broadcast block to never execute, and therefore that script would be going in an infinite loop.But wouldn’t this cause the:when this sprite clicked
broadcast [... v]
wait (.1) secs
wait until <<touching [mouse pointer v]> and <mouse down?>>
broadcast [... v]when this sprite clickedTo activate twice?
- Discussion Forums
- » Help with Scripts
- » How do I have a sprite Clicked, Broadcast a message, and When it's clicked after the message, It'll broadcast a new One?