hedgewars/uVisualGearsHandlers.pas
branch0.9.21
changeset 10731 bc359abe0484
parent 10625 125e120165aa
child 10858 bd281e854e02
equal deleted inserted replaced
10729:28d5cebdf660 10731:bc359abe0484
   123             Angle:= Angle + 360;
   123             Angle:= Angle + 360;
   124 
   124 
   125 
   125 
   126     if (round(X) >= cLeftScreenBorder)
   126     if (round(X) >= cLeftScreenBorder)
   127     and (round(X) <= cRightScreenBorder)
   127     and (round(X) <= cRightScreenBorder)
   128     and (round(Y) - 75 <= LAND_HEIGHT)
   128     and (round(Y) - 250 <= LAND_HEIGHT)
   129     and (Timer > 0) and (Timer-Steps > 0) then
   129     and (Timer > 0) and (Timer-Steps > 0) then
   130         begin
   130         begin
   131         if tdX > 0 then
   131         if tdX > 0 then
   132             sign := 1
   132             sign := 1
   133         else
   133         else
   150         if round(X) < cLeftScreenBorder then
   150         if round(X) < cLeftScreenBorder then
   151             begin
   151             begin
   152             X:= X + cScreenSpace;
   152             X:= X + cScreenSpace;
   153             moved:= true
   153             moved:= true
   154             end
   154             end
   155         else
   155         else if round(X) > cRightScreenBorder then
   156             if round(X) > cRightScreenBorder then
   156             begin
   157                 begin
   157             X:= X - cScreenSpace;
   158                 X:= X - cScreenSpace;
   158             moved:= true
   159                 moved:= true
   159             end;
   160                 end;
       
   161             // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
   160             // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
   162         if (Gear^.Layer = 2) and (round(Y) - 225 > LAND_HEIGHT) then
   161         if (Gear^.Layer = 2) and (round(Y) - 400 > LAND_HEIGHT) and (cGravityf >= 0) then
   163             begin
   162             begin
   164             X:= cLeftScreenBorder + random(cScreenSpace);
   163             X:= cLeftScreenBorder + random(cScreenSpace);
   165             Y:= Y - (1024 + 250 + random(50)); // TODO - configure in theme (jellies for example could use limited range)
   164             Y:= Y-(1024 + 400 + random(50)); // TODO - configure in theme (jellies for example could use limited range)
   166             moved:= true
   165             moved:= true
   167             end
   166             end
   168         else if (Gear^.Layer <> 2) and (round(Y) + 50 > LAND_HEIGHT) then
   167         else if (Gear^.Layer <> 2) and (round(Y) - 150 > LAND_HEIGHT) and (cGravityf >= 0) then
   169             begin
   168             begin
   170             X:= cLeftScreenBorder + random(cScreenSpace);
   169             X:= cLeftScreenBorder + random(cScreenSpace);
   171             Y:= Y - (1024 + random(25));
   170             Y:= Y-(1024 + 200 + random(50));
       
   171             moved:= true
       
   172             end
       
   173         else if (round(Y) < LAND_HEIGHT-1200) and (cGravityf < 0) then // gravity can make flakes move upwards
       
   174             begin
       
   175             X:= cLeftScreenBorder + random(cScreenSpace);
       
   176             if Gear^.Layer = 2 then
       
   177                 Y:= Y+(1024 + 150 + random(100))
       
   178             else
       
   179                 Y:= Y+(1024 + random(50));
   172             moved:= true
   180             moved:= true
   173             end;
   181             end;
   174         if moved then
   182         if moved then
   175             begin
   183             begin
   176             Angle:= random(360);
   184             Angle:= random(360);