move border back a bit from left/right bounds, bee tweak
authornemo
Mon, 30 Sep 2013 12:37:44 -0400
changeset 9479 167dea42d7d7
parent 9477 0463f747e839
child 9481 fbf61ef67c7b
move border back a bit from left/right bounds, bee tweak
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsList.pas
hedgewars/uGearsUtils.pas
hedgewars/uWorld.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sun Sep 29 19:03:15 2013 -0400
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Sep 30 12:37:44 2013 -0400
@@ -384,8 +384,7 @@
 
     Gear^.X := Gear^.X + Gear^.dX;
     Gear^.Y := Gear^.Y + Gear^.dY;
-    if Gear^.Kind <> gtBee then
-        CheckGearDrowning(Gear);
+    CheckGearDrowning(Gear);
     //if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) < _0_0002) and
     if (not isFalling) and ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_02.QWordValue) then
         Gear^.State := Gear^.State and (not gstMoving)
@@ -969,6 +968,7 @@
         dec(Gear^.Timer)
     else
         begin
+        Gear^.State:= Gear^.State and not gstSubmersible;
         if nuw then
            begin
             StopSoundChan(Gear^.SoundChannel);
@@ -3201,9 +3201,8 @@
     trueAngle: Longword;
     t: PGear;
 begin
-    if WorldWrap(Gear) then
-        begin
-        // recycling as temp vars
+    if WorldWrap(Gear) and (WorldEdge <> weWrap) then
+        begin
         Y.isNegative:= false;
         Y.QWordValue:= 4294967296 * 112;
         X.isNegative:= false;
--- a/hedgewars/uGearsList.pas	Sun Sep 29 19:03:15 2013 -0400
+++ b/hedgewars/uGearsList.pas	Mon Sep 30 12:37:44 2013 -0400
@@ -281,6 +281,7 @@
                 gear^.RenderTimer:= true;
                 gear^.Elasticity:= _0_9;
                 gear^.Tag:= 0;
+                gear^.State:= Gear^.State or gstSubmersible
                 end;
    gtSeduction: begin
                 gear^.Radius:= 250;
--- a/hedgewars/uGearsUtils.pas	Sun Sep 29 19:03:15 2013 -0400
+++ b/hedgewars/uGearsUtils.pas	Mon Sep 30 12:37:44 2013 -0400
@@ -489,7 +489,7 @@
         end
     else
         begin
-        if Gear^.Kind = gtHedgehog then Gear^.State:= Gear^.State and not gstSubmersible;
+        if not (Gear^.Kind in [gtJetpack, gtBee]) then Gear^.State:= Gear^.State and not gstSubmersible;  // making it temporary for most gears is more attractive I think
         CheckGearDrowning := false
         end
 end;
@@ -1224,26 +1224,26 @@
 // for playing around since it isn't hooked up yet
 //WorldEdge:= weBounce;
 if WorldEdge = weNone then exit(false);
-if (hwRound(Gear^.X)-Gear^.Radius < leftX) or
-   (hwRound(Gear^.X)+Gear^.Radius > rightX) then
+if (hwRound(Gear^.X)-Gear^.Radius < (leftX-100)) or
+   (hwRound(Gear^.X)+Gear^.Radius > (rightX+100)) then
     begin
     if WorldEdge = weWrap then
         begin
-        if (hwRound(Gear^.X)-Gear^.Radius < leftX) then
-             Gear^.X:= int2hwfloat(rightX-Gear^.Radius)
-        else Gear^.X:= int2hwfloat(leftX+Gear^.Radius)
+        if (hwRound(Gear^.X)-Gear^.Radius < leftX-100) then
+             Gear^.X:= int2hwfloat(rightX-Gear^.Radius+100)
+        else Gear^.X:= int2hwfloat(leftX+Gear^.Radius-100)
         end
     else if WorldEdge = weBounce then
         begin
         if (hwRound(Gear^.X)-Gear^.Radius < leftX) then
             begin
             Gear^.dX.isNegative:= false;
-            Gear^.X:= int2hwfloat(leftX+Gear^.Radius)
+            Gear^.X:= int2hwfloat(leftX+Gear^.Radius-100)
             end
         else 
             begin
             Gear^.dX.isNegative:= true;
-            Gear^.X:= int2hwfloat(rightX-Gear^.Radius)
+            Gear^.X:= int2hwfloat(rightX-Gear^.Radius+100)
             end
         end
     else if WorldEdge = weSea then
--- a/hedgewars/uWorld.pas	Sun Sep 29 19:03:15 2013 -0400
+++ b/hedgewars/uWorld.pas	Mon Sep 30 12:37:44 2013 -0400
@@ -1238,8 +1238,8 @@
 if WorldEdge <> weNone then
     begin
 (* I think for a bounded world, will fill the left and right areas with black or something. Also will probably want various border effects/animations based on border type.  Prob also, say, trigger a border animation timer on an impact. *)
-    DrawLine(leftX, -3000, leftX, cWaterLine+cVisibleWater, 3.0, $FF, $00, $FF, $FF);
-    DrawLine(rightX, -3000, rightX, cWaterLine+cVisibleWater, 3.0, $FF, $00, $FF, $FF)
+    DrawLine(leftX-100, -3000, leftX-100, cWaterLine+cVisibleWater, 3.0, $FF, $00, $FF, $FF);
+    DrawLine(rightX+100, -3000, rightX+100, cWaterLine+cVisibleWater, 3.0, $FF, $00, $FF, $FF)
     end;
 
 // this scale is used to keep the various widgets at the same dimension at all zoom levels