Engine:
authorsmaxx
Mon, 02 Aug 2010 00:48:15 +0200
changeset 3704 ed2b9c7fb260
parent 3702 6c90190908b6
child 3706 a79784328c03
Engine: * Added falling notes to Piano Strike (looks funny and chaotic - prefer flying instead?) Graphics: * Removed the Underwater chunk as it's 100% transparent anyway CMake: * Changed NSIS Project name to be "Hedgewars" to shorten the Windows start menu entry and similar labels
CMakeLists.txt
hedgewars/GSHandlers.inc
hedgewars/VGSHandlers.inc
hedgewars/uConsts.pas
hedgewars/uVisualGears.pas
share/hedgewars/Data/Graphics/Note.png
share/hedgewars/Data/Themes/Underwater/Chunk.png
--- a/CMakeLists.txt	Sun Aug 01 22:08:07 2010 +0200
+++ b/CMakeLists.txt	Mon Aug 02 00:48:15 2010 +0200
@@ -205,7 +205,7 @@
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${HEDGEWARS_VERSION}")
 
 if(WIN32 AND NOT UNIX)
-	set(CPACK_NSIS_DISPLAY_NAME ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+	set(CPACK_NSIS_DISPLAY_NAME "Hedgewars")
 	set(CPACK_NSIS_HELP_LINK "http://www.hedgewars.org/")
 	set(CPACK_NSIS_URL_INFO_ABOUT "http://www.hedgewars.org/")
 	set(CPACK_NSIS_CONTACT "unC0Rr@gmail.com")
--- a/hedgewars/GSHandlers.inc	Sun Aug 01 22:08:07 2010 +0200
+++ b/hedgewars/GSHandlers.inc	Mon Aug 02 00:48:15 2010 +0200
@@ -3547,6 +3547,7 @@
             7: PlaySound(sndPiano7);
             else PlaySound(sndPiano8);
         end;
+        AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
         CurrentHedgehog^.Gear^.MsgParam := 0;
         CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gm_Slot;
     end;
@@ -3593,6 +3594,8 @@
             doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, 0);
             doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, 0);
             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
+            for r0:= 0 to 10 do
+                AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
             Gear^.dY := -_1;
             Gear^.Pos := Gear^.Pos + 1;
         end
--- a/hedgewars/VGSHandlers.inc	Sun Aug 01 22:08:07 2010 +0200
+++ b/hedgewars/VGSHandlers.inc	Mon Aug 02 00:48:15 2010 +0200
@@ -109,6 +109,22 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
+procedure doStepNote(Gear: PVisualGear; Steps: Longword);
+begin
+Gear^.X:= Gear^.X + Gear^.dX * Steps;
+
+Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+Gear^.dY:= Gear^.dY + cGravityf * Steps;
+
+Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle;
+
+if Gear^.FrameTicks <= Steps then
+    DeleteVisualGear(Gear)
+else
+    dec(Gear^.FrameTicks, Steps)
+end;
+
+////////////////////////////////////////////////////////////////////////////////
 procedure doStepEgg(Gear: PVisualGear; Steps: Longword);
 begin
 Gear^.X:= Gear^.X + Gear^.dX * Steps;
--- a/hedgewars/uConsts.pas	Sun Aug 01 22:08:07 2010 +0200
+++ b/hedgewars/uConsts.pas	Mon Aug 02 00:48:15 2010 +0200
@@ -73,7 +73,7 @@
             sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
             sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee,
             sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
-            sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk
+            sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote
             );
 
     // Gears that interact with other Gears and/or Land
@@ -94,7 +94,7 @@
             vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
             vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
             vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
-            vgtBigExplosion, vgtChunk);
+            vgtBigExplosion, vgtChunk, vgtNote);
 
     TGearsType = set of TGearType;
 
@@ -799,7 +799,9 @@
             (FileName:  'amFlamethrower'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandFlamethrower
             (FileName:  'Chunk'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil;
-            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true) // sprChunk
+            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprChunk
+            (FileName:  'Note'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true) // sprNote
             );
 
     Wavez: array [TWave] of record
--- a/hedgewars/uVisualGears.pas	Sun Aug 01 22:08:07 2010 +0200
+++ b/hedgewars/uVisualGears.pas	Mon Aug 02 00:48:15 2010 +0200
@@ -116,7 +116,8 @@
             @doStepSmokeTrace,
             @doStepExplosion,
             @doStepBigExplosion,
-            @doStepChunk
+            @doStepChunk,
+            @doStepNote
         );
 
 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
@@ -139,7 +140,8 @@
     vgtHealthTag,
     vgtExplosion,
     vgtSmokeTrace,
-    vgtEvilTrace]) then
+    vgtEvilTrace,
+    vgtNote]) then
     begin
       AddVisualGear:= nil;
       exit
@@ -309,6 +311,13 @@
                 if random(2) = 0 then dx := -dx;
                 (*if random(2) = 0 then*) dy := -2 * dy;
                 end;
+      vgtNote: begin
+                dx:= 0.005 * (random(15) + 10);
+                dy:= 0.001 * (random(40) + 20);
+                if random(2) = 0 then dx := -dx;
+                Frame:= random(4);
+                FrameTicks:= random(2000) + 1500;
+                end;
         end;
 
 if State <> 0 then gear^.State:= State;
@@ -466,6 +475,7 @@
                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
                             end;
                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                 vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
             end;
         case Gear^.Kind of
             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
Binary file share/hedgewars/Data/Graphics/Note.png has changed
Binary file share/hedgewars/Data/Themes/Underwater/Chunk.png has changed