Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By : Michael Badger
Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By: Michael Badger

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – turning m in a circle


When we last left our animation, we had the second M displayed on the screen. Now, let's create the script that receives and acts on the next m broadcast message by spinning the First M sprite around in a circle:

  1. Add the blocks to show the First M sprite when it receives the next m broadcast message. If you get stuck, you can take a peek at the screenshot in this exercise.

  2. Instead of a graphical effect, we can animate this script with motion by rotating the First M sprite. From the Motion palette, add the turn () degrees block to the show block.

  3. Wrap the turn () degrees block in a repeat () block. Change the value on the repeat block to 36 and set the value on the turn () block to 10.

  4. Check your animation by clicking on the green flag. Note the motion on the First M sprite as it spins 360 degrees in a circle.

  5. Now that the First M sprite is finished with its animation, we need to add a broadcast () block and create a new message named gimme an O to signal...