X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FMovementManager.cs;h=3b8dae13a2d0983b3f3b0dfbc4f8f3be39f4da8e;hb=b32b73746f5bf95771eb5f9db95763ce2a44049f;hp=befeb4b62828f6bac4c74ee24df02c35abafaef8;hpb=3cd7b300c8d161218ed795d0b12a81ac2dc93b7c;p=chaz%2Fcarfire diff --git a/CarFire/CarFire/CarFire/MovementManager.cs b/CarFire/CarFire/CarFire/MovementManager.cs index befeb4b..3b8dae1 100644 --- a/CarFire/CarFire/CarFire/MovementManager.cs +++ b/CarFire/CarFire/CarFire/MovementManager.cs @@ -18,7 +18,8 @@ namespace CarFire UpperRight, Right, LowerRight, - LowerLeft + LowerLeft, + None } @@ -117,7 +118,7 @@ namespace CarFire float passedTime = (float)timeSpan.TotalSeconds; bool requestMove = (moveLeft ^ moveRight) || (moveUp ^ moveDown); - if (!IsMoving && requestMove) + if (!mIsMoving && requestMove) { mTimeAccumulator = passedTime; @@ -127,7 +128,7 @@ namespace CarFire RecalculatePosition(mTimeAccumulator / mInverseSpeed); } - else if (IsMoving) + else if (mIsMoving) { mTimeAccumulator += passedTime; @@ -206,7 +207,7 @@ namespace CarFire void RecalculatePosition(float alpha) { - Console.WriteLine("last: " + mLastCoordinates + ", now: " + mCoordinates + ", alpha: " + alpha); + //Console.WriteLine("last: " + mLastCoordinates + ", now: " + mCoordinates + ", alpha: " + alpha); mPosition.X = (float)mLastCoordinates.X + alpha * ((float)mCoordinates.X - (float)mLastCoordinates.X); mPosition.Y = (float)mLastCoordinates.Y + alpha * ((float)mCoordinates.Y - (float)mLastCoordinates.Y); } @@ -236,7 +237,7 @@ namespace CarFire Point mLastCoordinates; // Last position on the grid. float mInverseSpeed; // The time it takes to move from one cell to another. float mTimeAccumulator; // Amount of time passed since last move. - bool mIsMoving // Whether or not it is currently in the process of moving. + bool mIsMoving; // Whether or not it is currently in the process of moving. Direction mDirection; // The direction the object is facing. #endregion