megazeux
megazeux copied to clipboard
Add SPRn_AUTOOFF counters
This is to simplify the process of clearing sprites intended to only appear on a single board. Normally, setting up sprites in :justentered
works fine, but since there's no :justleft
, clearing them when leaving the board can be tricky, especially if the sprite ID's are dynamically allocated using &ROBOT_ID&
. But with SPRn_AUTOOFF
, it's just a matter of adding another line to the sprite initialization, and it will automatically be cleared when leaving the board, without the need to add any code anywhere else.
This also changes struct sprite::flags
from char
to unsigned int
, since there were no bits left for the new flag.