For the Multiple Musicians badge, create two or more sprites that perform two different,simultaneous actions when you mouse over them. In this example, when the mouse touches eachPico, it plays a note and changes color. Just like in many of the other badges fortoday, since the sprite needs to do TWO things when you mouse over it, you'll need TWO eventsto start the code. You'll use two “when flag clicked” blocks.
For each block, add a “forever” loop and an "if-then block." Use a "touching mouse-pointer"block from the sensing menu. Now, you can read this block stack. It says: "When theflag is clicked, forever check if the mouse pointer is touching the sprite." If the mousepointer IS touching the sprite, then.... do something. It’s up to you to decide whatYOU want Pico to do. In this example, Pico both plays a note andchanges color when the mouse touches him. One code stack plays the note, and the otherchanges the color. Do you wonder what would happen if you putboth the change color and play note blocks in a single stack instead of in two? Takea look. These 3 picos have the code in two stacks, so they change color and play thenote as quickly as they can when the mouse touches them.
The last pico has only one code stack with both blocks inside it. When the mouse touchesthe pico with one block stack, it first changes color, then it plays a note. Then, it changesto a new color and, next, plays another note forever.
It can't do both actions at the same time because the blocks are stacked one on topof another, requiring the sprite to complete one action before moving on to the next.
Having two code stacks that each do one action solves that problem, because one set of codedoes not need to finish running before the other begins.
This is an important computer science concept called "parallel processing," which meansthat a computer can handle many code instructions from a computer scientist at the same time,but only when the computer scientist instructs the computer to run the instructions simultaneouslyinstead of one instruction after the other. As always, the control is all in your hands,because the computer will only do what you, the computer scientist, tell it to. There’sno “right” or “wrong” answer--if you are happy with the result of your code, thenyou've found the right answer for your program. To earn this badge, you should have two separateblock stacks that control the actions your sprite will take when the mouse touches it.
Once you decide what those actions are, try your code to make sure it does what you want,then make at least one copy of your sprite by right-clicking on it and choosing duplicate.
In the second set of code, change the action so the sprite does something different.
You can make your sprites do whatever you want, but here are some ideas to get you started:You can have each sprite make a sound and say something. Or, you could have each spritemake a drum noise and spin. Now, it's your turn. Choose a sprite. Then,build two block stacks that start “when the flag” is clicked, contain a “forever”loop, and use an “if-then” loop to check if the mouse is touching the sprite, thenmake it perform an action.
Create at least one copy of your sprite so the user can interact with more than one character.
When you're done, put up your sticky and show your sprites to your Gurus so you can earnthe Multiple Musicians badge!
Choose an Add-On
Bust a Move
Learn how to earn the "Bust a Move" badge.
Learn how to earn the "Energy Burst" badge.
Learn how to earn the "Multiple Musicians" badge.
Learn how to earn the "Clone Crazy" badge.
Learn how to earn the "Music Promoter" badge.
Vote on the Talent Show (Advanced)
Modify your project so you can vote for a talent show contestant.
Win the Show! (Advanced)
Make the winning performer celebrate their victory!