hedgewars/uGears.pas
changeset 3350 5cd02aafc612
parent 3342 b4f01613dcd7
child 3355 dc9e61e67484
equal deleted inserted replaced
3349:5571592f10a8 3350:5cd02aafc612
   182             @doStepCase,
   182             @doStepCase,
   183             @doStepBirdy,
   183             @doStepBirdy,
   184             @doStepBigExplosion,
   184             @doStepBigExplosion,
   185             @doStepEggWork,
   185             @doStepEggWork,
   186             @doStepPortal,
   186             @doStepPortal,
   187             @doStepPortalGun
   187             @doStepPortalGun,
       
   188             @doStepPiano
   188             );
   189             );
   189 
   190 
   190 procedure InsertGearToList(Gear: PGear);
   191 procedure InsertGearToList(Gear: PGear);
   191 var tmp, ptmp: PGear;
   192 var tmp, ptmp: PGear;
   192 begin
   193 begin
   473       gtPortal: begin
   474       gtPortal: begin
   474                 gear^.ImpactSound:= sndMelonImpact;
   475                 gear^.ImpactSound:= sndMelonImpact;
   475                 gear^.nImpactSounds:= 1;
   476                 gear^.nImpactSounds:= 1;
   476                 gear^.AdvBounce:= 0;
   477                 gear^.AdvBounce:= 0;
   477                 gear^.Radius:= 16;
   478                 gear^.Radius:= 16;
       
   479                 end;
       
   480        gtPiano: begin
       
   481                 gear^.Radius:= 32
   478                 end;
   482                 end;
   479      end;
   483      end;
   480 InsertGearToList(gear);
   484 InsertGearToList(gear);
   481 AddGear:= gear;
   485 AddGear:= gear;
   482 
   486 
  1776                     glColor4f(1, 1, 1, -1.0 * (power(Gear^.Timer/250, 4) - 1));
  1780                     glColor4f(1, 1, 1, -1.0 * (power(Gear^.Timer/250, 4) - 1));
  1777                     DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
  1781                     DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
  1778                     glColor4f(1, 1, 1, 1);
  1782                     glColor4f(1, 1, 1, 1);
  1779                     end;
  1783                     end;
  1780              gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 16, 16, Gear^.DirAngle);
  1784              gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 16, 16, Gear^.DirAngle);
       
  1785            gtPiano: begin
       
  1786                     if (Gear^.State and gstDrowning) = 0 then
       
  1787                         begin
       
  1788                         glColor4f(1, 1, 1, 0.0625);
       
  1789                         for i:= 8 downto 1 do
       
  1790                             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);
       
  1791                         glColor4f(1, 1, 1, 1)
       
  1792                         end;
       
  1793                     DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 128, 128, 0);
       
  1794                     end;
  1781          end;
  1795          end;
  1782       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
  1796       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
  1783       Gear:= Gear^.NextGear
  1797       Gear:= Gear^.NextGear
  1784       end;
  1798       end;
  1785 end;
  1799 end;