Reseting the map seems to be working now.
authorKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 27 Apr 2010 04:38:42 +0000 (04:38 +0000)
committerKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 27 Apr 2010 04:38:42 +0000 (04:38 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@157 92bb83a3-7c8f-8a45-bc97-515c4e399668

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

index 5650711..63ed26d 100644 (file)
@@ -309,6 +309,15 @@ namespace CarFire
         public void AdvanceLevel()\r
         {\r
             // TODO: Load the next map, etc...\r
+            //TODO somehow get next map\r
+            State.Entities.Clear();\r
+            String nextMap = State.Map.Next;\r
+            State.Map = mContentManager.Load<Map>("Maps/"+nextMap);\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(this);\r
         }\r
 \r
         /// <summary>\r
@@ -324,21 +333,6 @@ 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(this);\r
         }\r
         public void LoadContent(ContentManager contentManager)\r
         {\r
index 7d81868..ad26e47 100644 (file)
@@ -44,7 +44,7 @@ namespace CarFire
         /// Get the grid coordinates where the object is at or\r
         /// is moving to.\r
         /// </summary>\r
-        public Point Coordinates { get { return mCoordinates; } }\r
+        public Point Coordinates { get { return mCoordinates; } set { mCoordinates = value; } }\r
 \r
         /// <summary>\r
         /// Get and set the speed of movement in grid cells / second.\r
index e89b284..5846050 100644 (file)
@@ -38,7 +38,7 @@ namespace CarFire
         public Point Coordinates { get { return mMotion.Coordinates; }\r
             set\r
             {\r
-                Coordinates = value;\r
+                mMotion.Coordinates = value;\r
                 mMotion = new MovementManager(value, basePlayerSpeed);\r
             } }\r
         public char Identifier { get { return mPlayerIndex.ToString()[0]; } }\r
This page took 0.026303 seconds and 4 git commands to generate.