# HG changeset patch # User nemo # Date 1269482573 0 # Node ID 62eb6095497b2ffd34473ba263d765cdd9e00f4c # Parent e129e4c3f30ee13b6c104eba9409e33f7a79a50d tweak kick in case of wrapping diff -r e129e4c3f30e -r 62eb6095497b hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Wed Mar 24 23:31:13 2010 +0000 +++ b/hedgewars/uVisualGears.pas Thu Mar 25 02:02:53 2010 +0000 @@ -103,11 +103,10 @@ Y:= Y + (dY + tdY + cGravity * vobFallSpeed) * Steps; Angle:= Angle + dAngle * Steps; - if hwRound(X) < -cScreenWidth - 64 then X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else - if hwRound(X) > cScreenWidth + LAND_WIDTH then X:= int2hwFloat(-cScreenWidth - 64); - // if hwRound(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + int2hwFloat(25); // For if flag is set for flakes rising upwards? - if hwRound(Y) > (LAND_HEIGHT + 75) then Y:= Y - int2hwFloat(1024 + 150); // TODO - configure in theme (jellies for example could use limited range) - if (Timer > 0) and (Timer-Steps > 0) then + if (hwRound(X) >= -cScreenWidth - 64) and + (hwRound(X) <= cScreenWidth + LAND_WIDTH) and + (hwRound(Y) <= (LAND_HEIGHT + 75)) and + (Timer > 0) and (Timer-Steps > 0) then begin tdX:= tdX - _0_005*Steps; tdY:= tdY - _0_005*Steps; @@ -117,6 +116,10 @@ end else begin + if hwRound(X) < -cScreenWidth - 64 then X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else + if hwRound(X) > cScreenWidth + LAND_WIDTH then X:= int2hwFloat(-cScreenWidth - 64); + // if hwRound(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + int2hwFloat(25); // For if flag is set for flakes rising upwards? + if hwRound(Y) > (LAND_HEIGHT + 75) then Y:= Y - int2hwFloat(1024 + 150); // TODO - configure in theme (jellies for example could use limited range) Timer:= 0; tdX:= _0; tdY:= _0