Discuss Scratch

CobramCat
Scratcher
68 posts

ParentX-ChildY talks to ParentA-ChildD

I have a project in hand at the moment from which I've quoted from another thread:
I'd still like to understand if Child(x) of Parent1 can have an influence, and how, upon Child(y) of Parent2 as I am currently trying.
That's a question to which I can find no answer; nothing in Forums nor in any published projects.

The project in question can be found here.
Some persons have responded to the project but do not give me sufficient insight.

Basically one sprite has a set of lists attached to it, as does a second.
It is required that selecting a costume for Sprite1 will influence if a costume of Sprite2 will change (“IF” does mean, “if the logic is right”!).

This project is an attempt to rewrite something that I wrote using HTML/javascript - that is cited somewhere in one of those links.



asivi
Scratcher
1000+ posts

ParentX-ChildY talks to ParentA-ChildD

Hi, yes, any sprite (including clones) can broadcast a message to any other, for clones firstly create a local variable that you must set to the identifier of a clone if it is the case, or referring an exclusive feature in the receiver clone, for an example its costume.
set [message for clone v] to [1]//global variable
broadcast [message for clone v]
In the receiver Sprite
when I receive [message for clone v]//l"identifier of clone" must be a local variable
if <(Identifier of clone)= (message for clone)> then
...Whatever...::grey
end


Powered by DjangoBB