Move Sprite

Starts a sprite moving

Syntax

Move Sprite spriteNum,xDist,yDist,speed

Description

The 'Move Sprite' command sets sprite spriteNum moving at a specified speed for xDist pixels to the right and yDist pixels downwards. Once it has started moving it will continue to do so until it reaches the destination or you issue it another move command.

The speed is specified in pixels/frame, for example passing 1 means move one pixel per frame in towards the destination. If you pass in a negative number as the speed, this is instead interpreted as the number of steps to complete the movement in. For example, passing -5 means cover the distance in 5 steps, no matter what the distance is.

To test if a sprite has finishing moving use the Sprite Moving function.
To stop the sprite before its movement finishes, issue another move command with 0 for the x and y distances.

See also:
The 'M'ove moan program function.

Table of contents