hedgewars/HHHandlers.inc
changeset 149 aae256899c49
parent 113 d975a426ebf7
child 183 57c2ef19f719
--- a/hedgewars/HHHandlers.inc	Fri Sep 15 20:38:25 2006 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Sep 16 15:15:30 2006 +0000
@@ -321,16 +321,16 @@
             if not TestCollisionXwithXYShift(Gear, hwSign(Gear.dX) - Gear.dX, -3, hwSign(Gear.dX)) then begin Gear.X:= Gear.X + Gear.dX; Gear.dX:= Gear.dX * 0.90; Gear.Y:= Gear.Y - 3 end else
             if not TestCollisionXwithXYShift(Gear, hwSign(Gear.dX) - Gear.dX, -4, hwSign(Gear.dX)) then begin Gear.X:= Gear.X + Gear.dX; Gear.dX:= Gear.dX * 0.87; Gear.Y:= Gear.Y - 4 end else
             if not TestCollisionXwithXYShift(Gear, hwSign(Gear.dX) - Gear.dX, -5, hwSign(Gear.dX)) then begin Gear.X:= Gear.X + Gear.dX; Gear.dX:= Gear.dX * 0.84; Gear.Y:= Gear.Y - 5 end else
-            if abs(Gear.dX) > 0.02 then Gear.dX:= -0.2 * Gear.dX
+            if abs(Gear.dX) > 0.02 then Gear.dX:= -Gear.Elasticity * Gear.dX
                                    else begin
                                         Gear.State:= Gear.State and not gstMoving;
                                         Gear.dX:= 0.0000001 * hwSign(Gear.dX)
                                         end
-                                   else begin
-                                        Gear.State:= Gear.State and not gstMoving;
-                                        Gear.dX:= 0.0000001 * hwSign(Gear.dX)
-                                        end
-         else Gear.dX:= -Gear.dX;
+            else begin
+                 Gear.State:= Gear.State and not gstMoving;
+                 Gear.dX:= 0.0000001 * hwSign(Gear.dX)
+                 end
+         else Gear.dX:= -Gear.Elasticity * Gear.dX;
 
 if ((Gear.State and gstFalling) = 0)and
    (sqr(Gear.dX) + sqr(Gear.dY) < 0.0008) then