• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeScratchCustom Blocks in Scratch 2.0
Previous Next

Custom Blocks in Scratch 2.0

Posted by: Alvin Jin , January 17, 2014

Got 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.

11

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.

Tags: Scratch

Share!
Tweet

Alvin Jin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors