Hi guys,
This is my first Scratch project. It's a great game, I'll definitively show it my kids ! I have a simple question, yet I cannot find a working answer in the forum.
I want the click on sprite1 to trigger an action on sprite2, such as showing sprite2 for one second then hide it again. Something seems to be wrong but I havent been able to find what for the last 2 hours. Could you guys help me to figure out what's wrong with my scripts ?
this is the script for sprite1 :
when Sprite1 clicked set (Click) to [1] wait [1] secs set (Click) to [0]for script2 :
if <(Click) = [1]> show end else hide endThanks for your help,
Offline
oliviergo wrote:
Hi guys,
This is my first Scratch project. It's a great game, I'll definitively show it my kids ! I have a simple question, yet I cannot find a working answer in the forum.
I want the click on sprite1 to trigger an action on sprite2, such as showing sprite2 for one second then hide it again. Something seems to be wrong but I havent been able to find what for the last 2 hours. Could you guys help me to figure out what's wrong with my scripts ?
this is the script for sprite1 :when [Sprite1 v] clicked//Yes, nod ropdown menu should be here, but it's for the blockmrendering purposes. set [Click v] to [1] wait [1] secs set [Click v] to [0]for script2 :if <(Click) = [1]> show else hide endThanks for your help,
Olivier
I fixed your scratchblocks.
Anyway, to add on, hello oliviergo and welcome to Scratch! I hope that you'll find your way around Scratch easily enough!
With regards,
ErnieParke
Last edited by ErnieParke (2013-02-22 09:10:54)
Offline
Translation: Very few non-programmers realize that "if" is not synonymous to "when". Which just goes to show how illogical the human race is.
Also, if you haven't noticed, there's an indent at the top of the "if" block. This should have indicated to you that it goes in the middle of a script and doesn't activate itself; it's activated by the block above it.
Last edited by lalala3 (2013-02-22 13:38:52)
Offline
How about doing
When sprite1 clicked
Broadcast: showthenhide
For sprite 2:
When I receive: Showthenhide
show
wait 1 secs
hide.
Hope that helps!
Offline
FeatherWind wrote:
How about doing
When [sprite1 v] clicked Broadcast [showthenhide v]
For sprite 2:When I receive [Showthenhide v] show wait (1) secs hide
Hope that helps!
Turned into scratchblocks.
Last edited by ErnieParke (2013-02-22 13:54:49)
Offline
lalala3 wrote:
Translation: Very few non-programmers realize that "if" is not synonymous to "when". Which just goes to show how illogical the human race is.
That's very rude... Not everyone can figure that out.
Also, if you haven't noticed, there's an indent at the top of the "if" block. This should have indicated to you that it goes in the middle of a script and doesn't activate itself; it's activated by the block above it.
This is their first game. They probably don't know much about scratch...
Offline
lalala3 wrote:
Translation: Very few non-programmers realize that "if" is not synonymous to "when". Which just goes to show how illogical the human race is.
Also, if you haven't noticed, there's an indent at the top of the "if" block. This should have indicated to you that it goes in the middle of a script and doesn't activate itself; it's activated by the block above it.
He is from france. He probaby isnt the best at english.
Offline
ImagineIt wrote:
lalala3 wrote:
Translation: Very few non-programmers realize that "if" is not synonymous to "when". Which just goes to show how illogical the human race is.
That's very rude... Not everyone can figure that out.
Also, if you haven't noticed, there's an indent at the top of the "if" block. This should have indicated to you that it goes in the middle of a script and doesn't activate itself; it's activated by the block above it.
This is their first game. They probably don't know much about scratch...
I hardly think he was trying to offend, the human race and English in particular is a very jumbled up language, so the first statement was entirely true, secondly, he was elaborating, not saying "everyone knows this you're stupid for not", even if it was somewhat offensively phrased.
Offline