Sprite Table

From NerdConsole
Jump to navigationJump to search

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