Sprite Table: Difference between revisions

From NerdConsole
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 1: Line 1:
The Sprite Table describes the forground layer for a game. You can think of this as the objects that move around such as the player, enemies, and projectiles. NerdConsole has a single Sprite Table that supports up to 256 sprites.
The Sprite Table describes the foreground layer for a game. You can think of this as the objects that move around such as the player, enemies, and projectiles. NerdConsole has a single Sprite Table that supports up to 256 sprites.  The control point for the sprite is always the upper left pixel and this is not affected by graphically flipping or mirroring the tile.  


=== Sprite Table Format ===
=== Sprite Table Format ===
Line 21: Line 21:
''' Key '''
''' Key '''
* x - x-axis position of the upper left corner of the sprite on the screen
* x - x-axis position of the upper left corner of the sprite on the screen
* y - y-axis position of the upper left corner of the sprite on the screen*
* y - y-axis position of the upper left corner of the sprite on the screen
* M - Mirror (Left/Right)
* M - Mirror (Left/Right)
* F - Flip (Top/Bottom)
* F - Flip (Top/Bottom)

Latest revision as of 16:53, 8 May 2024

The Sprite Table describes the foreground layer for a game. You can think of this as the objects that move around such as the player, enemies, and projectiles. NerdConsole has a single Sprite Table that supports up to 256 sprites. The control point for the sprite is always the upper left pixel and this is not affected by graphically flipping or mirroring the tile.

Sprite Table Format

Sprite Tables in NerdConsole use a 4-byte structure for each entry.

Bit 7 6 5 4 3 2 1 0
Byte 0 x x x x x x x x
Byte 1 y y y y y y y y
Byte 2 M F D C p p p p
Byte 3 i i i i i i i i

Key

  • x - x-axis position of the upper left corner of the sprite on the screen
  • y - y-axis position of the upper left corner of the sprite on the screen
  • M - Mirror (Left/Right)
  • F - Flip (Top/Bottom)
  • D - Depth Flag (0 = Over BG, 1 = Under BG)
  • C - Color Cycling
  • p - Sub-Palette Index
  • i - Tile Table Index