Exemple #1
0
 private void GameOver()
 {
     TimerAnimate.Stop();
     TimerMove.Stop();
     heroImageCount = 0;
     TimerHeroMelt.Start();
 }
Exemple #2
0
        private void TimerHeroMelt_Tick(object sender, EventArgs e)
        {
            string heroImageName;

            heroImageName   = "pacman_melt_" + heroImageCount;
            Hero.Image      = (Image)Properties.Resources.ResourceManager.GetObject(heroImageName);
            heroImageCount += 1;
            string coffinImage;

            coffinImage          = "coffin_men";
            this.BackgroundImage = (Image)Properties.Resources.ResourceManager.GetObject(coffinImage);
            if (heroImageCount > 14)
            {
                TimerHeroMelt.Stop();
                GameOverBox.Visible = true;

                Hero.Visible  = false;
                Food.Visible  = false;
                Enemy.Visible = false;
                try
                {
                    SoundPlayer sndPlayer = new SoundPlayer(Properties.Resources.mod_coffin_dance);
                    sndPlayer.Play();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error Message - " + ex.Message);
                }
            }
        }
Exemple #3
0
 private void GameOver()
 {
     TimerHeroMove.Stop();
     TimerHeroAnimate.Stop();
     TimerEnemyAnimate.Stop();
     TimerEnemyMove.Stop();
     heroImage = 0;
     TimerHeroMelt.Start();
     Food.Visible = false;
 }
Exemple #4
0
        private void TimerHeroMelt_Tick(object sender, EventArgs e)
        {
            string heroImageName;

            heroImageName   = "pacman_melt_" + heroImageCount;
            Hero.Image      = (Image)Properties.Resources.ResourceManager.GetObject(heroImageName);
            heroImageCount += 1;
            if (heroImageCount > 14)
            {
                TimerHeroMelt.Stop();
                LabelGameOver.Visible = true;
            }
        }
        private void TimerHeroMelt_Tick(object sender, EventArgs e)
        {
            string heroImageName;

            heroImage++; //heroImage += 1
            heroImageName = "pacman_melt_" + heroImage;
            Hero.Image    = (Image)Properties.Resources.ResourceManager.GetObject(heroImageName);
            if (heroImage > 14)
            {
                TimerHeroMelt.Stop();
                labelGameOver.Visible = true;
                buttonRestart.Visible = true;
            }
        }
        private void GameOver()
        {
            TimerHeroMove.Stop();
            TimerEnemyMove.Stop();
            TimerHeroAnimate.Stop();
            TimerEnemyAnimate.Stop();
            TimerHeroMelt.Start();


            labelGameOver.ForeColor = Color.White;
            labelGameOver.BackColor = Color.Transparent;
            this.BackColor          = Color.Black;
            buttonRestart.Enabled   = true;
            labelGameOver.Left      = ClientRectangle.Width / 2 - labelGameOver.Width / 2;
            labelGameOver.Top       = ClientRectangle.Height / 2 - labelGameOver.Top / 2;
            buttonRestart.Top       = ClientRectangle.Height - buttonRestart.Height * 2;
            buttonRestart.Left      = ClientRectangle.Width - buttonRestart.Width * 2;
            heroImage = 0;
        }