Yvel: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Since the velocity is controlled solely by the [[xvel]], the yvel is used to store other values, such as the player ID of an APLAYER actor (to be used in conjunction with [[setplayer]] or [[getplayer]]) or the number of bounces left by a projectile.
Since the velocity is controlled solely by the [[xvel]], the yvel is used to store other values.
 
For an APLAYER sprite, the yvel stores the ID of the player (to be used with [[setplayer]] or [[getplayer]]). Normally the value will equal zero in single-player, and in multiplayer it will range from zero to the number of players ([[multimode]]) minus one. Player spawns in the map are also given an unique yvel ID higher than that of the actual player (i.e. the lowest equals [[multimode]]).
 
For hitscan projectiles, yvel represents the picnum of the projectile used with [[shoot]] command or defined by defineprojectile (while the actual [[picnum]] member equal SHOTSPARK1 for all hitscan projectiles). For normal projectiles, yvel equals the number of bounces left.


[[Category:Sprite structure members]]
[[Category:Sprite structure members]]

Revision as of 16:07, 1 June 2013

Since the velocity is controlled solely by the xvel, the yvel is used to store other values.

For an APLAYER sprite, the yvel stores the ID of the player (to be used with setplayer or getplayer). Normally the value will equal zero in single-player, and in multiplayer it will range from zero to the number of players (multimode) minus one. Player spawns in the map are also given an unique yvel ID higher than that of the actual player (i.e. the lowest equals multimode).

For hitscan projectiles, yvel represents the picnum of the projectile used with shoot command or defined by defineprojectile (while the actual picnum member equal SHOTSPARK1 for all hitscan projectiles). For normal projectiles, yvel equals the number of bounces left.