hedgewars/GSHandlers.inc
changeset 8906 82756a90a343
parent 8838 aa2ffd427f6a
child 8924 13ac59499066
equal deleted inserted replaced
8905:82b1400f4a08 8906:82756a90a343
   415 
   415 
   416     doStepFallingGear(Gear);
   416     doStepFallingGear(Gear);
   417     CalcRotationDirAngle(Gear);
   417     CalcRotationDirAngle(Gear);
   418 
   418 
   419     // let's add some smoke depending on speed
   419     // let's add some smoke depending on speed
   420     s:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120))+random(10);
   420     s:= max(32,152 - round((abs(hwFloat2FLoat(Gear^.dX))+abs(hwFloat2Float(Gear^.dY)))*120))+random(10);
   421     if (GameTicks mod s) = 0 then
   421     if (GameTicks mod s) = 0 then
   422         begin
   422         begin
   423         // adjust angle to match the texture
   423         // adjust angle to match the texture
   424         if Gear^.dX.isNegative then
   424         if Gear^.dX.isNegative then
   425             i:= 130
   425              i:= 130
   426         else
   426         else i:= 50;
   427             i:= 50;
       
   428 
   427 
   429         smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+i) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+i) * pi / 180)*20), vgtSmoke);
   428         smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+i) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+i) * pi / 180)*20), vgtSmoke);
   430         if smoke <> nil then
   429         if smoke <> nil then
   431             smoke^.Scale:= 0.75;
   430             smoke^.Scale:= 0.75;
   432         end;
   431         end;