internal State UpdateSingleLoadGameMenu(ButtonFactory singleLoginButtons, StarField starfield, State gameState, GameTime gameTime) { MouseState mouseAfterLogin = Mouse.GetState(); singleLoginButtons.CreateButton(new Vector2(500, 300), State.OnePlayer, "New Game"); singleLoginButtons.CreateButton(new Vector2(500, 400), State.LoadGameMenu, "Load Game"); starfield.Update(gameTime); return(singleLoginButtons.ReturnButtonState(mouseAfterLogin, gameState)); }
internal State UpdateMenuState(ButtonFactory mainMenuButtons, FormFactory mainMenuForms, State gameState) { mainMenuButtons.CreateButton(new Vector2(500, 300), State.SingleLogInMenu, "Singleplayer Mode"); mainMenuButtons.CreateButton(new Vector2(500, 400), State.TwoPlayers, "Multiplayer Mode"); mainMenuButtons.CreateButton(new Vector2(500, 500), State.HighScores, "High Scores"); mainMenuButtons.CreateButton(new Vector2(900, 500), State.Register, "Register User"); MouseState mouse = Mouse.GetState(); mainMenuForms.UpdateForms(mouse); return(mainMenuButtons.ReturnButtonState(mouse, gameState)); }
internal State UpdatePauseMenu(ButtonFactory pauseMenuButtons, State previousState, State gameState, StarField starfield, GameTime gameTime) { pauseMenuButtons.CreateButton(new Vector2(500, 300), State.SaveGame, "Save game"); pauseMenuButtons.CreateButton(new Vector2(500, 400), previousState, "Continue"); pauseMenuButtons.CreateButton(new Vector2(500, 500), State.Quit, "Quit"); MouseState pauseMouse = Mouse.GetState(); starfield.Update(gameTime); starfield.Speed = 1; return(pauseMenuButtons.ReturnButtonState(pauseMouse, gameState)); }
internal State UpdateSingleLoginMenu(FormFactory singleLoginForms, ButtonFactory singleLoginButtons, State gameState, UsersRepository usersRepository, StarField starfield, GameTime gameTime) { MouseState mouseLogin = Mouse.GetState(); singleLoginForms.UpdateForms(mouseLogin); singleLoginButtons.CreateButton(new Vector2(900, 426), State.SingleLoadGameMenu, "LogIn"); gameState = singleLoginButtons.ReturnButtonState(mouseLogin, gameState); if (gameState == State.SingleLoadGameMenu) { usersRepository.AddUser(singleLoginForms); } starfield.Update(gameTime); return(gameState); }