In this video, you will program the “spray paint” sprite to follow the mouse pointerand to leave a trail of paint. The “spray paint” sprite is made up of yellow dots,which, when stamped, resemble spray paint. Watch this video to learn how to do it, thentry it on your own. First, make the spray paint sprite followthe mouse pointer. Drag the “go to mouse pointer” block into the scripts area andtest it! Click the block to see what it does. The sprite moves to a spot as close to themouse pointer as possible, which in this case is to the far right of the stage.
For the graffiti project to work, the spray paint sprite must follow the mouse pointeras it moves across the screen. Drag out a “forever” block, and place it around the“go to mouse pointer” block. Now, when you click the block stack, the spray paintsprite follows the mouse pointer. Then, use the “stamp” block to make apaint trail appear behind the spray paint sprite, just like you did in the Paint withTera project. Drag out the “stamp” block, and add it the block stack. Now, when youclick the block stack to test it, the spray paint sprite leaves a trail that follows themouse. Remember from Paint with Tera, clicking the “clear” block clears the paint trailsfrom the stage. Now, it’s your turn:1. Make the spray paint sprite follow the mouse using a “forever” block and a “goto mouse-pointer” block. 2. Leave a paint trail behind the mouse pointerby using the “stamp” block.