In this Add-On,
you'll program the Mona Lisa to follow the mouse pointer
and stamp when clicked.
This will create a unique pattern on the stage.
This example project doesn't have any other code right now,
but it's ok if your project does.
You can program this Add-On to work with your existing code.
To start,
program the Mona Lisa to follow the mouse pointer
for the entire program.
Click Motion and select a go to mouse pointer block.
When this block is run,
the sprite goes to the mouse pointer once.
To make the sprite follow the mouse pointer,
add a forever block from Control.
Click to run it.
Notice that the sprite follows the mouse pointer.
Click the stop sign, to stop the program.
Next, program the sprite to stamp.
Select the Pen menu
and drag a stamp block into the forever loop.
Click to run this.
Wow!
The sprite now leaves a trail of stamps behind.
This doesn't give the artist much control
over the pen though.
So, program it to only stamp if the mouse is clicked.
Click Control
and add an if statement inside the forever loop.
The if statement will only run the code inside
if a condition is true.
In this case, that should be if the mouse is clicked,
then the sprite will stamp.
Click Sensing
and add a mouse down block to your if statement.
Then, place the stamp block inside the if statement.
Click this block stack to try it.
Move the mouse around the screen
and click to stamp the Mona Lisa.
Great!
Now, select the Events menu
and find an event that works for this program.
This example we'll use,
when this sprite clicked.
That way, the user can choose when to run the code,
while still seeing anything else that could be programmed.
To clear the stamps from the screen,
use a clear block from the Pen menu.
You may want to clear the screen
when the green flag is clicked.
When you're done with this Add-On,
be sure to share your project with the Scratch community
and provide instructions for how to use this feature.
If you programmed this code to run
when the sprite is clicked,
include that in the instructions.
Now it's your turn.
Use a go to mouse pointer
and forever block
to make the sprite follow the mouse pointer.
Use if mouse clicked
and stamp blocks to make the sprite stamp when clicked.
Program the code to run when the sprite's clicked.
Clear the screen when the green flag is clicked.
Finally, write instructions on the project page
that tell the Scratch Community how to use your project.