Commodore 128 System Manual page 344

Table of Contents

Advertisement

EXAMPLES:
PRINT RND(O)
.507824123
PRINT INT(RND(1)*100 + 1)
89
RSPCOLOR
Return sprite multicolor values
RSPCOLOR (register)
When:
X = 1
RSPCOLOR returns the sprite multicolor 1
X = 2
RSPCOLOR returns the sprite multicolor 2
The returned color value is a value between 1 and 16. The
counterpart of the RSPCOLOR function is the SPRCOLOR
statement. Also see the SPRCOLOR statement.
EXAMPLE:
10 SPRITE 1,1,2,0,1,1,1
20 SPRCOLOR 5,7
30 PRINT"SPRITE MULTICOLOR 1 IS";RSPCOLOR(1)
40 PRINT"SPRITE MULTICOLOR 2 IS";RSPCOLOR(2)
RUN
SPRITE MULTICOLOR 1 IS 5
SPRITE MULTICOLOR 2 IS 7
ln this example line 10 turns on sprite 1, colors it white, expands it
in both the X and Y directions and displays it in multicolor mode.
Line 20 selects sprite multicolors 1 and 2. Lines 30 and 40 print
the RSPCOLOR values for multicolor 1 and 2.
RSPPOS
Return the speed and position values of a sprite
RSPPOS (sprite number,X)
where sprite number identifies which sprite is being checked, and
X specifies X and Y coordinates or the sprite's speed.'
18-16
This displays a random
number.
This displays a random
positive number less than 100.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents