Horiz - EDukeWiki

# Horiz

From EDukeWiki

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. The current horiz limit of 199 units equals an angle of 57.25º.

    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
    ...

Retrieved from "http://wiki.eduke32.com/w/index.php?title=Horiz&oldid=11662"
Category:

- Player structure members