If there is no existing Sprite with the selected number, it will be created automatically. Similarly, the Sprite Bank will be reserved by AMOS Professional, if it is not already defined.
It should be noted that the GET BOB instruction is identical to GET SPRITE, making them interchangeable.
SET SPRITE BUFFER
instruction: set maximum height of Sprites
Set Sprite Buffer number
This command allocates extra memory for hardware and computed Sprites to work within. Although each hardware Sprite can be up to 270 lines in height, AMOS Professional reserves sufficient memory for 128 lines, as the default allocation.
If you are using computed Sprites, it is more practical to extend the SET SPRITE BUFFER number to a larger value. This is economical on memory, since each line only consumes 96 bytes. Thus a maximum height value of 256 would require about 12k of extra memory.
Be warned that this command erases all current Sprite assignments, as well as re-setting the mouse pointer, so it must be used at the beginning of your programs! For example, the following line would be placed at the start of your listing:
X> Set Sprite Buffer 256
Sprite Commands
SPRITE UPDATE
instruction: control Sprite movements
Sprite Update
Sprite Update Off
Sprite Update On
The SPRITE UPDATE family of commands provide total control of Sprite movements. Normally, when a Sprite is moved its position is updated automatically during the next vertical blank period. Please see WAIT VBL if this needs explaining. However, when many Sprites are moved with the SPRITE command, updates will happen before all of the Sprites have been successfully repositioned, which can result in jerky patterns of movement. In these circumstances, the automatic updating system can be turned off with a SPRITE UPDATE OFF command.
When the Sprites have been moved successfully, a call to SPRITE UPDATE will reposition any Sprites that have been moved since the last update. Alternatively, SPRITE UPDATE ON returns to the default status of automatic updating.
SPRITE OFF
instruction: remove Sprites from screen
Sprite Off
Sprite Off number