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));
        }
Exemplo n.º 4
0
        public GameOverScene(SpriteFont font) : base(font)
        {
            OkButton          = ButtonFactory.CreateButton(font, "Ok");
            OkButton.Position = new Vector2(Game.StandardWidth / 2.0f - OkButton.Rectangle.Width / 2.0f,
                                            Game.StandardHeight / 2.0f - OkButton.Rectangle.Height / 2.0f);

            _messagePosition = new Vector2(Game.StandardWidth / 2.0f - font.MeasureString(_message).X / 2.0f,
                                           Game.StandardHeight / 2.0f - font.MeasureString(_message).X / 2.0f);
            _messagePosition -= new Vector2(0, 350);
        }
        private static IFloorLobbyButton GetDownButton(int floorID)
        {
            ButtonFactory     btnFactory = new ButtonFactory();
            IFloorLobbyButton btn        = btnFactory.CreateButton(ButtonType.FloorButton) as IFloorLobbyButton;

            btn.ButtonID     = 0;
            btn.FloorID      = floorID;
            btn.IsDownButton = true;
            btn.ButtonName   = string.Format("Down Button at Floor {0}", floorID);
            return(btn);
        }
        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);
        }
Exemplo n.º 7
0
 public MenuScene(SpriteFont font) : base(font)
 {
     PlayButton          = ButtonFactory.CreateButton(font, "Play");
     PlayButton.Position = new Vector2(Game.StandardWidth / 2.0f - PlayButton.Rectangle.Width / 2.0f,
                                       Game.StandardHeight / 2.0f - PlayButton.Rectangle.Height / 2.0f);
 }