Z-axis

From ZCWiki
Jump to: navigation, search

Z position

If the Quest Rule "Enemies Move Through Z-Axis" is disabled, all enemy sprites (including flying enemies) will have a Z position of 0. If the "Show Shadows" rule is set, then flying enemies' shadows will be drawn at an arbitrary point below the enemy as it flies.

Otherwise, the following enemies will change positions in the Z axis as follows:

  • Peahat: Altitude increases in proportion to their flight speed. Maximum altitude of 8 (at which it cannot collide with a grounded Link's weapons - see below).
  • Keese: Altitude increases in proportion to their flight speed. Maximum altitude of 5 when near to Link, but is incrementally higher when far from Link.
  • Pols Voice: ...
  • Vire: ...
  • Tektite: ...

Furthermore, if the "Show Shadows" rule is set, then flying enemies' shadows will be drawn at their X position and Y position, ignoring their Z position.

Z height

The sprites in Zelda Classic have an invisible constant called "Z-height." It corresponds to the HitHeight variable in ZScript. This is used in Z-axis collision detection. A Z-axis collision is registered when the Z position plus Z-height of a sprite is larger than the Z-position of the other, but the Z-position is smaller than the Z-position plus Z height of the other.

These are the values at which most sprites' Z-heights are set by default.

  • Most sprites: 1. (So that Link can jump over them easily.)
  • Link: 12.
  • Link's weapons: 8
  • Room Guys: 8.
  • Boulders: 16.
  • Digdogger: 16.
  • Ganon: 16.
  • Gleeok's body: 32.