Add watermelon sprite
authorunc0rr
Thu, 18 Sep 2008 14:44:44 +0000
changeset 1262 e9191c693e44
parent 1261 903058d382c7
child 1263 24677a82531d
Add watermelon sprite
hedgewars/GSHandlers.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
share/hedgewars/Data/Graphics/Watermelon.png
--- a/hedgewars/GSHandlers.inc	Thu Sep 18 13:39:05 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Thu Sep 18 14:44:44 2008 +0000
@@ -145,8 +145,8 @@
 				for i:= 0 to 5 do
 					begin
 					dX:= rndSign(GetRandom * _0_1);
-					dY:= (GetRandom - _3) * _0_08;
-					AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 75);
+					dY:= (GetRandom - _2) * _0_2;
+					AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMelonPiece, 0, dX, dY, 75)^.DirAngle:= i * 60;
 					end
 				end
 		end;
@@ -170,8 +170,12 @@
 	DeleteGear(Gear);
 	exit
 	end;
-if (GameTicks and $1F) = 0 then
-	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0)
+
+if Gear^.Kind = gtMelonPiece then
+	CalcRotationDirAngle(Gear)
+else
+	if (GameTicks and $1F) = 0 then
+		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/hedgewars/uConsts.pas	Thu Sep 18 13:39:05 2008 +0000
+++ b/hedgewars/uConsts.pas	Thu Sep 18 14:44:44 2008 +0000
@@ -47,7 +47,7 @@
 			sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft,
 			sprKamikaze, sprWhip, sprKowtow, sprSad, sprWave,
 			sprHurrah, sprLemonade, sprExplPart, sprExplPart2,
-			sprCakeWalk, sprCakeDown, sprAMAmmosBW);
+			sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon);
 
 	TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
 			gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope,
@@ -56,7 +56,7 @@
 			gtFirePunch, gtATStartGame, gtATSmoothWindCh, gtATFinishGame,
 			gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, gtGirder,
 			gtTeleport, gtSmallDamage, gtSwitcher, gtTarget, gtMortar,
-			gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon);
+			gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece);
 
 	TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire);
 
@@ -423,7 +423,9 @@
 			(FileName:  'Cake_down'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
 			Width:  64; Height: 64; saveSurf: false),// sprCakeDown
 			(FileName:   'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
-			Width:  32; Height: 32; saveSurf: false) // sprAMAmmosBW
+			Width:  32; Height: 32; saveSurf: false),// sprAMAmmosBW
+			(FileName: 'Watermelon'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+			Width:  32; Height: 32; saveSurf: false) // sprWatermelon
 			);
 
 	Wavez: array [TWave] of record
--- a/hedgewars/uGears.pas	Thu Sep 18 13:39:05 2008 +0000
+++ b/hedgewars/uGears.pas	Thu Sep 18 14:44:44 2008 +0000
@@ -140,7 +140,8 @@
 			@doStepKamikaze,
 			@doStepCake,
 			@doStepSeduction,
-			@doStepBomb
+			@doStepBomb,
+			@doStepCluster
 			);
 
 procedure InsertGearToList(Gear: PGear);
@@ -1084,7 +1085,9 @@
           gtCake: if Gear^.Pos = 6 then
                      DrawRotatedf(sprCakeWalk, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle + hwSign(Gear^.dX) * 90)
                   else
-                     DrawRotatedf(sprCakeDown, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 5 - Gear^.Pos, hwSign(Gear^.dX), 0)
+                     DrawRotatedf(sprCakeDown, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 5 - Gear^.Pos, hwSign(Gear^.dX), 0);
+      gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle);
+      gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle);
               end;
       Gear:= Gear^.NextGear
       end;
Binary file share/hedgewars/Data/Graphics/Watermelon.png has changed