Make high jump behaviour like in worms (back somersault)
authorunc0rr
Mon, 25 Feb 2008 18:10:12 +0000
changeset 790 a6f442173822
parent 789 3d976d2579eb
child 791 928d2830fd0c
Make high jump behaviour like in worms (back somersault)
hedgewars/HHHandlers.inc
--- a/hedgewars/HHHandlers.inc	Sun Feb 24 20:00:31 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Mon Feb 25 18:10:12 2008 +0000
@@ -323,6 +323,10 @@
    if not Gear^.dY.isNegative then
       begin
       CheckHHDamage(Gear);
+
+      if ((Gear^.State and gstHHHJump) <> 0) and
+         (Gear^.dX.QWordValue < _0_02.QWordValue) then Gear^.dX.isNegative:= not Gear^.dX.isNegative; // landing after high jump
+
       Gear^.State:= Gear^.State and not (gstHHJumping or gstHHHJump);
       Gear^.dY:= _0;
       end else Gear^.dY:= Gear^.dY + cGravity;
@@ -427,7 +431,7 @@
          begin
          Gear^.State:= Gear^.State or gstHHHJump or gstMoving;
          Gear^.dY:= -_0_25;
-         Gear^.dX:= SignAs(_0_02, Gear^.dX)
+         Gear^.dX:= -SignAs(_0_02, Gear^.dX)
          end;
    Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);