hedgewars/GSHandlers.inc
changeset 5533 cf32b5928cbe
parent 5531 52f4a5d9a222
child 5562 8056d82b4d23
equal deleted inserted replaced
5531:52f4a5d9a222 5533:cf32b5928cbe
  2950     hogs := GearsNear(Gear^.X, Gear^.Y, gtHedgehog, Gear^.Radius);
  2950     hogs := GearsNear(Gear^.X, Gear^.Y, gtHedgehog, Gear^.Radius);
  2951     if Length(hogs) > 0 then
  2951     if Length(hogs) > 0 then
  2952         begin
  2952         begin
  2953         for i:= 0 to High(hogs) do
  2953         for i:= 0 to High(hogs) do
  2954             begin
  2954             begin
  2955             //d:= Distance(Gear^.X - hogs[i]^.X, Gear^.Y - hogs[i]^.Y);
  2955             if hogs[i] <> CurrentHedgehog^.Gear then
  2956             hogs[i]^.dX:= _0_25 * (Gear^.X - hogs[i]^.X) / _250;
  2956                 begin
  2957             //if Gear^.X < hogs[i]^.X then hogs[i]^.dX.isNegative:= true;
  2957                 //d:= Distance(Gear^.X - hogs[i]^.X, Gear^.Y - hogs[i]^.Y);
  2958             hogs[i]^.dY:= -_0_25;
  2958                 hogs[i]^.dX:= _0_25 * (Gear^.X - hogs[i]^.X) / _250;
  2959             hogs[i]^.Active:= true;
  2959                 //if Gear^.X < hogs[i]^.X then hogs[i]^.dX.isNegative:= true;
       
  2960                 hogs[i]^.dY:= -_0_25;
       
  2961                 hogs[i]^.Active:= true;
       
  2962                 end
  2960             end;
  2963             end;
  2961         end ;
  2964         end ;
  2962         AfterAttack;
  2965         AfterAttack;
  2963         DeleteGear(Gear);
  2966         DeleteGear(Gear);
  2964 (*
  2967 (*