Discuss Scratch

CoScriptz
New to Scratch
9 posts

what does these blocks do?

Hi I want to understand what does that blocks mean I couldn't found from Coding For Kids Carol Vorderman

when I start as a clone

create the clone of myself

delete this clone

Please explain
deck26
Scratcher
1000+ posts

what does these blocks do?

A clone is a copy of the sprite which runs the same scripts - as long as it exists when the script is started. Clones can't exist at the start of a project run so they don't follow green flag scripts but anything like a ‘when this sprite clicked’, ‘when key pressed’ and broadcasts will be picked up. The ‘when this sprite clicked’ will run just for the item clicked - not all clones of the object.

So if you have multiple enemies all doing much the same you don't need to have multiple sprites.

Any variable defined as ‘for this sprite only’ will be inherited by the clone but it then manages its own copy. So you can create multiple enemies with separate health values.

Create a clone of myself means you're copying that object. Imagine we have a sprite on the left and a clone on the right and when you click either it creates a clone of the sprite (so create clone of spritename) they will both appear where the sprite is as they've inherited its position. If you told them to create clone of myself the sprite's clone would appear on the left where the sprite is but the clone's copy will be on the right - it has cloned itself rather than cloning the sprite.

Delete this clone does what it says. There's a limit of 301 clones in a project so if they've done their work (eg enemy destroyed) it is better to delete the clone.

Powered by DjangoBB