x1: minimum value for x-coordinate

x2: maximum value for x-coordinate (or assumed to be equal to x1 if not provided)

xs: signed step in pixels (between -127...+127) for every horizontal move

and

RUN: indicates movement in the x-direction is initially on or

STOP: indicates movement in the x-direction is initially off

The parameters are equivalent for the y-direction and specified with:

y1: minimum value for y-coordinate

y2: maximum value for y-coordinate (or assumed to be equal to y1 if not provided)

ys: signed step in pixels (between -127..+127) for every move

RUN: indicates movement in the y-direction is initially on

STOP: indicates movement in the y-direction is initially off

Pattern animation is specified with:

p1: minimum value for sprite pattern

p2: maximum value for sprite pattern (or p1 if not specified!)

while movement rates are controlled with:

r: rate at which sprite moves/animates (0-255) where...

0=on every SPRITE MOVE command

1=skip 1 SPRITE MOVE command after moving

2=skip 2 SPRITE MOVE commands after moving

etc

d: delay before initial movement (0-255) where:

0=move on the first SPRITE MOVE command

1=skip 1 SPRITE MOVE command before the first move

2=skip 2 SPRITE MOVE commands before the first move

etc

The flags parameter f is an 8-bit mask (which as seen before is best specified with BIN or @):

bits 1:0 define the behaviour when the x,y limits are reached:

  • 00 = reflect this direction
  • 01 = stop this direction, start other direction
  • 10 = stop this direction
  • 11 = stop completely and make sprite invisible

bit 2 flips the Y-mirror flag when y limits are reached

bit 3 flips the X-mirror flag when x limits are reached

bit 4 controls the behaviour of pattern change:

  • 0 = cycle upwards, wrapping back to lower limit
  • 1 = bounce between lower and upper limits

bit 5 if set, sprite is disabled when its pattern reaches limits

bit 6 if set, updates the pattern even when sprite is stationary and finally

bit 7 if set, X-mirror/Y-mirror/rotation flag are set according to the direction of travel (this bit overrides bits 2 & 3)

The initial position, pattern and other details of the sprite are determined by the last standard SPRITE command. If these values are outside the maximum/minimum ranges, then (depending upon the specified step and RUN|STOP status) they will gradually change until they fall within the max/min range.

If automatic movement is specified for an anchor sprite then, the entire composite or unified sprite will be automatically moved.

Automatic movement, can also be specified for individual relative sprites if this is desired (Since the parameter s is always positive for the SPRITE CONTINUE command, but the sprite remains relative if specified as such in the last standard SPRITE command).


ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.