public void Update(GameTime gameTime, InputHelper input)
        {
            if (input.IsNewPress(Buttons.Back) || input.IsNewPress(Keys.Escape))
                gameController.Exit();

            if(input.IsNewPress(Keys.Left))
            {
                menuIndex--;
                if (menuIndex < 0)
                {
                    menuIndex = menuOptions.Count - 1;
                }
            }
            else if(input.IsNewPress(Keys.Right))
            {
                menuIndex ++;
                if (menuIndex >= menuOptions.Count)
                {
                    menuIndex = 0;
                }
            }

            if (input.IsNewPress(Keys.Enter))
            {
                gameController.changeToScreen(menuOptions[menuIndex]);
            }
        }
Beispiel #2
0
        public void Update(GameTime gameTime, InputHelper input)
        {
            if (input.IsNewPress(Buttons.Back) || input.IsNewPress(Keys.Escape))
            {
                gameController.Exit();
            }

            if (input.IsNewPress(Keys.Left))
            {
                menuIndex--;
                if (menuIndex < 0)
                {
                    menuIndex = menuOptions.Count - 1;
                }
            }
            else if (input.IsNewPress(Keys.Right))
            {
                menuIndex++;
                if (menuIndex >= menuOptions.Count)
                {
                    menuIndex = 0;
                }
            }

            if (input.IsNewPress(Keys.Enter))
            {
                gameController.changeToScreen(menuOptions[menuIndex]);
            }
        }
Beispiel #3
0
        private void updateKeyboardInput(GameTime gameTime, InputHelper input)
        {
            if (input.IsNewPress(Keys.Right))
            {
                changeNextCard();

                elapsedTimeKeyboardLeft = 0;
            }
            else if (input.IsCurPress(Keys.Right))
            {
                elapsedTimeKeyboardLeft += gameTime.ElapsedGameTime.TotalMilliseconds;
                if (elapsedTimeKeyboardLeft >= 100)
                {
                    elapsedTimeKeyboardLeft = 0;
                    changeNextCard();
                }
            }
            if (input.IsNewPress(Keys.Left))
            {
                changePreviousCard();
                elapsedTimeKeyboardLeft = 0;
            }
            else if (input.IsCurPress(Keys.Left))
            {
                elapsedTimeKeyboardLeft += gameTime.ElapsedGameTime.TotalMilliseconds;
                if (elapsedTimeKeyboardLeft >= 100)
                {
                    elapsedTimeKeyboardLeft = 0;
                    changePreviousCard();
                }
            }
        }
Beispiel #4
0
        public void Update(GameTime gameTime, InputHelper input)
        {
            if (input.IsNewPress(Buttons.Back) || input.IsNewPress(Keys.Escape))
            {
                gameController.changeToScreen(GameController.Screens.MainMenu);
            }

            updateGamepadSticks(gameTime, input);
            updateKeyboardInput(gameTime, input);

            foreach (FilmCard c in cards)
            {
                if (c.delete)
                {
                    cards.Remove(c);
                }
                else
                {
                    c.Update(gameTime);
                }
            }
        }
        private void updateKeyboardInput(GameTime gameTime,InputHelper input)
        {
            if (input.IsNewPress(Keys.Right))
            {
                changeNextCard();

                elapsedTimeKeyboardLeft = 0;
            }
            else if (input.IsCurPress(Keys.Right))
            {
                elapsedTimeKeyboardLeft += gameTime.ElapsedGameTime.TotalMilliseconds;
                if (elapsedTimeKeyboardLeft >= 100)
                {
                    elapsedTimeKeyboardLeft = 0;
                    changeNextCard();
                }
            }
            if (input.IsNewPress(Keys.Left))
            {
                changePreviousCard();
                elapsedTimeKeyboardLeft = 0;
            }
            else if (input.IsCurPress(Keys.Left))
            {
                elapsedTimeKeyboardLeft += gameTime.ElapsedGameTime.TotalMilliseconds;
                if (elapsedTimeKeyboardLeft >= 100)
                {
                    elapsedTimeKeyboardLeft = 0;
                    changePreviousCard();
                }

            }
        }
        public void Update(GameTime gameTime, InputHelper input)
        {
            if (input.IsNewPress(Buttons.Back) || input.IsNewPress(Keys.Escape))
                gameController.changeToScreen(GameController.Screens.MainMenu);

            updateGamepadSticks(gameTime, input);
            updateKeyboardInput(gameTime, input);

            foreach (FilmCard c in cards)
            {
                if (c.delete)
                    cards.Remove(c);
                else
                    c.Update(gameTime);
            }
        }