hedgewars/uGearsHedgehog.pas
changeset 7194 d8e68cbca7ee
parent 7180 53ffc8853008
parent 7187 aff30d80bd7b
child 7278 000e4543f204
equal deleted inserted replaced
7180:53ffc8853008 7194:d8e68cbca7ee
   705 
   705 
   706     PrevdX:= hwSign(Gear^.dX);
   706     PrevdX:= hwSign(Gear^.dX);
   707     if (Gear^.Message and gmLeft  )<>0 then
   707     if (Gear^.Message and gmLeft  )<>0 then
   708         Gear^.dX:= -cLittle else
   708         Gear^.dX:= -cLittle else
   709     if (Gear^.Message and gmRight )<>0 then
   709     if (Gear^.Message and gmRight )<>0 then
   710         Gear^.dX:=  cLittle else exit;
   710         Gear^.dX:=  cLittle 
   711 
   711         else exit;
   712     if (Gear^.Message and (gmLeft or gmRight)) <> 0 then
   712 
   713         begin
   713     StepSoundTimer:= cHHStepTicks;
   714         StepSoundTimer:= cHHStepTicks;
       
   715         end;
       
   716    
   714    
   717     GHStepTicks:= cHHStepTicks;
   715     GHStepTicks:= cHHStepTicks;
   718     if PrevdX <> hwSign(Gear^.dX) then
   716     if PrevdX <> hwSign(Gear^.dX) then
   719         begin
   717         begin
   720         FollowGear:= Gear;
   718         FollowGear:= Gear;
   835         Gear^.dY:= _0;
   833         Gear^.dY:= _0;
   836     Gear^.State:= Gear^.State or gstMoving;
   834     Gear^.State:= Gear^.State or gstMoving;
   837     if (CurrentHedgehog^.Gear = Gear)
   835     if (CurrentHedgehog^.Gear = Gear)
   838         and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then 
   836         and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then 
   839         begin
   837         begin
       
   838         // TODO: why so aggressive at setting FollowGear when falling?
   840         FollowGear:= Gear;
   839         FollowGear:= Gear;
   841         end;
   840         end;
   842     if isUnderwater then
   841     if isUnderwater then
   843        Gear^.dY:= Gear^.dY + cGravity / _2
   842        Gear^.dY:= Gear^.dY + cGravity / _2
   844     else
   843     else