SPRITE
BASIC keyword | |
Keyword: | SPRITE |
Abbreviation: | sP |
Type: | Command |
Token code: | $fe $07 (254 7) |
Handling routine in BASIC ROM: |
|
List of all BASIC keywords |
Remark: This article describes the BASIC command SPRITE in Commodore BASIC 7.0 or higher.
Type: Command General Programming-Syntax: SPRITE <spriteno> [,[<active>][,[<color>][,[<priority>][,<x-scale>][,[<y-scale>][,[<multicolor>] ]]]]]
The command SPRITE switches sprites on and off and sets their attributes. The command has 7 parameters, but only the first one must be specified!
All parameters are 0 (inactive or off) or 1 (active or on), except <spriteno> 1 until 8 and <color> 1 (black) until 16 (grey3).
The color table of BASIC 7.0:
Value | Nname | Color | Value | Name | Color | |
---|---|---|---|---|---|---|
1 | Black | 9 | Orange | |||
2 | White | 10 | Brown | |||
3 | Red | 11 | Lightred | |||
4 | Cyan | 12 | Darkgrey / Grey 1 |
|||
5 | Violet / Purple |
13 | Grey 2 | |||
6 | Green | 14 | Lightgreen | |||
7 | Blue | 15 | Lightblue | |||
8 | Yellow | 16 | Lightgrey / Grey 3 |
If you use this color table minus 1, you get the official C64 color table.
The attributes can be read out with the function RSPRITE.
Another sprite commands in BASIC 7.0 are MOVSPR, RSPCOLOR, RSPPOS, SPRCOLOR, SPRDEF and SPRSAV, also BUMP, COLLISION, GSHAPE and SSHAPE.
Examples
SPRITE 1,1,2,,,,1
The activation of the first sprite.
SPRITE 1
No function!
ABS | AND | APPEND | ASC | ATN | AUTO | BACKUP | BANK | BEGIN | BEND | BLOAD | BOOT | BOX | BSAVE | BUMP | CATALOG | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLLISION | COLOR | CONCAT | CONT | COPY | COS | DATA | DCLEAR | DCLOSE | DEC | DEF FN | DELETE | DIM | DIRECTORY | DLOAD | DO | DOPEN | DRAW | DS | DS$ | DSAVE | DVERIFY | EL | ELSE | END | ENVELOPE | ER | ERR$ | EXIT | EXP | FAST | FETCH | FILTER | FN | FOR | FRE | GET | GET# | GETKEY | GO64 | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | MOVSPR | NEW | NEXT | NOT | (OFF) | ON | OPEN | OR | PAINT | PEEK | PEN | (PI) | PLAY | POINTER | POKE | POS | POT | PRINT | PRINT USING | PRINT# | PUDEF | (QUIT) | RCLR | RDOT | READ | RECORD | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RND | RREG | RSPCOLOR | RSPPOS | RSPRITE | RUN | RWINDOW | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SLEEP | SLOW | SOUND | SPC( | SPRCOLOR | SPRDEF | SPRITE | SPRSAV | SQR | SSHAPE | ST | STASH | STEP | STOP | STR$ | SWAP | SYS | TAB( | TAN | TEMPO | THEN | TI | TI$ | TO | TRAP | TROFF | TRON | USR | VAL | VERIFY | VOL | WAIT | WHILE | WINDOW | WIDTH | XOR