Sprite

From MZXWiki
Revision as of 20:24, 26 January 2011 by Old-Sckool (talk | contribs)
Jump to navigation Jump to search

For a comprehensive tutorial on sprites, see Sprite (Tutorial).

Sprites were introduced to MegaZeux in version 2.65, primarily as a method of making it easier to implement large object representations in the game (for example, engines for handling a multiple character player or enemies). They include many features such as collision detection, easy drawing, and configurable draw order. Despite being designed to make coding easier, many MZXers avoid their use in favor of more traditional methods such as overlay buffering and hand-rolled collision routines. This is largely out of a perception that Sprites are difficult to use.

Commands

PUT color Sprite param # #

IF color Sprite_Colliding pNN # # "label"

IF color Sprite p?? # # "label"

Counters

SPRn_CLIST (write-only)

SPR_CLISTn (read-only)

SPR_COLLISIONS (read-only)

SPR_NUM

SPR_YORDER (write-only)

SPRn_CHECK (write-only)

SPRn_CWIDTH

SPRn_CHEIGHT

SPRn_CX

SPRn_CY

SPRn_OFF (write-only)

SPRn_OVERLAID (write-only)

SPRn_OVERLAY (write-only)

SPRn_REFX

SPRn_REFY

SPRn_SETVIEW (write-only)

SPRn_STATIC (write-only)

SPRn_SWAP (write-only)

SPRn_VLAYER (write-only)

SPRn_HEIGHT

SPRn_WIDTH

SPRn_X

SPRn_Y