Now that you’ve programmed the accessory to follow the mouse, you need a way to stampthe accessory onto the stage. From the “pen” menu, drag out a “stamp”block. Click it, then move the accessory. Notice that the sprite is now stamped on thestage. Making the sprite stamp is easy, but how doyou make the accessory stamp while it’s following the mouse?
To run the “stamp” block now, you have to click it, which you can’t do while theaccessory is following the mouse. [pause to demonstrate]To trigger the stamp to run, you’ll need an event.
From the events menu, drag out a “when key pressed” event block, and attach it to the“stamp” block. Notice that the key in the dropdown is set to “space key.”
Try it out! Click the flag, move the accessory around, and when you want to stamp the accessory,press the space key. Don’t worry if you tested a solution, andit didn’t work. That happens all the time in computer science! Keep coding, testing,and trying solutions until you find one that works.
Awesome, now you can move the accessory around the stage and stamp it.
This stage is getting a little crowded. To clear stamps when this program starts,add a “clear” block between the "when flag clicked" and "forever" blocks.
The stylist can now create a new set of accessories each time the flag is clicked.
Now, it’s your turn,Combine a “stamp” block, with a “when key pressed” event to stamp theaccessory on the stage. Clear the stamps from the screen using a “clear”block. In the next video, you'll get a chance tochange up your accessories.