The function sets its sprite’s X and Y position to the specified value. This block has no animation in its movement — it is the simplest way to move a sprite around the screen without displaying any animation (i.e. gliding). Therefore, this block is used whenever a sprite needs to jump to another spot.
The example demonstrates using key sensing to control the sprite's movement in Python.
Code
sprite = Sprite('Beetle')
sprite.setdirection(90)
sprite.gotoxy(0, 0)
while True:
if sprite.iskeypressed('up arrow'):
sprite.move(3)
if sprite.iskeypressed('down arrow'):
sprite.move(-3)
if sprite.iskeypressed('left arrow'):
sprite.left(3)
if sprite.iskeypressed('right arrow'):
sprite.right(3)
Output
Read More