
LINE 55:
RX=INT(X/256)
LX=X-RX*256
LINE 60:
POKEV,LX
POKEV+16,RX
LINE 70:
IFP= 192THEN
GOSUB200
RXis the integer of X/256 which means that RXis
rounded off to 0 when X is less than 256, and RX
becomes 1 when X reaches position 256. We will
use RXin a moment to POKE V+16 with a 0 or 1
to turn on the "RIGHT SIDE" of the screen.
When the sprite is at X position 0, the formula
looks like this: LX
= 0 - (0 times 256) or o. When
the sprite is at X position 1 the formula looks like
this: LX
= 1 - (0 times 256) or 1. When the sprite
is at X position 256 the formula looks like this: LX
= 256 - (1 times 256) or 0 which resets X back to
o which must be done when you start over on the
RIGHT
SIDEof the screen (POKEV+16,1).
You POKE V by itself with a value to set the Hori-
zontal (X) Position of sprite 0 on the screen. (See
SPRITEMAKINGCHART on Page 176). As shown
above, the value of LX, which is the horizontal
position of the sprite, changes from 0 to 255 and
when it reaches 255 it automatically resets back
to zero because of the LXequation set up in line
55.
POKEV+16 always turns on the "right side" of
the screen beyond position 256, and resets the
horizontal positioning coordinates to zero. RX is
either a 0 or a 1 based on the position of the
sprite as determined by the RXformula in line 55.
If the sprite pointer is set to 192 (the first sprite
shape) the waveform control for the first sound ef-
fect is set to 129 and 128 per line 200.
172 PROGRAMMING GRAPHICS
Komentáře k této Příručce