예제 #1
0
        private void timerGameTick_Tick(object sender, EventArgs e)
        {
            if (!inMainMenu)
            {
                if (!gameInitialized)
                {
                    StartGame();
                    this.Focus();
                }
                mainGame.GameTick(pbMainGame);
            }
            else
            {
                if (!mainMenuInitialized)
                {
                    StartMainMenu();
                }
                mainMenu.MainMenuTick(pbMainGame);

                if (mainMenu.StartGameMenuEntryPressed())
                {
                    inMainMenu = false;
                }
                if (mainMenu.CloseMenuEntryPressed())
                {
                    this.Close();
                }
            }
        }
예제 #2
0
        private void timerGameTick_Tick(object sender, EventArgs e)
        {
            newTick = true;

            //Abfrage ob in Hauptmenü
            if (!inMainMenu)
            {
                //Abfrage, ob erster Game-Start
                if (!gameInitialized)
                {
                    StartGame();
                    this.Focus();
                }
                mainGame.GameTick(pbMainGame);
            }
            else
            {
                //Abfrage, ob erster Menü-Start
                if (!mainMenuInitialized)
                {
                    StartMainMenu();
                }
                mainMenu.MainMenuTick(pbMainGame);


                if (mainMenu.StartGameMenuEntryPressed())
                {
                    inMainMenu       = false;
                    lastClickedEntry = mainMenu.Entries[mainMenu.CurrentMenuEntry];
                }
                else if (mainMenu.CloseMenuEntryPressed())
                {
                    this.Close();
                    lastClickedEntry = mainMenu.Entries[mainMenu.CurrentMenuEntry];
                }
                else if (mainMenu.VisualProfileEditorEntryPressed())
                {
                    ((VisualProfileEditorEntry)mainMenu.Entries[mainMenu.CurrentMenuEntry]).DrawVisualMenuEntry();
                    pbMainGame.Image = ((VisualProfileEditorEntry)mainMenu.Entries[mainMenu.CurrentMenuEntry]).Gesamt;

                    lastClickedEntry = mainMenu.Entries[mainMenu.CurrentMenuEntry];
                }
                else if (mainMenu.VisualProfileLoadingEntryPressed())
                {
                    ((VisualProfileLoadingEntry)mainMenu.Entries[mainMenu.CurrentMenuEntry]).DrawVisualMenuEntry();
                    pbMainGame.Image = ((VisualProfileLoadingEntry)mainMenu.Entries[mainMenu.CurrentMenuEntry]).Gesamt;

                    lastClickedEntry = mainMenu.Entries[mainMenu.CurrentMenuEntry];
                }
            }
        }