Fix hedgehog physics %)
authorunc0rr
Sat, 16 Sep 2006 15:15:30 +0000
changeset 149 aae256899c49
parent 148 c0355acf07c8
child 150 d9e8a336195c
Fix hedgehog physics %)
QTfrontend/game.cpp
hedgewars/HHHandlers.inc
hedgewars/uGears.pas
--- a/QTfrontend/game.cpp	Fri Sep 15 20:38:25 2006 +0000
+++ b/QTfrontend/game.cpp	Sat Sep 16 15:15:30 2006 +0000
@@ -97,7 +97,7 @@
 		LocalCFG(teams[i]);
 		SendIPC(QString("ecolor %1").arg(65535 << i * 8));
 		for (int t = 0; t < hdNum[teams[i]]; t++)
-			SendIPC(QString("eadd hh%1 1").arg(t));
+			SendIPC(QString("eadd hh%1 0").arg(t));
 	}
 }
 
--- 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
--- a/hedgewars/uGears.pas	Fri Sep 15 20:38:25 2006 +0000
+++ b/hedgewars/uGears.pas	Sat Sep 16 15:15:30 2006 +0000
@@ -158,7 +158,7 @@
                 end;
     gtHedgehog: begin
                 Result.Radius:= cHHRadius;
-                Result.Elasticity:= 0.002;
+                Result.Elasticity:= 0.35;
                 Result.Friction:= 0.999;
                 Result.Angle:= cMaxAngle div 2;
                 end;