Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Click two sprites, hide them show a third. How to?
- KittSmith
-
New Scratcher
3 posts
Click two sprites, hide them show a third. How to?
My specific problem is trying to figure out how to add the condition of clicking on a second sprite.
When this sprite is clicked
if this sprite is clicked then
hide first and second sprite
show third.
When this sprite is clicked
if this sprite is clicked then
hide first and second sprite
show third.
- drmcw
-
Scratcher
1000+ posts
Click two sprites, hide them show a third. How to?
when green flag clicked
set [clicked v] to [0]
when this sprite clicked
if <(clicked) = [0]> then
set [clicked v] to (1)
else
broadcast [both clicked v]
set [clicked v] to [0] // reset for later?
end
In the clickable sprites when “both clicked” is received hide and in the sprite that shows use show!
- KittSmith
-
New Scratcher
3 posts
Click two sprites, hide them show a third. How to?
Freaking brilliant! Thank you so much. I couldn't think for the life of me. Honestly I should go to bed.
- drmcw
-
Scratcher
1000+ posts
Click two sprites, hide them show a third. How to?
Just thought you could click a sprite twice and get the effect of clicking both sprites. If you don't want that to happen then you need to make the clicked variable local (for this sprite only) and only broadcast if clicked is not 0 and
if <([clicked v] of [other sprite v]) = [1]> then
broadcast [both clicked v]
end
- KittSmith
-
New Scratcher
3 posts
Click two sprites, hide them show a third. How to?
No, I want a different effect for each set of paired sprites. I am making a animation that shows the fusions from Steven Universe when the two original characters are clicked.clicking pearl plus amethyst= opal. Kind of like mixing primary colors into secondary ones but with cute chibi sprites. I think I may have figured it out though. We shall see. Wish me luck!
Last edited by KittSmith (June 2, 2016 04:37:56)
- Discussion Forums
- » Help with Scripts
-
» Click two sprites, hide them show a third. How to?