]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/Player.cs
git-svn-id: https://bd85.net/svn/cs3505_group@168 92bb83a3-7c8f-8a45-bc97-515c4e399668
[chaz/carfire] / CarFire / CarFire / CarFire / Player.cs
index 58460500a02932441be7bd4142fd5ba51c8b6f20..a827ae250001a9afe4997a29bb36d55c3d6886f7 100644 (file)
@@ -14,7 +14,7 @@ namespace CarFire
     {\r
         #region Member variables\r
         //The number of frames between each projectile is spawned.\r
-        const float basePlayerSpeed = 4.0f;\r
+        const float basePlayerSpeed = 8.0f;\r
         const int shootCoolDown = 18;\r
         String CharName;\r
         Game game;\r
@@ -57,16 +57,21 @@ namespace CarFire
             mPlayerIndex = playerIndex;\r
 \r
             // Speed is the number of grid cells you can move through per second.\r
-            mMotion = new MovementManager(position, 25.0f);\r
+            mMotion = new MovementManager(position, basePlayerSpeed);\r
         }\r
         public void causeDamageTo(int amount)\r
         {\r
             playerHealth -= amount;\r
         }\r
-\r
-        public void Update(TimeSpan timeSpan)\r
+        public void Update(TimeSpan timespan)\r
         {\r
 \r
+        }\r
+        public void Update(TimeSpan timeSpan, List<Keys> keysPressed)\r
+        {\r
+            UpdatePosition(timeSpan, keysPressed);\r
+            Attack(keysPressed);\r
+            UpdateFrame(timeSpan);\r
         }\r
         /// <summary>\r
         /// Moves the current player being controlled based on a given set of key presses.\r
@@ -103,7 +108,8 @@ namespace CarFire
                 }\r
             }\r
 \r
-            if (direction != Direction.None && !keysPressed.Contains(Keys.LeftControl)) mMotion.Update(timeSpan, direction);\r
+            if (direction != Direction.None && !keysPressed.Contains(Keys.LeftControl)) \r
+                mMotion.Update(timeSpan, direction);\r
             else mMotion.LockUpdate(timeSpan, moveLeft, moveRight, moveUp, moveDown);\r
         }\r
         \r
@@ -136,6 +142,7 @@ namespace CarFire
         /// <param name="spriteBatch"></param>\r
         public abstract void Draw(SpriteBatch spriteBatch);\r
         public abstract void Attack(List<Keys> keysPressed);\r
+        public abstract void UpdateFrame(TimeSpan timeSpan);\r
         #endregion\r
 \r
 \r
This page took 0.020532 seconds and 4 git commands to generate.