1

Clone and Reproduce

The functions of clone and reproduce blocks are similar, what is the difference between them? Let's get to know them!

I. What is clone?

  • "clone" is to create an "empty-code clone" of the sprite, which can copy all the state of sprite when it is cloned (including size, angle, coordinates, mass, styles and so on, except script).

  • Clones of the same sprite in different moment are in different state. (See example as below)

Change the color of the clone, we can clearly see that each clone has cloned the color of the sprite at different times. ↓

  • Blocks related to clone are in Events:

  • Because the clone would not clone the blocks of the sprite, if you want to run the clone, you should use "when I start as a clone" block.

    Th script below this block is the script of the all clones. Also, clone can be cloned again.

  • Please note: the maximum number of clone is 300. The clones beyound 300 will be deleted automatically to ensure the smooth running of the game.

II. What is reproduce?

The reproduced sprite will duplicate not only the appearance but also all blocks of the specified sprite.

Set the reproduced sprite to specified position, and it would do exactly what the original sprite does.

  • Please note: When you use "when Start clicked" as the condition, do not use reproduce block on the sprite.

**Because if all reproduced sprites would run the reproduce block, a terrible exponential growth will be formed, which will lead to a direct collapse of the page. You can reproduce the sprite on background.

III. The differences between clone and reproduce

  • The biggest difference is that the reproduced sprite would inherit the script of the original sprite while clone woulld not.

  • If you want the duplicated sprite to run the same script as the original sprite, it's most convenient to use "reproduce"; conversely, if you want to copy a sprite that does not execute the same script as the original sprite, it would be easier to choose "clone".

  • For example:

    • A shaking Codemao → reproduce once → two shaking Codemao (The reproduced sprite is the same as the original sprite)

    • A shaking Codemao → clone once → one more Codemao without any script

It is hard to control and tell which is the original sprite in the former; but the latter has obvious orders.

  • Tips:

When you no longer use the duplicate, use "delete" block whether you have used clone or reproduce block.

Delete the duplicates in time to avoid unnecessary consumption when the game is running.

So far, the duplicates beyound 300 will be deleted automatically by the system.

IV. How to achieve "shadow split" effect with clone

  • As shown in below picture, translucent split will follow Codemao as it moves.

Use "clone" block and "wait seconds" block.

However, Codemao clone will fill the stage with no translucent effect.

So, remember to delete redundant clones.

Use "delete" block to delete itself after cloning.

As for translucent effect, you can use "transparancy" effect in Looks.