EasyManua.ls Logo

Commodore 128 - Page 344

Commodore 128
448 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
EXAMPLES:
PRINT RND(O)
.507824123
This displays a random
number.
PRINT INT(RND(1)*100 + 1) This displays a random
89
positive number less than 100.
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 PRINTSPRITE 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

Table of Contents

Other manuals for Commodore 128

Related product manuals