hedgewars/GSHandlers.inc
changeset 100 f324a18698fe
parent 95 1ef5e2c41115
child 107 b08ce0293a51
equal deleted inserted replaced
99:fd9613278d1b 100:f324a18698fe
   457 if (Gear.Message and gm_Left  <> 0) then HHGear.dX:= HHGear.dX - 0.0002 else
   457 if (Gear.Message and gm_Left  <> 0) then HHGear.dX:= HHGear.dX - 0.0002 else
   458 if (Gear.Message and gm_Right <> 0) then HHGear.dX:= HHGear.dX + 0.0002;
   458 if (Gear.Message and gm_Right <> 0) then HHGear.dX:= HHGear.dX + 0.0002;
   459 
   459 
   460 if not TestCollisionYwithGear(HHGear, 1) then HHGear.dY:= HHGear.dY + cGravity;
   460 if not TestCollisionYwithGear(HHGear, 1) then HHGear.dY:= HHGear.dY + cGravity;
   461 
   461 
   462 HHGear.DirAngle:= arctan(Gear.dY + HHGear.dY, Gear.dX + HHGear.dX);
   462 HHGear.DirAngle:= arctan2(Gear.dY + HHGear.dY, Gear.dX + HHGear.dX);
   463 cs:= sin(HHGear.DirAngle);
   463 cs:= sin(HHGear.DirAngle);
   464 cc:= cos(HHGear.DirAngle);
   464 cc:= cos(HHGear.DirAngle);
   465 
   465 
   466 flCheck:= not flCheck;
   466 flCheck:= not flCheck;
   467 if flCheck then  // check whether rope needs dividing
   467 if flCheck then  // check whether rope needs dividing
   507          end
   507          end
   508       end;
   508       end;
   509 
   509 
   510 Gear.dX:= HHGear.X - Gear.X;
   510 Gear.dX:= HHGear.X - Gear.X;
   511 Gear.dY:= HHGear.Y - Gear.Y;
   511 Gear.dY:= HHGear.Y - Gear.Y;
   512 HHGear.DirAngle:= arctan(Gear.dY + HHGear.dY, Gear.dX + HHGear.dX);
   512 HHGear.DirAngle:= arctan2(Gear.dY + HHGear.dY, Gear.dX + HHGear.dX);
   513 cs:= sin(HHGear.DirAngle);
   513 cs:= sin(HHGear.DirAngle);
   514 cc:= cos(HHGear.DirAngle);
   514 cc:= cos(HHGear.DirAngle);
   515 
   515 
   516 HHGear.dX:= HHGear.X;
   516 HHGear.dX:= HHGear.X;
   517 HHGear.dY:= HHGear.Y;
   517 HHGear.dY:= HHGear.Y;