Discuss Scratch

BC825
Scratcher
58 posts

the cloning tutorial: the basics of cloning.

WOWCrAzY000 wrote:

Is it possible for the clones to interact with one another (I'm trying to do an if statement when two different clones touch)
Yes, it is! This si what you do:
when I start as a clone
if <touching [a sprite v] ?> then
do whatever you want it to
end

The problem with this is it will sense if it si touching the clone AND the main one, unless you hide the main one. I hope this helps!
yekoye252
Scratcher
21 posts

the cloning tutorial: the basics of cloning.

LoudHeadphones wrote:

To add to this (almost sticky worthy) tutorial, here is how you make multiple clones of the same sprite that do different things:

First you create your clones of course
when green flag clicked
set [ID v] to [1]
repeat (3)
create clone of [myself v]
change [ID v] by (1)
end
NOTE: When you create the variable ID you must check the box that says “for this sprite only”

Now to apply this ID of the clone, we do this
when I start as a clone
if <(ID) = [1]>
go to x: (100) y: (100)
else
if <(ID) = [2]>
go to x: (-100) y: (-100)
else
go to x: (0) y: (0)
end
end
So you can see this “ID” for each clone changes each time you create one. The reason that they don't all read the ID as the same number is because it's “for this sprite only” which means that each clone stores that variable by its self so only that clone can change the variable for that clone.

Hope that makes sense to you readers learning about the wonderful world of cloning.
i reported this to be stickied!
Fireguyx2
Scratcher
1 post

the cloning tutorial: the basics of cloning.

Hello!

I am making a platformer and I was wondering if you could tell me how to create a shadow for my platformer that follows it around???

I would greatly appreciate it.
lambfrs
Scratcher
9 posts

the cloning tutorial: the basics of cloning.

I'm making a minecraft project and can't get the clones to move, Any ideas?
Vibrato
Scratcher
1000+ posts

the cloning tutorial: the basics of cloning.

lambfrs wrote:

I'm making a minecraft project and can't get the clones to move, Any ideas?
Try creating your own topic - your post is more likely to be seen there.
lambfrs
Scratcher
9 posts

the cloning tutorial: the basics of cloning.

when green flag clicked
lambfrs
Scratcher
9 posts

the cloning tutorial: the basics of cloning.

when I start as a clone
create clone of [ v]
Airobomarordr
Scratcher
3 posts

the cloning tutorial: the basics of cloning.

InCrIpToNiX wrote:

LoudHeadphones wrote:

To add to this (almost sticky worthy) tutorial, here is how you make multiple clones of the same sprite that do different things:

First, you create your clones of course
when green flag clicked
set [ID v] to [1]
repeat (3)
create a clone of [myself v]
change [ID v] by (1)
end
NOTE: When you create the variable ID you must check the box that says “for this sprite only”

Now to apply this ID of the clone, we do this
when I start as a clone
if <(ID) = [1]>
go to x: (100) y: (100)
else
if <(ID) = [2]>
go to x: (-100) y: (-100)
else
go to x: (0) y: (0)
end
end
So you can see this “ID” for each clone changes each time you create one. The reason that they don't all read the ID as the same number is because it's “for this sprite only” which means that each clone stores that variable by its self so only that clone can change the variable for that clone.

Hope that makes sense to your readers learning about the wonderful world of cloning.

what if I want to have 100+ clones doing different things? I don't have time for all that scripting…
Airobomarordr
Scratcher
3 posts

the cloning tutorial: the basics of cloning.

I am still worried about what to do with clones:
when green flag clicked
create clone of [ v]
when I start as a clone
say [] for (2) secs
move (foo) steps

Last edited by Airobomarordr (Sept. 26, 2020 08:39:44)

Airobomarordr
Scratcher
3 posts

the cloning tutorial: the basics of cloning.

Airobomarordr wrote:

InCrIpToNiX wrote:

LoudHeadphones wrote:

To add to this (almost sticky worthy) tutorial, here is how you make multiple clones of the same sprite that do different things:

First, you create your clones of course
when green flag clicked
set [ID v] to [1]
repeat (3)
create a clone of [myself v]
change [ID v] by (1)
end
NOTE: When you create the variable ID you must check the box that says “for this sprite only”

Now to apply this ID of the clone, we do this
when I start as a clone
if <(ID) = [1]>
go to x: (100) y: (100)
else
if <(ID) = [2]>
go to x: (-100) y: (-100)
else
go to x: (0) y: (0)
end
end
So you can see this “ID” for each clone changes each time you create one. The reason that they don't all read the ID as the same number is because it's “for this sprite only” which means that each clone stores that variable by its self so only that clone can change the variable for that clone.

Hope that makes sense to your readers learning about the wonderful world of cloning.

what if I want to have 100+ clones doing different things? I don't have time for all that scripting…
Mineturtle10000
Scratcher
1 post

the cloning tutorial: the basics of cloning.

How do you get it to where when deleting a clone it will only delete one at a time rather than all of them.
Voblast
Scratcher
8 posts

the cloning tutorial: the basics of cloning.

when green flag clicked
forever
if <mouse down?> then
stamp
end
end
i made a stamper
Nezon
Scratcher
1000+ posts

the cloning tutorial: the basics of cloning.

STOP NECROPOSTING!!!

Powered by DjangoBB