Discuss Scratch

mario91100
Scratcher
500+ posts

How to make clones behave individually?

I am wondering how to make clones behave individually as to monitor a click count without all the clones having to return to the starting position. Any way to do this?

mario91100
ErnieParke
Scratcher
1000+ posts

How to make clones behave individually?

I'm slightly confused as to what you want, but from what I'm picking up, you could always use local variables. Each clone gets their own copy of a local variable once created, so now you can track the number of clicks on a specific clone.

With regards,

ErnieParke
mario91100
Scratcher
500+ posts

How to make clones behave individually?

ErnieParke wrote:

I'm slightly confused as to what you want, but from what I'm picking up, you could always use local variables. Each clone gets their own copy of a local variable once created, so now you can track the number of clicks on a specific clone.

With regards,

ErnieParke

No. But I understand your confusion. What I have is this:

The user clicks a button.
The button sends out a broadcast to summon a sprite to clone itself (it has been hidden at the top).
This clone moves downwards until it touches a certain color.
When the button is clicked AGAIN, though, both the clone and the new clone go to the top and do the previously mentioned actions. I think they also multiply themselves by two.
turkey3
Scratcher
1000+ posts

How to make clones behave individually?

Try this in the clones scripts. Sorry I can't post a pic. This should all go in the cloning sprite

Clone startup
forever
wait until <(go?) = [yes] // a variable called "go?" Is set to yes to trigger the clones to move down
show
repeat until <touching color>
change y by (-3) //clones move down
end
hide
wait until <(go?) = [no]> //waits until "go?" turns back to no
set y to (180) //sends clone back to the top
create clone of [myself] //multiplies the clo e

new script

when I receive [button clicked]
If <(button clicked times) = [0] //if its the first time the button is clicked
set [button clicked times] to (1)
else
set [button clicked times] to (0) //if its the second time
create clone of myself //clone
set [go?] to [yes] //triggers the clones to start moving down
wait (.1) secs //just to give them time
set [go?] to [no]
So in this script the variable go? Is set to yes when it wants all the clones to start moving down the screen.

Last edited by turkey3 (June 24, 2013 02:28:45)

mario91100
Scratcher
500+ posts

How to make clones behave individually?

turkey3 wrote:

Try this in the clones scripts. Sorry I can't post a pic. This should all go in the cloning sprite

Clone startup
forever
wait until <(go?) = [yes] // a variable called "go?" Is set to yes to trigger the clones to move down
show
repeat until <touching color>
change y by (-3) //clones move down
end
hide
wait until <(go?) = [no]> //waits until "go?" turns back to no
set y to (180) //sends clone back to the top
create clone of [myself] //multiplies the clo e

new script

when I receive [button clicked]
If <(button clicked times) = [0] //if its the first time the button is clicked
set [button clicked times] to (1)
else
set [button clicked times] to (0) //if its the second time
create clone of myself //clone
set [go?] to [yes] //triggers the clones to start moving down
wait (.1) secs //just to give them time
set [go?] to [no]
So in this script the variable go? Is set to yes when it wants all the clones to start moving down the screen.

GAH! I typed my response wrong. I meant the clones going back to the top was an error.
MrSherlockHolmes
Scratcher
500+ posts

How to make clones behave individually?

mario91100 wrote:

I am wondering how to make clones behave individually as to monitor a click count without all the clones having to return to the starting position. Any way to do this?

mario91100
Simple!
whenclickedsetIDto0repeat3changeIDby1createcloneofmyself

whenIstartasacloneifID=1forever. . .ifID=2forever. . .. . .
As long as you have a script like if (data)=1 then move this way, and you keep it as forever or repeat until a signal is received, even when clone ID's change, they will act as you want them to.
mario91100
Scratcher
500+ posts

How to make clones behave individually?

MrSherlockHolmes wrote:

mario91100 wrote:

I am wondering how to make clones behave individually as to monitor a click count without all the clones having to return to the starting position. Any way to do this?

mario91100
Simple!
(Script goes here)
As long as you have a script like if (data)=1 then move this way, and you keep it as forever or repeat until a signal is received, even when clone ID's change, they will act as you want them to.

This thread is dead.
Do not necropost.

Powered by DjangoBB