Fix hedgehog-on-rope animation
authorunc0rr
Tue, 22 Apr 2008 19:41:20 +0000
changeset 862 7c82903753a4
parent 861 9588286683be
child 863 dfa3aa51ecb5
Fix hedgehog-on-rope animation
hedgewars/uGears.pas
share/hedgewars/Data/Graphics/Hedgehog.png
--- a/hedgewars/uGears.pas	Tue Apr 22 18:33:55 2008 +0000
+++ b/hedgewars/uGears.pas	Tue Apr 22 19:41:20 2008 +0000
@@ -476,8 +476,8 @@
 procedure DrawHH(Gear: PGear);
 var t: LongInt;
 	amt: TAmmoType;
-	hx, hy: LongInt;
-	aangle: real;
+	hx, hy, m: LongInt;
+	aAngle, dAngle: real;
 	defaultPos: boolean;
 begin
 defaultPos:= true;
@@ -493,11 +493,20 @@
 		case CurAmmoGear^.Kind of
 			gtShotgunShot: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
 			gtRope: begin
+				if Gear^.X < CurAmmoGear^.X then
+					begin
+					dAngle:= 0;
+					m:= 1
+					end else
+					begin
+					dAngle:= 180;
+					m:= -1
+					end;
 				DrawHedgehog(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
-						1,
+						m,
 						1,
 						0,
-						DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) - 110);
+						DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
 				defaultPos:= false
 				end;
 			gtBlowTorch: begin
Binary file share/hedgewars/Data/Graphics/Hedgehog.png has changed