hedgewars/VGSHandlers.inc
changeset 4379 6cd6b77df8b8
parent 4365 4f2b1a152979
child 4420 6be946bcd17a
equal deleted inserted replaced
4378:91655618a510 4379:6cd6b77df8b8
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
    18 procedure doStepFlake(Gear: PVisualGear; Steps: Longword);
    18 procedure doStepFlake(Gear: PVisualGear; Steps: Longword);
    19 var sign: float;
    19 var sign: real;
    20 begin
    20 begin
    21 if vobCount = 0 then exit;
    21 if vobCount = 0 then exit;
    22 
    22 
    23 sign:= 1;
    23 sign:= 1;
    24 with Gear^ do
    24 with Gear^ do
    57         end
    57         end
    58     else
    58     else
    59         begin
    59         begin
    60         if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else
    60         if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else
    61         if round(X) > cRightScreenBorder then X:= X - cScreenSpace;
    61         if round(X) > cRightScreenBorder then X:= X - cScreenSpace;
    62         // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + float(25); // For if flag is set for flakes rising upwards?
    62         // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
    63         if round(Y) - 75 > LAND_HEIGHT then Y:= Y - float(1024 + 150); // TODO - configure in theme (jellies for example could use limited range)
    63         if round(Y) - 75 > LAND_HEIGHT then Y:= Y - (1024 + 150); // TODO - configure in theme (jellies for example could use limited range)
    64         Timer:= 0;
    64         Timer:= 0;
    65         tdX:= 0;
    65         tdX:= 0;
    66         tdY:= 0
    66         tdY:= 0
    67         end;
    67         end;
    68     end;
    68     end;
    79 end;
    79 end;
    80 
    80 
    81 ////////////////////////////////////////////////////////////////////////////////
    81 ////////////////////////////////////////////////////////////////////////////////
    82 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
    82 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
    83 var s: Longword;
    83 var s: Longword;
    84     t: float;
    84     t: real;
    85 begin
    85 begin
    86 Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX) * Steps;
    86 Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX) * Steps;
    87 
    87 
    88 // up-and-down-bounce magic
    88 // up-and-down-bounce magic
    89 s := (GameTicks + Gear^.Timer) mod 4096;
    89 s := (GameTicks + Gear^.Timer) mod 4096;
   477     3: Gear^.FrameTicks:= SpritesData[sprShoutTail].Width-10;
   477     3: Gear^.FrameTicks:= SpritesData[sprShoutTail].Width-10;
   478     end;
   478     end;
   479 
   479 
   480 Gear^.doStep:= @doStepSpeechBubbleWork;
   480 Gear^.doStep:= @doStepSpeechBubbleWork;
   481 
   481 
   482 Gear^.Y:= Gear^.Y - float(Gear^.Tex^.h)
   482 Gear^.Y:= Gear^.Y - Gear^.Tex^.h
   483 end;
   483 end;
   484 
   484 
   485 ////////////////////////////////////////////////////////////////////////////////
   485 ////////////////////////////////////////////////////////////////////////////////
   486 procedure doStepHealthTagWork(Gear: PVisualGear; Steps: Longword);
   486 procedure doStepHealthTagWork(Gear: PVisualGear; Steps: Longword);
   487 begin
   487 begin
   519 if round(Gear^.Y) < cWaterLine then
   519 if round(Gear^.Y) < cWaterLine then
   520     Gear^.doStep:= @doStepHealthTagWork
   520     Gear^.doStep:= @doStepHealthTagWork
   521 else
   521 else
   522     Gear^.doStep:= @doStepHealthTagWorkUnderWater;
   522     Gear^.doStep:= @doStepHealthTagWorkUnderWater;
   523 
   523 
   524 Gear^.Y:= Gear^.Y - float(Gear^.Tex^.h);
   524 Gear^.Y:= Gear^.Y - Gear^.Tex^.h;
   525 
   525 
   526 if Steps > 1 then Gear^.doStep(Gear, Steps-1);
   526 if Steps > 1 then Gear^.doStep(Gear, Steps-1);
   527 end;
   527 end;
   528 
   528 
   529 ////////////////////////////////////////////////////////////////////////////////
   529 ////////////////////////////////////////////////////////////////////////////////