Moving sprites: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (1 revision) |
(No difference)
|
Revision as of 08:26, 7 February 2011
Sprites can be moved individually if they're not stuck together, of by blocks otherwise.
Horizontal position
Their horizontal (X) position is set in VRAM, in SCB4. It's relative to the left screen border.
Example: write $0010 to $8402, puts sprite n°2 at 16 pixels from the left.
Vertical position
Their vertical (Y) position is set in VRAM, in SCB3. It's reversed (496-Y), but relative to the top screen border. A value of $1F0 sets the sprite to Y=0, $110 sets it at 224 (out of the visible area).
Example: write 496-14 ($1E2) to $8205, puts sprite n°5 at 14 pixels from the top.
Like every location in VRAM, these values can be updated mid-frame to create stretches.