hedgewars/uVisualGears.pas
changeset 3062 62eb6095497b
parent 3045 41732f986b4f
child 3080 b7fa8ad60e3b
equal deleted inserted replaced
3061:e129e4c3f30e 3062:62eb6095497b
   101         end;
   101         end;
   102     X:= X + (cWindSpeed * 200 + dX + tdX) * Steps;
   102     X:= X + (cWindSpeed * 200 + dX + tdX) * Steps;
   103     Y:= Y + (dY + tdY + cGravity * vobFallSpeed) * Steps;
   103     Y:= Y + (dY + tdY + cGravity * vobFallSpeed) * Steps;
   104     Angle:= Angle + dAngle * Steps;
   104     Angle:= Angle + dAngle * Steps;
   105   
   105   
   106     if hwRound(X) < -cScreenWidth - 64 then X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else
   106     if (hwRound(X) >= -cScreenWidth - 64) and
   107     if hwRound(X) > cScreenWidth + LAND_WIDTH then X:= int2hwFloat(-cScreenWidth - 64);
   107        (hwRound(X) <= cScreenWidth + LAND_WIDTH) and
   108     // if hwRound(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + int2hwFloat(25); // For if flag is set for flakes rising upwards?
   108        (hwRound(Y) <= (LAND_HEIGHT + 75)) and 
   109     if hwRound(Y) > (LAND_HEIGHT + 75) then Y:= Y - int2hwFloat(1024 + 150); // TODO - configure in theme (jellies for example could use limited range)
   109        (Timer > 0) and (Timer-Steps > 0) then
   110     if (Timer > 0) and (Timer-Steps > 0) then
       
   111         begin
   110         begin
   112         tdX:= tdX - _0_005*Steps;
   111         tdX:= tdX - _0_005*Steps;
   113         tdY:= tdY - _0_005*Steps;
   112         tdY:= tdY - _0_005*Steps;
   114         if tdX < _0 then tdX:= _0;
   113         if tdX < _0 then tdX:= _0;
   115         if tdY < _0 then tdY:= _0;
   114         if tdY < _0 then tdY:= _0;
   116         dec(Timer, Steps)
   115         dec(Timer, Steps)
   117         end
   116         end
   118     else
   117     else
   119         begin
   118         begin
       
   119         if hwRound(X) < -cScreenWidth - 64 then X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else
       
   120         if hwRound(X) > cScreenWidth + LAND_WIDTH then X:= int2hwFloat(-cScreenWidth - 64);
       
   121         // if hwRound(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + int2hwFloat(25); // For if flag is set for flakes rising upwards?
       
   122         if hwRound(Y) > (LAND_HEIGHT + 75) then Y:= Y - int2hwFloat(1024 + 150); // TODO - configure in theme (jellies for example could use limited range)
   120         Timer:= 0;
   123         Timer:= 0;
   121         tdX:= _0;
   124         tdX:= _0;
   122         tdY:= _0
   125         tdY:= _0
   123         end;
   126         end;
   124     end;
   127     end;