Sprite Driver
Sean McManus of Stevenage, Herts., has come up with a program in response to
recent pleas within the pages of AA. His Sprite Driver program is just the
thing to liven up your BASIC games.
The sprites are full colour XORed sprites (print the same again to delete
the original), and are limited to using text co-ordinates. The sprites are
referred to as numbers from zero to 126. They must first be created. Use any
art package, programming language or sprite definer as long as they can be put
up onto the screen from BASIC.
The GRAB command can be used to lift the graphic from the screen and store
it for use with the sprites. The information it needs is X co-ordinate,
Y co-ordinate, Width in bytes, Height in pixels and address in memory to store
it.
|GRAB,x,y,w,h,a
The sprites are defined with SDEF. It links each Sprite number with the
Address it's been grabbed to.
|SDEF,s,a
To print a sprite onto the screen the SPRITE command is used. Just tell it
the Sprite number and the X and Y co-ordinates to position it to.
|SPRITE,s,x,y
X and Y co-ordinates start at the top left of the screen (0,0) and extend to
the bottom right (79,24).
The program launches straight into a demonstration. You can save the RSXs as
a block of code with SAVE "code",b,40000,272. Reload it with:
MEMORY 39999:LOAD"code":call 40000