Horiz: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
Undo revision 11662 by Fox (talk) ??????????????????????
Tag: Undo
 
Line 1: Line 1:
The '''horiz''' member of the player structure controls the angle at which the player is looking up or down.  A value of 100 equates to looking straight ahead; 299 is looking all the way up and -99 is looking all the way down.
The '''horiz''' member of the player structure controls the angle at which the player is looking up or down.  A value of 100 equates to looking straight ahead; 299 is looking all the way up and -99 is looking all the way down.


Similar to floor/ceiling slopes, the value for horiz represents the tangent of an angle, rather than the angle itself. A horiz difference of 128 corresponds to a tangent difference of one.
Similar to floor/ceiling slopes, the value for horiz represents the tangent of an angle, rather than the angle itself. A horiz difference of 128 corresponds to a tangent difference of one.


  gamevar TEMP 0 0
  gamevar TEMP 0 0

Latest revision as of 15:00, 25 August 2019

The horiz member of the player structure controls the angle at which the player is looking up or down. A value of 100 equates to looking straight ahead; 299 is looking all the way up and -99 is looking all the way down.

Similar to floor/ceiling slopes, the value for horiz represents the tangent of an angle, rather than the angle itself. A horiz difference of 128 corresponds to a tangent difference of one.

gamevar TEMP 0 0

actor APLAYER MAXPLAYERHEALTH PSTAND 0 0

  ifhitspace // slowly angle the player's view downwards when use is held
  {
    getplayer[THISACTOR].horiz TEMP
    ifvarg TEMP -99
      addvar TEMP -1
    setplayer[THISACTOR].horiz TEMP
  }

  ifaction 0
    action PSTAND
...