Sprite

From MZXWiki
Revision as of 09:22, 3 October 2012 by Old-Sckool (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

Instantiation

SPRn_X

SPRn_Y

SPRn_REFX

SPRn_REFY

SPRn_HEIGHT

SPRn_WIDTH

Collision

SPRn_CX

SPRn_CY

SPRn_CWIDTH

SPRn_CHEIGHT

SPRn_CLIST (write-only)

SPR_CLISTn (read-only)

SPR_COLLISIONS (read-only)

SPRn_CCHECK (write-only)

SPR_NUM

Graphical

SPR_YORDER (write-only)

SPRn_OFF (write-only)

SPRn_OVERLAID (write-only)

SPRn_OVERLAY (write-only)

SPRn_SETVIEW (write-only)

SPRn_STATIC (write-only)

SPRn_VLAYER (write-only)


Other

SPRn_SWAP (write-only)