Discuss Scratch

chronicle_studios
Scratcher
4 posts

when one sprite is clicked make the other one do something

i need help making one sprite hide and show when another sprite is clicked
ExtraMental
Scratcher
100+ posts

when one sprite is clicked make the other one do something

You can use broadcasts
when this sprite clicked
broadcast [clicked v]
Now on the sprite you want to show
when I receive [clicked v]
show
RadiusGames46
Scratcher
100+ posts

when one sprite is clicked make the other one do something

I see the help you need.

"Broadcasts" are events that can be used to trigger other code in the same sprite, or call other sprites to trigger code.

// In the sprite you want to be clicked, insert this code:
when this sprite clicked
broadcast [message1 v] // Make sure it's a new broadcast. I only use "message1" as an example.

// Now, in the sprite you want code to occour
when I receive [message1 v] // Make sure "message1" is the same broadcast you set in the other sprite.
. . . // Any other code goes here
medians
Scratcher
1000+ posts

when one sprite is clicked make the other one do something



To create a broadcast, go to this block and click the dropdown:

Or this one:

Last edited by medians (March 4, 2023 16:27:16)

Powered by DjangoBB