Asteroids.Classes.MainMenu.Update C# (CSharp) 메소드

Update() 공개 메소드

public Update ( GameTime gameTime, GraphicsDevice graphicsDevice ) : void
gameTime Microsoft.Xna.Framework.GameTime
graphicsDevice GraphicsDevice
리턴 void
        public void Update(GameTime gameTime, GraphicsDevice graphicsDevice)
        {
            //Keybindings
            framesPassed++;
            if (framesPassed % 7 == 0)
            {
                if (ch.GetInput().Contains("Up"))
                {
                    if (selectedNumber > 0)
                    {
                        selectedNumber--;
                        switch (selectedNumber)
                        {
                            case 0:
                                {
                                    UpdateSelect(0, graphicsDevice);

                                    break;
                                }
                            case 1:
                                {
                                    UpdateSelect(1, graphicsDevice);
                                    break;
                                }
                            case 2:
                                {
                                    UpdateSelect(2, graphicsDevice);
                                    break;
                                }
                            case 3:
                                {
                                    UpdateSelect(3, graphicsDevice);
                                    break;
                                }
                            case 4:
                                {
                                    UpdateSelect(4, graphicsDevice);
                                    break;
                                }
                        }
                    }
                }
                else if (ch.GetInput().Contains("Down"))
                {
                    if (selectedNumber < 4)
                    {
                        selectedNumber++;
                        switch (selectedNumber)
                        {
                            case 0:
                                {
                                    UpdateSelect(0, graphicsDevice);
                                    break;
                                }
                            case 1:
                                {
                                    UpdateSelect(1, graphicsDevice);
                                    break;
                                }
                            case 2:
                                {
                                    UpdateSelect(2, graphicsDevice);
                                    break;
                                }
                            case 3:
                                {
                                    UpdateSelect(3, graphicsDevice);
                                    break;
                                }
                            case 4:
                                {
                                    UpdateSelect(4, graphicsDevice);
                                    break;
                                }
                        }
                    }
                }
                else if (ch.GetInput().Contains("Select"))
                {
                    switch (selectState)
                    {
                        case 0:
                            {
                                currentGameState = 3;
                                break;
                            }
                        case 1:
                            {
                                currentGameState = 5;
                                break;
                            }
                        case 2:
                            {
                                currentGameState = 6;
                                break;
                            }
                        case 3:
                            {
                                currentGameState = 9;
                                break;
                            }
                        case 4:
                            {
                                exit = true;
                                break;
                            }
                    }
                }
                else if (ch.GetInput().Contains("Back"))
                {
                    exit = true;
                }
                framesPassed++;
            }
            //Highscores
            highscoreBoard = string.Format("TOP 10 PLAYERS \n1. {0},{1} \n2. {2},{3}\n3. {4},{5}\n4. {6},{7}\n5. {8},{9}\n6. {10},{11}\n7. {12},{13}\n8. {14},{15}\n9. {16},{17}\n10. {18},{19}",
            highscoreCounter[0], highscores[0], highscoreCounter[1], highscores[1], highscoreCounter[2], highscores[2], highscoreCounter[3], highscores[3], highscoreCounter[4], highscores[4], highscoreCounter[5], highscores[5], highscoreCounter[6], highscores[6], highscoreCounter[7], highscores[7], highscoreCounter[8], highscores[9], highscoreCounter[9], highscores[9]);
            //Movement Highscores
            MoveHighscores(gameTime, graphicsDevice);

            PositionStrings(graphicsDevice);
        }