stoneskin

learning coding with Scratch , Python and Java

07 Create instances with Clone

7.1 Cloning and Clone Blocks

7.1.1 Cloning

Cloning is a feature that allows a sprite to create a copy of itself while the project is running. Each clone has the same costumes, sounds, scripts, and variables as the original but is otherwise independent.

From Scratch 3.0 ,one project may only be 300 clones at once to prevent excessive lagging or crashes.

7.1.2 Clone Blocks

There are three blocks related to cloning, all could be found in the control palette.

cloneblocks

Below is a example to use clone to fire balls

cloneexample1

check the clone example here

7.2 Local Variables of Clone Sprite instance

When you have many clones, you may want give them a number as ID to make them different. We need user Variables

Check the 2nd clone example here

7.3 Sharing Clone Data

Some time you want share a data from a clone to other clone. For example if you want each clone of cat could fire a ball, you need share the position the the clone to the ball sprite.

check the 3rd clone example here

7.4 Projects