From: brady Date: Sat, 20 Mar 2010 11:10:24 +0000 (+0000) Subject: testing X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fcarfire;a=commitdiff_plain;h=8a11d454e88649b469fb9794f662beb7f6a15c6a testing git-svn-id: https://bd85.net/svn/cs3505_group@22 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- diff --git a/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs b/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs index 15d0955..6026a61 100644 --- a/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs +++ b/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs @@ -221,6 +221,13 @@ namespace CS_3505_Project_06 break; } } + if(allReady && players.Count == 2 && localPlayer == players[0]) + { + if (currentKeyboardState.IsKeyDown(Keys.B) && previousKeyboardState.IsKeyUp(Keys.B)) + { + networkGame.StartGame(); + } + } } else currentState = lobbyState.Welcome; @@ -288,7 +295,7 @@ namespace CS_3505_Project_06 case lobbyState.Connected: DrawPlayerList(spriteBatch); - + if(allReady && players.Count == 2 && localPlayer == players[0]) spriteBatch.DrawString(menuFont, "Press B to begin game!", new Vector2(MaxX / 2, MaxY / 2), Color.White, 0f, zero, .7f, SpriteEffects.None, 0.5f); else if(allReady) diff --git a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs index 52486c8..d2b4846 100644 --- a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs +++ b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs @@ -115,6 +115,14 @@ namespace CS_3505_Project_06 return mNetworkSession; } + // added to begin the game. I made the LobbyGUI make sure that only the host will call it when everyone is ready. + // This is already taken care of in the update method below. But it may be nice to allow the host to signal the start + // rather then having it start automatically. Just a suggestion. + // -Brady + public void StartGame() + { + mNetworkSession.StartGame(); + } public void LeaveSession() {