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); } } }
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; } }