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.
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.
Leave a Reply
You must be logged in to post a comment.