hedgewars/uGears.pas
changeset 3065 4afa5e3e27e4
parent 3054 3b6b57d8b7cd
child 3072 b18038b3a0f4
equal deleted inserted replaced
3064:7458ec3666c3 3065:4afa5e3e27e4
   181             @doStepSniperRifleShot,
   181             @doStepSniperRifleShot,
   182             @doStepJetpack,
   182             @doStepJetpack,
   183             @doStepMolotov,
   183             @doStepMolotov,
   184             @doStepCase,
   184             @doStepCase,
   185             @doStepBirdy,
   185             @doStepBirdy,
   186             @doStepBigExplosion
   186             @doStepBigExplosion,
       
   187 			@doStepEggWork
   187             );
   188             );
   188 
   189 
   189 procedure InsertGearToList(Gear: PGear);
   190 procedure InsertGearToList(Gear: PGear);
   190 var tmp, ptmp: PGear;
   191 var tmp, ptmp: PGear;
   191 begin
   192 begin
   441                 gear^.Radius:= 6;
   442                 gear^.Radius:= 6;
   442                 end;
   443                 end;
   443        gtBirdy: begin
   444        gtBirdy: begin
   444                 gear^.Radius:= 16; // todo: check
   445                 gear^.Radius:= 16; // todo: check
   445                 gear^.Timer:= 500;
   446                 gear^.Timer:= 500;
   446                 gear^.Health:= 2000;
   447 				gear^.Health := 2000;
       
   448                 gear^.FlightTime := 2;
   447                 end;
   449                 end;
   448 gtBigExplosion: begin
   450 gtBigExplosion: begin
   449                 gear^.X:= gear^.X;
   451                 gear^.X:= gear^.X;
   450                 gear^.Y:= gear^.Y;
   452                 gear^.Y:= gear^.Y;
   451                 gear^.Angle:= random(360);
   453                 gear^.Angle:= random(360);
       
   454                 end;
       
   455 		 gtEgg: begin 
       
   456                 gear^.AdvBounce:= true;
       
   457                 gear^.Radius:= 4;
       
   458                 gear^.Elasticity:= _0_6;
       
   459                 gear^.Friction:= _0_96;
       
   460                 gear^.RenderTimer:= true;
       
   461                 if gear^.Timer = 0 then gear^.Timer:= 3000
   452                 end;
   462                 end;
   453      end;
   463      end;
   454 InsertGearToList(gear);
   464 InsertGearToList(gear);
   455 AddGear:= gear;
   465 AddGear:= gear;
   456 
   466 
  1671     gtBigExplosion: begin
  1681     gtBigExplosion: begin
  1672                     glColor4f(1, 1, 1, 1.0 * (power(2, -5 * (Gear^.Timer-200)/200)));
  1682                     glColor4f(1, 1, 1, 1.0 * (power(2, -5 * (Gear^.Timer-200)/200)));
  1673                     DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -4 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
  1683                     DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -4 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
  1674                     glColor4f(1, 1, 1, 1);
  1684                     glColor4f(1, 1, 1, 1);
  1675                     end;
  1685                     end;
       
  1686 			   gtEgg: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
  1676          end;
  1687          end;
  1677       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
  1688       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
  1678       Gear:= Gear^.NextGear
  1689       Gear:= Gear^.NextGear
  1679       end;
  1690       end;
  1680 end;
  1691 end;