hedgewars/uGearsHandlersRope.pas
changeset 8462 19b1de9423ab
parent 8397 5b273af3ac95
child 8468 71159aa7172f
equal deleted inserted replaced
8460:75e771c3c039 8462:19b1de9423ab
   162     /////
   162     /////
   163     tx := HHGear^.X;
   163     tx := HHGear^.X;
   164     ty := HHGear^.Y;
   164     ty := HHGear^.Y;
   165 
   165 
   166     if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
   166     if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
   167         if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
   167         if not (TestCollisionXwithXYShift(HHGear, _0, -1, hwSign(ropeDx))
   168         or (TestCollisionYwithGear(HHGear, hwSign(ropeDy)) <> 0)) then
   168         or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, hwSign(ropeDy)))) then
   169             Gear^.Elasticity := Gear^.Elasticity + _1_2;
   169             Gear^.Elasticity := Gear^.Elasticity + _1_2;
   170 
   170 
   171     if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
   171     if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
   172         if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
   172         if not (TestCollisionXwithXYShift(HHGear, _0, -1, -hwSign(ropeDx))
   173         or (TestCollisionYwithGear(HHGear, -hwSign(ropeDy)) <> 0)) then
   173         or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, -hwSign(ropeDy)))) then
   174             Gear^.Elasticity := Gear^.Elasticity - _1_2;
   174             Gear^.Elasticity := Gear^.Elasticity - _1_2;
   175 
   175 
   176     HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;
   176     HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;
   177     HHGear^.Y := Gear^.Y + mdY * Gear^.Elasticity;
   177     HHGear^.Y := Gear^.Y + mdY * Gear^.Elasticity;
   178 
   178