Exemplo n.º 1
0
        public void update(GameTime gameTime, Game1 game, ContentManager content, Camera2D cam)
        {
            deltaTime += (float)gameTime.ElapsedGameTime.TotalSeconds;

            if (WINpos.X <= cam.Position.X - 350 && NERpos.X > cam.Position.X)
            {
                inAnimation = true;
                WINpos      = new Vector2(WINpos.X + 10, WINpos.Y);
                NERpos      = new Vector2(NERpos.X - 10, NERpos.Y);
            }
            else
            {
                inAnimation = false;
            }

            if (Input.IsPressed(Keys.Enter) && inAnimation == false)
            {
                CharactersHandler.Players.Clear();
                Collisions.reset();
                Game1.firstEntry = true;
                MenuCharacterChoose.resetArrays(content);
                MenuCharacterChoose.resetPlayerInserted();
                CharactersHandler.JogadorActivo = 0;
                CharactersHandler.initialPlayer = 0;
                game.gameState = Game1.GameState.Menu;
            }
        }
Exemplo n.º 2
0
        public void update(GameTime gametime, Game1 game, ContentManager content)
        {
            if (Input.IsPressed(Keys.Up))
            {
                SoundManager.playSound("menuswitch");
                escolha--;
                if (escolha < 0)
                {
                    escolha = options.Count - 1;
                }
            }
            if (Input.IsPressed(Keys.Down))
            {
                SoundManager.playSound("menuswitch");
                escolha++;
                if (escolha >= options.Count)
                {
                    escolha = 0;
                }
            }
            if (Input.IsPressed(Keys.Enter))
            {
                SoundManager.playSound("enterselect");
                switch (escolha)
                {
                case 0:
                    game.gameState = Game1.GameState.running;
                    break;

                case 1:
                {
                    game.gameState = Game1.GameState.Menu;
                    CharactersHandler.Players.Clear();
                    MenuCharacterChoose.resetArrays(content);
                    Collisions.reset();
                    Game1.firstEntry = false;
                }
                break;

                case 2:
                    game.Exit();
                    break;
                }
            }
        }