Category Archives: Scratch 2.0

Clone block in Scratch 2.0

Cloning in Scratch
Cloning in Scratch

Cloning. What an abstract idea. One of the new features in Scratch 2.0 is the ability to clone an object. Here’s a quick script that shows us cloning an apple so we can “feed the cat.” This script is attached to the sprite we’re cloning (an apple). Put all the stuff you want to do with the clone in between the clone startup and end startup blocks.

We use another sprite to actually clone the apple because cloning your self is hard, stresses Scratch, and feels wrong. In my example, sprite 1, the cat in the lower left of the stage, his hurling apples at the second cat each time the space bar is shown. That script isn’t shown, but it’s really simple (when space bar pressed, clone apple).

The following image shows a cloned apple.

A cloned apple.
A cloned apple.

Custom Blocks in Scratch 2.0

scratch2-custom-blocksGot a demo of custom blocks at Scratch Day Philadelphia. Here’s a quick script that shows a custom block I created  and named dance. It uses a couple of turn blocks and a costume.

The exciting feature of custom blocks in Scratch 2.0 is that they accept parameters. Note the rotation variable in the turn blocks. That allows us to pass values into the custom block at run time instead of hard coding values into our blocks.

My simple script (when space key pressed, dance), shows what the actual script looks like. The four in the screen shot is passed to the turn blocks in the custom dance block, and if I want to experiment with different values, I just change it the dance block.