hedgewars/GSHandlers.inc
branch0.9.19
changeset 8924 13ac59499066
parent 8900 b77fd3c2eec5
parent 8906 82756a90a343
child 8934 a4ec39eac0be
equal deleted inserted replaced
8904:6ea838b8dcd5 8924:13ac59499066
   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;