Action: Movetorand(target)

Related Actions: move, moveto, movebyx, movebyy, moverandx, moverandy, restrictx, restricty, letinitx, letinity, letobjectx, letobjecty
See also: FKiSS, Events, Actions

movetorand(target)

First defined in: FKiSS2.1
The movetorand action causes target to move to a random position within the play field or, if target's movement is restricted, to the restricted range of movement.
FKiSS movement is restricted to the play field unless restrictx or
restricty is used to alter the limits for an object.

target

In FKiSS2.1 to FKiSS3, target must be an object number.
In FKiSS4, target may be an object number or a variable representing an object number.

Example:

;@ movetorand(#1)     ; Move object #1 to a random position on the play field.
;@ movetorand(VarObj) ; Move object identified by variable VarObj to a random position on the play field.