Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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();
 }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
        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;
                }
            }
        }
Ejemplo n.º 7
0
 private void sldMusic_Scroll(object sender, EventArgs e)
 {
     SoundCollection.ChangeMusicVolume((int)sldMusic.Value);
 }
Ejemplo n.º 8
0
 private void sldSound_Scroll(object sender, EventArgs e)
 {
     SoundCollection.ChangeSoundVolume((int)sldSound.Value);
 }
Ejemplo n.º 9
0
 private void FormMenu_Load(object sender, EventArgs e)
 {
     SoundCollection.PlayThemeSong();
 }