4.1.3 Follow the mouse pointer

View

With the “sensing” block, you can use the pointer to control the movement of the sprite. The code on the left will continually have the sprite go to the location of the mouse x and mouse y co-ordinates.  We use a “forever loop” to make sure that the sprite continually follows the mouse pointer.

 

Figure 107: Sprite follows the mouse pointer (cursor)
Last modified: Wednesday, 29 September 2021, 4:31 PM