]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/MovementManager.cs
Modified Projectiles to work with MovementManager.
[chaz/carfire] / CarFire / CarFire / CarFire / MovementManager.cs
index befeb4b62828f6bac4c74ee24df02c35abafaef8..3b8dae13a2d0983b3f3b0dfbc4f8f3be39f4da8e 100644 (file)
@@ -18,7 +18,8 @@ namespace CarFire
         UpperRight,\r
         Right,\r
         LowerRight,\r
-        LowerLeft\r
+        LowerLeft,\r
+        None\r
     }\r
 \r
 \r
@@ -117,7 +118,7 @@ namespace CarFire
             float passedTime = (float)timeSpan.TotalSeconds;\r
 \r
             bool requestMove = (moveLeft ^ moveRight) || (moveUp ^ moveDown);\r
-            if (!IsMoving && requestMove)\r
+            if (!mIsMoving && requestMove)\r
             {\r
                 mTimeAccumulator = passedTime;\r
                 \r
@@ -127,7 +128,7 @@ namespace CarFire
 \r
                 RecalculatePosition(mTimeAccumulator / mInverseSpeed);\r
             }\r
-            else if (IsMoving)\r
+            else if (mIsMoving)\r
             {\r
                 mTimeAccumulator += passedTime;\r
 \r
@@ -206,7 +207,7 @@ namespace CarFire
 \r
         void RecalculatePosition(float alpha)\r
         {\r
-            Console.WriteLine("last: " + mLastCoordinates + ", now: " + mCoordinates + ", alpha: " + alpha);\r
+            //Console.WriteLine("last: " + mLastCoordinates + ", now: " + mCoordinates + ", alpha: " + alpha);\r
             mPosition.X = (float)mLastCoordinates.X + alpha * ((float)mCoordinates.X - (float)mLastCoordinates.X);\r
             mPosition.Y = (float)mLastCoordinates.Y + alpha * ((float)mCoordinates.Y - (float)mLastCoordinates.Y);\r
         }\r
@@ -236,7 +237,7 @@ namespace CarFire
         Point mLastCoordinates;         // Last position on the grid.\r
         float mInverseSpeed;            // The time it takes to move from one cell to another.\r
         float mTimeAccumulator;         // Amount of time passed since last move.\r
-        bool mIsMoving                  // Whether or not it is currently in the process of moving.\r
+        bool mIsMoving;                 // Whether or not it is currently in the process of moving.\r
         Direction mDirection;           // The direction the object is facing.\r
 \r
         #endregion\r
This page took 0.026311 seconds and 4 git commands to generate.