hedgewars/GSHandlers.inc
changeset 3002 9bf51d5a8a80
parent 3001 a1d1e0d0067a
child 3004 e9b3613cc3fb
equal deleted inserted replaced
3001:a1d1e0d0067a 3002:9bf51d5a8a80
   204     Gear^.dY:=   Gear^.dY * Gear^.Elasticity;
   204     Gear^.dY:=   Gear^.dY * Gear^.Elasticity;
   205     Gear^.State:= Gear^.State or gstCollision
   205     Gear^.State:= Gear^.State or gstCollision
   206     end 
   206     end 
   207 else if Gear^.AdvBounce and TestCollisionXwithGear(Gear, -hwSign(Gear^.dX)) then collH:= -hwSign(Gear^.dX);
   207 else if Gear^.AdvBounce and TestCollisionXwithGear(Gear, -hwSign(Gear^.dX)) then collH:= -hwSign(Gear^.dX);
   208 
   208 
   209 if (collV <>0) and (collH <> 0) and Gear^.AdvBounce then
   209 if (collV <>0) and (collH <> 0) and (hwSqr(tdX) + hwSqr(tdY) > _0_08) and Gear^.AdvBounce then
   210     begin
   210     begin
   211     Gear^.dX:= tdY*Gear^.Elasticity*Gear^.Friction;
   211     Gear^.dX:= tdY*Gear^.Elasticity*Gear^.Friction;
   212     Gear^.dY:= tdX*Gear^.Elasticity*Gear^.Friction;
   212     Gear^.dY:= tdX*Gear^.Elasticity;//*Gear^.Friction;
   213     if ((collV > 0) and (collH > 0)) or ((collV < 0) and (collH < 0)) then Gear^.dX.isNegative:=not tdY.isNegative
   213     if ((collV > 0) and (collH > 0)) or ((collV < 0) and (collH < 0)) then Gear^.dX.isNegative:=not tdY.isNegative
   214     else if (collV < 0) and (collH > 0) then Gear^.dY.isNegative:= not tdX.isNegative;
   214     else if (collV < 0) and (collH > 0) then Gear^.dY.isNegative:= not tdX.isNegative;
       
   215     isFalling:= false;
   215 
   216 
   216     //tmp:= Gear^.dX.QWordValue;
   217     //tmp:= Gear^.dX.QWordValue;
   217     //Gear^.dX.QWordValue:= Gear^.dY.QWordValue;
   218     //Gear^.dX.QWordValue:= Gear^.dY.QWordValue;
   218     //Gear^.dY.QWordValue:= tmp;
   219     //Gear^.dY.QWordValue:= tmp;
   219     end;
   220     end;