private void RemoveCannon(int i) { Cannon cannon = ClosestCannon(Enemies[i]); Explosions.AddLast(new Explosion(cannon.Left - 35, cannon.Top)); Cannons.Remove(cannon); Enemies.RemoveAt(i); SoundCollection.PlayCrushSound(); ShakeForm(); }
private void chkPlayMusic_CheckedChanged(object sender, EventArgs e) { if (chkPlayMusic.Checked) { SoundCollection.ChangeMusicVolume(0); sldMusic.Enabled = false; } else { SoundCollection.ChangeMusicVolume((int)sldMusic.Value); sldMusic.Enabled = true; } }
private void chkSound_CheckedChanged(object sender, EventArgs e) { if (chkSound.Checked) { SoundCollection.ChangeSoundVolume(0); sldSound.Enabled = false; } else { SoundCollection.ChangeSoundVolume((int)sldSound.Value); sldSound.Enabled = true; } }
public FormMenu() { InitializeComponent(); SoundCollection.Initialize(); this.DoubleBuffered = true; frmScore = new FormHighScore(this); frmSettings = new FormSettings(this); frmHowTo = new FormHowTo(this); frmCredits = new FormCredits(this); Tema = new Theme(); Tema.addTheme(this); setTheme(); }
public bool ShootEnemy(string enemy) { Enemy res = null; foreach (Enemy enemyIterator in Enemies) { if (enemyIterator.Letter.ToString() == enemy) { res = enemyIterator; break; } } if (res != null) { if (res.Name == "SlowMotion") { TheForm.TimerCreateLetter.Interval = gameLevel.ENEMY_APPEAR_SLOW_MOTION; isSlowMotionActive = true; TimerSlowMotion.Start(); SoundCollection.PlaySlowMotionStart(); } if (res.Name == "Bonus") { TheForm.CurrentScore += gameLevel.POINTS_HIT * 5; TheForm.UpdateScore(); } if (res.Name == "Destroyer") { TheForm.CurrentScore += gameLevel.POINTS_HIT * Enemies.Count; TheForm.UpdateScore(); foreach (Enemy e in Enemies) { if (e.Name != "Destroyer") { Explosions.AddLast(new Explosion(e.Left - 50, e.Top - 25)); } } Enemies = new List <Enemy>(); } Enemies.Remove(res); DrawStrike(res); SoundCollection.PlayLaserSound(); return(true); } else { return(false); } }
void TimerSlowMotion_Tick(object sender, EventArgs e) { if (!TheForm.IsPaused) { if (SecoundsLeft > 1) { SecoundsLeft--; if (SecoundsLeft == 1) { SoundCollection.PlaySlowMotionFinish(); } } else { TimerSlowMotion.Dispose(); TheForm.TimerCreateLetter.Interval = gameLevel.ENEMY_APPEAR; SecoundsLeft = 5; isSlowMotionActive = false; } } }
private void sldMusic_Scroll(object sender, EventArgs e) { SoundCollection.ChangeMusicVolume((int)sldMusic.Value); }
private void sldSound_Scroll(object sender, EventArgs e) { SoundCollection.ChangeSoundVolume((int)sldSound.Value); }
private void FormMenu_Load(object sender, EventArgs e) { SoundCollection.PlayThemeSong(); }