]> Dogcows Code - chaz/carfire/commitdiff
Display should now follow correct player in a network game(Not Tested Yet!)
authorKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Wed, 21 Apr 2010 19:49:53 +0000 (19:49 +0000)
committerKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Wed, 21 Apr 2010 19:49:53 +0000 (19:49 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@124 92bb83a3-7c8f-8a45-bc97-515c4e399668

CarFire/CarFire/CarFire/Display.cs
CarFire/CarFire/CarFire/Game.cs

index aceadfe14dddf4165520be4f47d56a8aab6409e9..dd0721215e3a2d5dc69b693af1e051afd105086c 100644 (file)
@@ -63,7 +63,7 @@ namespace CarFire
         /// checking for collisions, gathering input, and playing audio.\r
         /// </summary>\r
         /// <param name="gameTime">Provides a snapshot of timing values.</param>\r
-        public void Update(TimeSpan timespan, GameState state)\r
+        public void Update(TimeSpan timespan, GameState state, int thisPlayer)\r
         {\r
             \r
             //INPUT - testing input... has to be through network later\r
@@ -141,9 +141,9 @@ namespace CarFire
                    \r
                 }\r
             }\r
-            if (mCharacters[0] != null)\r
+            if (mCharacters[thisPlayer] != null)\r
             {\r
-                mGame.State.Map.CenterCell = mCharacters[0].Position;\r
+                mGame.State.Map.CenterCell = mCharacters[thisPlayer].Position;\r
             }\r
                 //Handle wall collisions of projectiles again...\r
             for (int i = 0; i < mProjectiles.Count; i++)\r
index fa3fbd1b9e7b6a5a4134b40f135cf1ddb1144d2a..38ec627d1456dcff5531f055f9e4a3f45808872d 100644 (file)
@@ -361,7 +361,7 @@ namespace CarFire
         public long Update(TimeSpan elapsedTime)\r
         {\r
             State.AdvanceFrame(mInputs, elapsedTime.Milliseconds);  // Apply the inputs, advance game state.\r
-            mDisplay.Update(elapsedTime, State);\r
+            mDisplay.Update(elapsedTime, State, mThisPlayerID);\r
             State.Entities.ForEach(delegate(IEntity e) { e.Update(elapsedTime); });\r
             mInputs = new NextInputs(State.NumberOfPlayers);  // Start with inputs cleared on the next frame.\r
             //mDisplay.Update(elapsedTime);\r
This page took 0.026267 seconds and 4 git commands to generate.