hedgewars/uGearsHedgehog.pas
changeset 7373 d5ec4e4eb2d5
parent 7347 88685fbb2679
parent 7362 53bcfc714cb3
child 7390 27bfd8bbde7e
equal deleted inserted replaced
7371:911b53e8c00a 7373:d5ec4e4eb2d5
   955             Gear^.dX:= -Gear^.Elasticity * Gear^.dX
   955             Gear^.dX:= -Gear^.Elasticity * Gear^.dX
   956         else
   956         else
   957             SetLittle(Gear^.dX);
   957             SetLittle(Gear^.dX);
   958 
   958 
   959 if (not isFalling)
   959 if (not isFalling)
   960 and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
   960   and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
   961     begin
   961     begin
   962     Gear^.State:= Gear^.State and (not gstWinner);
   962     Gear^.State:= Gear^.State and (not gstWinner);
   963     Gear^.State:= Gear^.State and (not gstMoving);
   963     Gear^.State:= Gear^.State and (not gstMoving);
   964     while TestCollisionYWithGear(Gear,1) = 0 do
   964     while (TestCollisionYWithGear(Gear,1) = 0) and not CheckGearDrowning(Gear) do
   965         Gear^.Y:= Gear^.Y+_1;
   965         Gear^.Y:= Gear^.Y+_1;
   966     SetLittle(Gear^.dX);
   966     SetLittle(Gear^.dX);
   967     Gear^.dY:= _0
   967     Gear^.dY:= _0
   968     end
   968     end
   969 else
   969 else