The function sets its sprite’s X and Y position to that of the mouse-pointer or another sprite — in other words, it moves the sprite to a random position, the mouse-pointer, or another sprite.
The example demonstrates how to implement mouse tracking in Python.
Code
sprite = Sprite('Tobi')
while True:
if (sprite.iskeypressed("space")):
sprite.goto("_mouse_")
Output
Read More