X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fcarfire;a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FPlayer.cs;h=b5312550630b1e64a5c4927ee618e174ca26e34e;hp=124851cac0b1e55a356362823a5d6afe9fb8cfae;hb=0483d0578f0d160ea3e80bae57d4a3ba2b061d35;hpb=198cb6056e93fecd69e65351ca8d0b34a077523f diff --git a/CarFire/CarFire/CarFire/Player.cs b/CarFire/CarFire/CarFire/Player.cs index 124851c..b531255 100644 --- a/CarFire/CarFire/CarFire/Player.cs +++ b/CarFire/CarFire/CarFire/Player.cs @@ -14,7 +14,7 @@ namespace CarFire { #region Member variables //The number of frames between each projectile is spawned. - const float basePlayerSpeed = 4.0f; + const float basePlayerSpeed = 8.0f; const int shootCoolDown = 18; String CharName; Game game; @@ -38,7 +38,7 @@ namespace CarFire public Point Coordinates { get { return mMotion.Coordinates; } set { - Coordinates = value; + mMotion.Coordinates = value; mMotion = new MovementManager(value, basePlayerSpeed); } } public char Identifier { get { return mPlayerIndex.ToString()[0]; } } @@ -57,7 +57,7 @@ namespace CarFire mPlayerIndex = playerIndex; // Speed is the number of grid cells you can move through per second. - mMotion = new MovementManager(position, 4.0f); + mMotion = new MovementManager(position, basePlayerSpeed); } public void causeDamageTo(int amount) { @@ -89,7 +89,7 @@ namespace CarFire bool moveUp = keysPressed.Contains(Keys.Up); bool moveDown = keysPressed.Contains(Keys.Down); - List possibleDestinations = new List(); + List possibleDestinations = new List(3); possibleDestinations.Add(MovementManager.GetNeighbor(mMotion.Coordinates, moveLeft, moveRight, moveUp, moveDown)); possibleDestinations.AddRange(MovementManager.GetNeighbors(mMotion.Coordinates, possibleDestinations[0])); @@ -103,7 +103,8 @@ namespace CarFire } } - if (direction != Direction.None && !keysPressed.Contains(Keys.LeftControl)) mMotion.Update(timeSpan, direction); + if (direction != Direction.None && !keysPressed.Contains(Keys.LeftControl)) + mMotion.Update(timeSpan, direction); else mMotion.LockUpdate(timeSpan, moveLeft, moveRight, moveUp, moveDown); }