hedgewars/VGSHandlers.inc
changeset 3985 57121975b64b
parent 3976 abaf741a4e21
child 3994 486da687d76a
equal deleted inserted replaced
3974:91ac041ecb20 3985:57121975b64b
    34     Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps;
    34     Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps;
    35     Angle:= Angle + dAngle * Steps;
    35     Angle:= Angle + dAngle * Steps;
    36   
    36   
    37     if (round(X) >= cLeftScreenBorder) and
    37     if (round(X) >= cLeftScreenBorder) and
    38        (round(X) <= cRightScreenBorder) and
    38        (round(X) <= cRightScreenBorder) and
    39        (round(Y) <= (LAND_HEIGHT + 75)) and 
    39        (round(Y) <= (int64(LAND_HEIGHT) + 75)) and
    40        (Timer > 0) and (Timer-Steps > 0) then
    40        (Timer > 0) and (Timer-Steps > 0) then
    41         begin
    41         begin
    42         if tdX > 0 then sign := 1
    42         if tdX > 0 then sign := 1
    43         else sign:= -1;
    43         else sign:= -1;
    44         tdX:= tdX - 0.005*Steps*sign;
    44         tdX:= tdX - 0.005*Steps*sign;
    52     else
    52     else
    53         begin
    53         begin
    54         if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else
    54         if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else
    55         if round(X) > cRightScreenBorder then X:= X - cScreenSpace;
    55         if round(X) > cRightScreenBorder then X:= X - cScreenSpace;
    56         // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + float(25); // For if flag is set for flakes rising upwards?
    56         // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + float(25); // For if flag is set for flakes rising upwards?
    57         if round(Y) > (LAND_HEIGHT + 75) then Y:= Y - float(1024 + 150); // TODO - configure in theme (jellies for example could use limited range)
    57         if round(Y) > (int64(LAND_HEIGHT) + 75) then Y:= Y - float(1024 + 150); // TODO - configure in theme (jellies for example could use limited range)
    58         Timer:= 0;
    58         Timer:= 0;
    59         tdX:= 0;
    59         tdX:= 0;
    60         tdY:= 0
    60         tdY:= 0
    61         end;
    61         end;
    62     end;
    62     end;
    82 // up-and-down-bounce magic
    82 // up-and-down-bounce magic
    83 s := (GameTicks + Gear^.Timer) mod 4096;
    83 s := (GameTicks + Gear^.Timer) mod 4096;
    84 t := 8 * AngleSin(s mod 2048).QWordValue / 4294967296;
    84 t := 8 * AngleSin(s mod 2048).QWordValue / 4294967296;
    85 if (s < 2048) then t := -t;
    85 if (s < 2048) then t := -t;
    86 
    86 
    87 Gear^.Y := LAND_HEIGHT-1184 + Gear^.Timer mod 8 + t;
    87 Gear^.Y := int64(LAND_HEIGHT) - 1184 + Gear^.Timer mod 8 + t;
    88 
    88 
    89 if round(Gear^.X) < cLeftScreenBorder then Gear^.X:= Gear^.X + cScreenSpace else
    89 if round(Gear^.X) < cLeftScreenBorder then Gear^.X:= Gear^.X + cScreenSpace else
    90 if round(Gear^.X) > cRightScreenBorder then Gear^.X:= Gear^.X - cScreenSpace
    90 if round(Gear^.X) > cRightScreenBorder then Gear^.X:= Gear^.X - cScreenSpace
    91 end;
    91 end;
    92 
    92 
   478     end;
   478     end;
   479 end;
   479 end;
   480 
   480 
   481 procedure doStepHealthTagWorkUnderWater(Gear: PVisualGear; Steps: Longword);
   481 procedure doStepHealthTagWorkUnderWater(Gear: PVisualGear; Steps: Longword);
   482 begin
   482 begin
   483 if round(Gear^.Y) < cWaterLine + 10 then
   483 if round(Gear^.Y) < int64(cWaterLine) + 10 then
   484     DeleteVisualGear(Gear)
   484     DeleteVisualGear(Gear)
   485 else
   485 else
   486     Gear^.Y:= Gear^.Y - 0.08 * Steps;
   486     Gear^.Y:= Gear^.Y - 0.08 * Steps;
   487 
   487 
   488 end;
   488 end;