private void HandlePlayGameMessage(NetIncomingMessage im) { var message = new InGameMessage(im); if (!this.IsHost) { if (message.Play) { tileManager.NewGame(); } else if (!message.Play && TileGrid.GameState == GameStates.Lobby) { Disconnect(); } } }
/// <summary> /// Initializes the start message for the game. /// </summary> void initializeStartMessage() { startMessage = new MessageType(); InGameMessage temp; temp = new InGameMessage("Press the Play/Pause \n button to start", "Fonts/Lindsey", new Vector2(30, 70), Color.Red); startMessage.addMessage(temp, "Press Start"); temp = new InGameMessage("You lost a life", "Fonts/Lindsey", new Vector2(70, 140), Color.Black); temp.displayMessage(false); startMessage.addMessage(temp, "Lost Life"); temp = new InGameMessage("Next Level!", "Fonts/Lindsey", new Vector2(70, 140), Color.Black); temp.displayMessage(false); startMessage.addMessage(temp, "Next Level"); }
public async virtual void InGameMessageCall(Game game, InGameMessage im) { // Post message to Server Chatroom. await SignalRGameHub.Invoke("InGameMessageCall", game, im); }