Stamping an Instance of a Costume on the Stage

In addition to all of the pen code blocks demonstrated so far, Scratch provides one last block, shown in Figure 12.10, which allows you to capture a sprite’s costume and use it to stamp copies of the sprite on the stage.

Figure 12.10. This code block lets you use a sprite’s costume as the basis for creating a stamp.


As an example of how to work with this code block, create a new Scratch application, remove the default cat sprite from it, and then add a copy of the crab1-a sprite to it. You will find this sprite in Scratch’s Animals folder. Once added, shrink the sprite down to about a third of its default size and then add the following script to it.

When executed, this script clears the stage of any previous drawing, which also includes stamps, moves the sprite to the upper-left corner of the stage, and sets its direction. Next, a loop is executed four times, stamping the image of the sprite four times as it is moved around the stage. Figure 12.11 shows how the stage will look once the script has finished executing.

Figure 12.11. Decorating the stage using a sprite as the basis for generating stamps.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.46.36