]> Dogcows Code - chaz/carfire/commitdiff
Can now choose between melee and ranged character... melee attack not
authorKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Fri, 23 Apr 2010 03:12:38 +0000 (03:12 +0000)
committerKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Fri, 23 Apr 2010 03:12:38 +0000 (03:12 +0000)
implemented yet.

git-svn-id: https://bd85.net/svn/cs3505_group@136 92bb83a3-7c8f-8a45-bc97-515c4e399668

CarFire/CarFire/CarFire/Game.cs
CarFire/CarFire/CarFire/Player.cs

index dce6ba45cadb5309632d4ff847cc132a7a4126a9..be18be785b8d8a35c7f02dfbcbced0d8c414be74 100644 (file)
@@ -245,6 +245,21 @@ namespace CarFire
         public Game()\r
         {\r
            \r
+        }\r
+        /// <summary>\r
+        /// This method should be called whenever the players want to move to a new map.\r
+        /// Not implemented yet.  Need some way to get next map.\r
+        /// </summary>\r
+        public void startNewMap()\r
+        {\r
+            //TODO somehow get next map\r
+            State.Entities.Clear();\r
+            //State.Map = State.Map.getNextMap();\r
+            for (int i = 0; i < State.mCharacters.Length; i++)\r
+            {\r
+                State.mCharacters[i].Coordinates = State.Map.GetStartingPositionForPlayer(i + 1);\r
+            }\r
+            State.Entities = State.Map.GetAllEntities();\r
         }\r
         public void LoadContent(ContentManager contentManager)\r
         {\r
@@ -382,7 +397,12 @@ namespace CarFire
                 if (State.mCharacters[i] == null)\r
                 {\r
                     allCharactersSelected = false;\r
-                    if (State.GetKeysDown(i).Contains(Keys.Enter))\r
+                    if (State.GetKeysDown(i).Contains(Keys.M))\r
+                    {\r
+                        State.mCharacters[i] = new Melee(this, "", State.Map.GetStartingPositionForPlayer(i + 1), i);\r
+                        State.mCharacters[i].LoadContent(mContentManager);\r
+                    }\r
+                    else if (State.GetKeysDown(i).Contains(Keys.R))\r
                     {\r
                         State.mCharacters[i] = new Ranged(this, "", State.Map.GetStartingPositionForPlayer(i + 1), i);\r
                         State.mCharacters[i].LoadContent(mContentManager);\r
@@ -397,7 +417,7 @@ namespace CarFire
             else\r
             {\r
                 spriteBatch.GraphicsDevice.Clear(Color.Black);\r
-                spriteBatch.DrawString(menu, "Press Enter To Select A Character", new Vector2(30, 30), Color.RosyBrown);\r
+                spriteBatch.DrawString(menu, "Press R to select a Ranged Character and M to select a Melee Character", new Vector2(30, 30), Color.RosyBrown);\r
             }\r
             return CurrentFrameNumber;\r
         }\r
index 0a8d4e54962a6d3485f391978acf2d4ff4bee109..6af9f194508ece7e82bf106675fff3370edba670 100644 (file)
@@ -14,6 +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 int shootCoolDown = 18;\r
         String CharName;\r
         Game game;\r
@@ -32,7 +33,12 @@ namespace CarFire
         public MovementManager Motion { get { return mMotion; } }\r
         public int PlayerIndex { get { return mPlayerIndex; } }\r
         public Vector2 Position { get { return mMotion.Position; } }\r
-        public Point Coordinates { get { return mMotion.Coordinates; } }\r
+        public Point Coordinates { get { return mMotion.Coordinates; } \r
+            set\r
+            {\r
+                Coordinates = value;\r
+                mMotion = new MovementManager(value, basePlayerSpeed);\r
+            } }\r
         public int Damage { get { return playerDamage; } set { playerDamage = value; } }\r
         #endregion\r
 \r
This page took 0.025615 seconds and 4 git commands to generate.