Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

2. Moving and Stamping


In this video, you will program the “spray paint” sprite to follow the mouse pointer and 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, then try it on your own. First, make the spray paint sprite follow the mouse pointer. Drag the “go to mouse pointer” block into the scripts area and test it! Click the block to see what it does. The sprite moves to a spot as close to the mouse 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 pointer as 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 paint sprite follows the mouse pointer. Then, use the “stamp” block to make a paint trail appear behind the spray paint sprite, just like you did in the Paint with Tera project. Drag out the “stamp” block, and add it the block stack. Now, when you click the block stack to test it, the spray paint sprite leaves a trail that follows the mouse. Remember from Paint with Tera, clicking the “clear” block clears the paint trails from the stage. Now, it’s your turn: 1. Make the spray paint sprite follow the mouse using a “forever” block and a “go to mouse-pointer” block. 2. Leave a paint trail behind the mouse pointer by using the “stamp” block.

arrow_backward Back
Next arrow_forward
  1. Make the sprite move toward the mouse pointer forever.
  2. Make the sprite stamp itself forever.