Time for action – duplicating, flipping, and switching a sprite's costume
We've established throughout our exercises in this book that sprites have costumes, and we've chosen sprites that have more than one costume because it's been convenient to our projects. We can, however, add costumes to a sprite. In this exercise, we'll add a costume by duplicating an existing costume as follows:
With the dog sprite selected, click on the Costumes tab.
Right-click on the dog2-b costume and select duplicate to create a fourth costume called dog2-b2.
Select the dog2-b2 costume and then click on the flip left-right button at the top of the image editor. The costume dog2-b2 now faces to the left.
Name the costume face left. Also, change the name of dog2-a to face right. See the following screenshot:
To use the new sprite, add the switch costume to () block to the top of the glide block. Select the face left costume.
Add another switch costume to () block to the top of the script that starts with the set x to...