hedgewars/uGears.pas
changeset 3350 5cd02aafc612
parent 3342 b4f01613dcd7
child 3355 dc9e61e67484
--- a/hedgewars/uGears.pas	Fri Apr 16 16:04:21 2010 +0000
+++ b/hedgewars/uGears.pas	Fri Apr 16 16:04:41 2010 +0000
@@ -184,7 +184,8 @@
             @doStepBigExplosion,
             @doStepEggWork,
             @doStepPortal,
-            @doStepPortalGun
+            @doStepPortalGun,
+            @doStepPiano
             );
 
 procedure InsertGearToList(Gear: PGear);
@@ -476,6 +477,9 @@
                 gear^.AdvBounce:= 0;
                 gear^.Radius:= 16;
                 end;
+       gtPiano: begin
+                gear^.Radius:= 32
+                end;
      end;
 InsertGearToList(gear);
 AddGear:= gear;
@@ -1778,6 +1782,16 @@
                     glColor4f(1, 1, 1, 1);
                     end;
              gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 16, 16, Gear^.DirAngle);
+           gtPiano: begin
+                    if (Gear^.State and gstDrowning) = 0 then
+                        begin
+                        glColor4f(1, 1, 1, 0.0625);
+                        for i:= 8 downto 1 do
+                            DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0);
+                        glColor4f(1, 1, 1, 1)
+                        end;
+                    DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 128, 128, 0);
+                    end;
          end;
       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
       Gear:= Gear^.NextGear