Tinkerton55 / SourceFOQ

Source engine modified for FOQ
1 stars 0 forks source link

Implement slope jumping #10

Closed Tinkerton55 closed 7 years ago

Tinkerton55 commented 8 years ago

Add some kind of boost to player's velocity when jumping up along a slope.

Tinkerton55 commented 7 years ago

Slopejumping is now implemented in shared/gamemovement.cpp.

The code traces the surface the player is standing on, checks whether it is a walkable slope, then depending on the slope angle and the direction of movement (up or down the slope) modifies the Z and XY components of the player's velocity.

If the player is moving up the slope, the Z component is increased and the XY components are reduced. If the player is moving down the slope, the Z component is reduced and the XY components are increased. If the player is moving side to side, there is no effect on the velocity.

If the slope is steeper, the effect on the velocity is stronger.