Now it’s time for another spell. This time you’re going to cast a transformation spell by broadcasting a toad
message that turns the Fairy sprite into a toad!
Maybe she’s going on an adventure where being a toad will be more useful.
Add a script to the toad button sprite to broadcast the ‘toad’ message:
Select the Fairy sprite and click on the Costumes tab.
To transform the Fairy sprite into a toad you will use Fairy-a and Fairy-toad-a costumes.
Click on the Code tab and add a switch costume to
block to the end of your existing when flag clicked
script so the Fairy is in human form when you run your project:
Add a new script to the Fairy sprite to turn into a toad:
Add the Croak sound to the Wand sprite.
Rename the sound to toad
:
Add a script to the Wand sprite to play the toad
sound when the toad spell is cast:
Test: Test that you can turn the Fairy into a toad, with a sound effect, when you click the toad button. Click on the green flag again to turn the Fairy sprite back into a human.
The opposite of a ‘toad’ spell is an ‘untoad’ spell.
Add a script to the untoad button sprite to broadcast
the ‘untoad’ message:
Add a new script to untoad
the Fairy sprite:
Select the Wand sprite and switch to the Sounds tab.
Duplicate the toad sound and rename it to untoad
.
Click on the Reverse icon so that the untoad sound plays backwards.
Add a script to the Wand sprite to play the untoad
sound:
Test: Try the toad and untoad spells, and try shrink and grow when the Fairy is in toad form.