hedgewars/uGearsHedgehog.pas
changeset 7426 55b49cc1f33a
parent 7409 fd91aa100ce0
child 7442 9bb6abdb5675
child 7459 8511a3f899d3
equal deleted inserted replaced
7423:ec8f690f3e0f 7426:55b49cc1f33a
   851     Gear^.dY:= _0;
   851     Gear^.dY:= _0;
   852     Gear^.dX:= _0;
   852     Gear^.dX:= _0;
   853     Gear^.State:= Gear^.State and (not gstMoving);
   853     Gear^.State:= Gear^.State and (not gstMoving);
   854     exit
   854     exit
   855     end;
   855     end;
   856 isFalling:= (Gear^.dY.isNegative) or not TestCollisionYKick(Gear, 1);
   856 isFalling:= (Gear^.dY.isNegative) or (not TestCollisionYKick(Gear, 1));
   857 if isFalling then
   857 if isFalling then
   858     begin
   858     begin
   859     if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then
   859     if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then
   860         Gear^.dY:= _0;
   860         Gear^.dY:= _0;
   861     Gear^.State:= Gear^.State or gstMoving;
   861     Gear^.State:= Gear^.State or gstMoving;
   981 if (not isFalling)
   981 if (not isFalling)
   982   and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
   982   and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
   983     begin
   983     begin
   984     Gear^.State:= Gear^.State and (not gstWinner);
   984     Gear^.State:= Gear^.State and (not gstWinner);
   985     Gear^.State:= Gear^.State and (not gstMoving);
   985     Gear^.State:= Gear^.State and (not gstMoving);
   986     while (TestCollisionYWithGear(Gear,1) = 0) and not CheckGearDrowning(Gear) do
   986     while (TestCollisionYWithGear(Gear,1) = 0) and (not CheckGearDrowning(Gear)) do
   987         Gear^.Y:= Gear^.Y+_1;
   987         Gear^.Y:= Gear^.Y+_1;
   988     SetLittle(Gear^.dX);
   988     SetLittle(Gear^.dX);
   989     Gear^.dY:= _0
   989     Gear^.dY:= _0
   990     end
   990     end
   991 else
   991 else