Horiz: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
Completely replaced the previous page contents
Line 1: Line 1:
Horiz is the 'look up/down' value: lookup adds 12, lookdown subtracts 12.
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.
To simulate what LOOKUP does internally, set return_to_center to 9, add 12 to horiz. If player is running, add another 12.
 
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
...


[[Category:Player structure members]]
[[Category:Player structure members]]

Revision as of 09:37, 7 September 2006

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.

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