Commodore 128 Programmer's Reference Manual page 282

Hide thumbs Also See for 128:
Table of Contents

Advertisement

272
COMMODORE 128
memory. Since you are now back in the control of the BASIC language, you have to
turn on your sprite in order to see it on the screen. To turn it on, use the SPRITE
command you learned. For example, you created sprite 1 in SPRDEF mode. To turn it
on in BASIC, color it blue and expand it in both the X and Y directions and enter this
command:
SPRITE 1,1,7,0,1,1,0
| j
Now use the MOVSPR command to move it at a 90-degree angle at a speed of 5,
as follows:
MOVSPR 1,90 #5
IJ
Now you know all about SPRDEF mode. First, create the sprite, save the sprite
data and exit from SPRDEF mode to BASIC. Next, turn on your sprite with the SPRITE
command. Move it with the MOVSPR command. When you're finished programming,
SAVE your sprite data in a binary file with the BSAVE command as follows:
BSAVE "filename", BO, P3584 TO P4096 (This saves all 8 sprites.)
SPRITE
Turn on and off, color, expand and set screen priorities for a sprite
SPRITE number> [,on/off][,fngd][,priority] [,x-*xp] [,y-exp] [,mode]
The SPRITE statement controls most of the characteristics of a sprite. The
; >
brackets signify optional parameters. If you omit a parameter, you still must include a
M
comma in its place.
PARAMETER
DESCRIPTION
number
Sprite number (1-8)
on/off
Turn sprite on (1) or off (0)
foreground
Sprite foreground color (1-16)
priority
Priority is 0 if sprites appear in front of objects on the screen. Priority
is 1 if sprites appear in back of objects on the screen,
x-exp
Horizontal expansion on (1) or off (0)
y-exp
Vertical expansion on (1) or off (0)
mode
Select standard sprite (0)
or multi-color sprite (1)
; i
Unspecified parameters in subsequent sprite statements take on the characteristics of the
previous SPRITE statement. You may check the characteristics of a SPRITE with the
j I
RSPRITE function.
U
EXAMPLES:
SPRITE 1,1,3
Turn on sprite number 1 and color it red.
u

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents