In this add-on, you will add some more characters to your commercial. Commercials usually haveseveral characters that interact with each other and with the product. If one characterhas a product, for example, and another one admires it, it might make people feel likethey want to have it, too. This video will show you how to add anothersprite. It will then be up to you to program the sprites to interact with the android inthe commercial. First, click “choose sprite from library,”and add someone you like. This example uses “Sam.” Then, add code to the new sprite.
In this example, Sam glides towards the athlete and says “Wow, I love your watch! I wishI had one!” Click the stack to test it. Add a “when I receive” block from the“events” menu to the top. Select “new message” from the dropdown, and type somethingdescriptive, like “enter crowd.”
Select the athlete sprite, and insert a “broadcast enter crowd and wait” block when you wantthe crowd to appear in the commercial. Test it out.
There’s a bug: the new sprite should only be visible when it’s time for it to appear.
In the new sprite, add a “show” block at the beginning of the stack, and a “hide”block at the end. Then, add a “when flag clicked” block, followed by a “hide”block. Test the code again. Great, it works! Feel free to add more sprites. This examplehas another sprite that glides in with Sam and says “Me too!” Make the new sprite’sblock stack run with the same “when I receive” block. Use “wait” blocks in both sprites’code so that they never talk over each other. To make the athlete sprite respond to thecrowd, add a “when I receive enter crowd” block. Use “say” blocks to make the athletesay something back and “wait” blocks to make sure the athlete doesn’t talk at thesame time as the crowd. This video shows just some of the ways youcan use other sprites in the commercial. It’s up to you to decide which sprites to add,how they should move, and what they should say. Have fun and be creative!
Now, it’s your turn! Add another sprite to the commercial.
Add code to the new sprite to make it interact with the athlete.
Use “broadcast and wait,” “when I receive,” “show,” and “hide” blocks to determinewhen the new sprites should appear. Add more sprites, and make them interact withthe athlete using “wait” and “say” blocks.
Choisir une extension
play_circle_filled
Danser
Programmer le lutin pour qu'il danse.
arrow_forward
play_circle_filled
Changement de scène
Fais passer l'androïde sur différentes scènes pour voir comment le gadget réagit.
arrow_forward
play_circle_filled
Imperméabilité
Ajoute des effets météorologiques pour montrer la solidité du gadget.
arrow_forward
play_circle_filled
Décision d'achat
Demande à l'acheteur d'acheter l'objet.
arrow_forward
play_circle_filled
Public admirateur
Ajoute au projet d'autres lutins qui interagiront avec l'athlète.
arrow_forward
play_circle_filled
Entraîneur sportif
Code le lutin pour lui ajouter un pouls et pour le faire parler de son rythme cardiaque.