]> Dogcows Code - chaz/carfire/commitdiff
testing
authorbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Sat, 20 Mar 2010 11:10:24 +0000 (11:10 +0000)
committerbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Sat, 20 Mar 2010 11:10:24 +0000 (11:10 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@22 92bb83a3-7c8f-8a45-bc97-515c4e399668

Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs
Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs

index 15d0955946f737d1709355648ec4cc7ac0d35b56..6026a6161d212a66a88a77f68de109369bf394c3 100644 (file)
@@ -221,6 +221,13 @@ namespace CS_3505_Project_06
                                     break;\r
                                 }\r
                         }\r
+                        if(allReady && players.Count == 2 && localPlayer == players[0])\r
+                        {\r
+                            if (currentKeyboardState.IsKeyDown(Keys.B) && previousKeyboardState.IsKeyUp(Keys.B))\r
+                            {\r
+                                networkGame.StartGame();\r
+                            }\r
+                        }\r
                     }\r
                     else\r
                         currentState = lobbyState.Welcome;\r
@@ -288,7 +295,7 @@ namespace CS_3505_Project_06
 \r
                 case lobbyState.Connected:\r
                     DrawPlayerList(spriteBatch);\r
-                    \r
+                                        \r
                     if(allReady && players.Count == 2 && localPlayer == players[0])\r
                         spriteBatch.DrawString(menuFont, "Press B to begin game!", new Vector2(MaxX / 2, MaxY / 2), Color.White, 0f, zero, .7f, SpriteEffects.None, 0.5f);\r
                     else if(allReady)\r
index 52486c8b5f06b75f066710d1635755b66ad7f450..d2b4846489967f504ac36634be1aebbaed6f54b1 100644 (file)
@@ -115,6 +115,14 @@ namespace CS_3505_Project_06
             return mNetworkSession;\r
         }\r
 \r
+        // added to begin the game. I made the LobbyGUI make sure that only the host will call it when everyone is ready.\r
+        // This is already taken care of in the update method below. But it may be nice to allow the host to signal the start\r
+        // rather then having it start automatically. Just a suggestion. \r
+        //    -Brady\r
+        public void StartGame()\r
+        {\r
+            mNetworkSession.StartGame();\r
+        }\r
 \r
         public void LeaveSession()\r
         {\r
This page took 0.022209 seconds and 4 git commands to generate.