]> Dogcows Code - chaz/carfire/commitdiff
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 56507110fac10ba1c10502be051f1cf11545dc1f..63ed26deed977cd5993c8844496f1f26dfac6852 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 7d818681993a47e22b09e4566046992e9072bdd3..ad26e478a317f8921f9b14e512f97f9df2690e42 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 e89b28473e1143abdaf37fc453f181f2042d7a03..58460500a02932441be7bd4142fd5ba51c8b6f20 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.026163 seconds and 4 git commands to generate.