Esempio n. 1
0
        public void Button_Click(object sender, EventArgs e)
        {
            VistaButton bt = (VistaButton)sender;

            switch (bt.ButtonText)
            {
            case "Starten":
                showMenu(false);
                bt.ButtonText = "Fortsetzen";
                break;

            case "Fortsetzen":
                if (Game.GameState.Failed.Equals(game.State))
                {
                    initGame();
                }
                showMenu(false);
                break;

            case "Laden":
                showMenu(false);
                //erzeuge neues GamePanel
                break;

            case "Speichern":
                //Datenbank ...
                break;

            case "Beenden":
                System.Environment.Exit(0);
                break;

            case "Highscore":
                if (highscoreView != null && menuHolder.Controls.Contains(highscoreView))
                {
                    menuHolder.Controls.Remove(highscoreView);
                }
                else
                {
                    highscoreView          = new HighscoreControlView();
                    highscoreView.Size     = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height - 7);
                    highscoreView.Location = new Point(220, 2);
                    //highscoreView.BackColor = Color.DimGray;
                    menuHolder.Controls.Add(highscoreView);
                }
                break;

            case "Pong spielen":
                playPong = true;
                showMenu(false);
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        public void Button_Click(object sender, EventArgs e)
        {
            VistaButton bt = (VistaButton)sender;

            switch (bt.ButtonText)
            {
                case "Starten":
                    showMenu(false);
                    bt.ButtonText = "Fortsetzen";
                    break;
                case "Fortsetzen":
                    if (Game.GameState.Failed.Equals(game.State)){
                        initGame();
                    }
                    showMenu(false);
                    break;
                case "Laden":
                    showMenu(false);
                    //erzeuge neues GamePanel
                    break;
                case "Speichern":
                    //Datenbank ...
                    break;
                case "Beenden":
                    System.Environment.Exit(0);
                    break;
                case "Highscore":
                    if (highscoreView != null && menuHolder.Controls.Contains(highscoreView))
                    {
                        menuHolder.Controls.Remove(highscoreView);
                    }
                    else
                    {
                        highscoreView = new HighscoreControlView();
                        highscoreView.Size = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height-7);
                        highscoreView.Location = new Point(220, 2);
                        //highscoreView.BackColor = Color.DimGray;
                        menuHolder.Controls.Add(highscoreView);
                    }
                    break;
                case "Pong spielen":
                    playPong = true;
                    showMenu(false);
                    break;
                default:
                    break;

            }
        }
Esempio n. 3
0
        public void Button_Click(object sender, EventArgs e)
        {
            VistaButton bt = (VistaButton)sender;

            switch (bt.ButtonText)
            {
            case "Starten":
                if (Backgroundfader.Enabled)
                {
                    Backgroundfader.Stop();
                    menuFader.Start();
                    img     = Properties.Resources.back3;
                    started = true;
                }
                else if (fade >= 150)
                {
                    menuFader.Start();
                }
                //Erzeuge neues GamePanel
                break;

            case "Laden":
                started = true;
                //erzeuge neues GamePanel
                break;

            case "Speichern":
                //Datenbank ...
                break;

            case "Fortsetzen":
                if (fade >= 150)
                {
                    menuFader.Start();
                }
                //zurück zu Game Panel
                break;

            case "Beenden":
                this.Close();

                break;

            case "Highscore":
                if (highscoreView != null && menuHolder.Controls.Contains(highscoreView))
                {
                    menuHolder.Controls.Remove(highscoreView);
                }
                else
                {
                    highscoreView          = new HighscoreControlView();
                    highscoreView.Size     = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height - 7);
                    highscoreView.Location = new Point(220, 2);
                    //highscoreView.BackColor = Color.DimGray;
                    menuHolder.Controls.Add(highscoreView);
                }
                break;

            default:
                break;
            }
        }
Esempio n. 4
0
        public void Button_Click(object sender, EventArgs e)
        {
            VistaButton bt = (VistaButton)sender;

            switch (bt.ButtonText)
            {
                case "Starten":
                    if (Backgroundfader.Enabled)
                    {
                        Backgroundfader.Stop();
                        menuFader.Start();
                        img = Properties.Resources.back3;
                        started = true;
                    }
                    else if (fade >= 150)
                    {
                        menuFader.Start();
                    }
                    //Erzeuge neues GamePanel
                    break;
                case "Laden":
                    started = true;
                    //erzeuge neues GamePanel
                    break;
                case "Speichern":
                    //Datenbank ...
                    break;
                case "Fortsetzen":
                    if (fade >= 150)
                    {
                        menuFader.Start();
                    }
                    //zurück zu Game Panel
                    break;
                case "Beenden":
                    this.Close();

                    break;
                case "Highscore":
                    if (highscoreView != null && menuHolder.Controls.Contains(highscoreView))
                    {
                        menuHolder.Controls.Remove(highscoreView);
                    }
                    else
                    {
                        highscoreView = new HighscoreControlView();
                        highscoreView.Size = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height-7);
                        highscoreView.Location = new Point(220, 2);
                        //highscoreView.BackColor = Color.DimGray;
                        menuHolder.Controls.Add(highscoreView);
                    }
                    break;
                default:
                    break;

            }
        }