Scratch 3.0

Cloning Sprites in Scratch 3.0

Programmingempire

Basically, Cloning Sprites is an important activity that forms part of many Scratch games. This article explains cloning sprites until a condition is satisfied. Also, it explains how to delete a clone. The following project demonstrates cloning sprites.

Scratch 3.0 Project Demonstrating Cloning Sprites
Scratch 3.0 Project Demonstrating Cloning Sprites

Command Blocks used in the Project

The following command blocks are used in cloning sprites.

At first, we use the event command so that the script can start when user click on the green flag. After that, a forever control block executes the inner blocks always until the user clocks on the stop icon. Further, we the Variables and Operators blocks to create a variable x1 and to check when reaches the value greater than 50.

Further, we use the control block repeat…until to check the value of x1 and to repeat the command inside it. As can be seen, we can increment the value of x1 by using the variables block command.

The following steps have been used to create this application. Finally, we create the clone of the sprite used and also turn it for some random value of degree. Since, we need to place the cloned sprite at another position, so we make it to glide at some random position. Otherwise, the cloned sprites will overlap each other.

Deleting Clones

Since, the above mentioned procedure will make an infinite number of clones of the sprite. Therefore, we must delete them. Hence, we create another set of sprite blocks that will recognize a sprite. After that it will check the value of the variable x1 and repeats the following actions. It decrements the value of x1 by 1 and deletes a clone. The following figure shows the complete script.

The Complete Scratch Script for Cloning Sprites
The Complete Scratch Script for Cloning Sprites

Further Reading

How to Create Moving Balloons Project in Scratch 3.0

Cloning Sprites in Scratch 3.0

Getting Started with Scratch 3.0

Block Commands in Scratch 3.0

Essential Elements of Scratch 3.0

programmingempire

You may also like...