In this video, you’ll program the accessory sprite to follow the mouse-pointer so thestylist using the program can control the placement of each accessory.
To start, click on the sprite named "accessory." Then, drag out the "go to mouse-pointer" blockfrom the motion menu. Click on the block, and you'll see that the accessory sprite movesas close to the mouse pointer as it can. When you move the mouse around, the accessory spritedoesn’t follow it. Well, that's not very helpful.
When clicked, the "go to mouse pointer" block only runs once.
You need the accessory sprite to continuously go to the mouse pointer as the mouse movesaround the screen. Make that happen by dragging out a “forever” block from the controlmenu. Put the "forever" block *around* the "go tomouse pointer" block. Try it now. When you move the mouse pointer around the stage, theaccessory sprite goes to the mouse pointer over and over again.
Lastly, add a "when flag clicked" block to the stack to make the accessory sprite followthe mouse pointer as soon as the project is run.
Now, it's your turn: Add a “go to mouse pointer” block.
Add a “forever” block. Add a “when flag clicked” block.