Ejemplo n.º 1
0
 public new void MoveLeft()
 {
     if (leftBracket.positionX > 1)
     {
         leftBracket.MoveLeft();
         dwarf.MoveLeft();
         rightBracket.Hide();
         rightBracket.MoveLeft();
         leftBracket.Show();
         dwarf.Show();
         rightBracket.Show();
     }
 }
Ejemplo n.º 2
0
 public new void MoveRight()
 {
     if (rightBracket.positionX < fieldWidth - 1)
     {
         rightBracket.MoveRight();
         dwarf.MoveRight();
         leftBracket.Hide();
         leftBracket.MoveRight();
         rightBracket.Show();
         dwarf.Show();
         leftBracket.Show();
     }
 }
        /* ------------------------------------------------------------------------ Rocks Management ----------------------------------------------------------------*/
        public static void ManageRocks()
        {
            int count = 0;

            while (runFlag)
            {
                SetCounter(10);
                count++;
                if (shoot)
                {
                    bullet.Hide();
                    bullet.MoveUp();
                    if (bullet.positionY > 2)
                    {
                        bullet.Show();
                    }
                    else
                    {
                        bullet.positionX = 0;
                        bullet.positionY = 0;
                        shoot            = false;
                    }
                }
                lock (syncObject)
                {
                    Console.SetCursorPosition(fieldWidth - 30, 0);
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.Write("({0})", 10 - count);
                }

                if (count >= 10)
                {
                    GetSpecialRock();
                    rocksDensity--;
                    SetRocksSpeed(-30);
                    level++;
                    SetLevel();
                    SetWind();
                    count = 0;
                }
                ManageLists(bonusRocks);
                GetNewRocks(quickerRocks, 3);
                ManageLists(quickerRocks);
                Thread.Sleep(rocksSpeed / 5);
                ManageLists(bonusRocks);
                GetNewRocks(quickerRocks, 3);
                ManageLists(quickerRocks);
                Thread.Sleep(rocksSpeed / 5);
                ManageLists(bonusRocks);
                GetNewRocks(quickRocks, 2);
                ManageLists(quickRocks);
                GetNewRocks(slowRocks, 1);
                ManageLists(slowRocks);
                Thread.Sleep(rocksSpeed / 5);
                ManageLists(bonusRocks);
                GetNewRocks(quickerRocks, 3);
                ManageLists(quickerRocks);
                Thread.Sleep(rocksSpeed / 5);
                GetNewRocks(quickRocks, 2);
                ManageLists(quickRocks);
                if (soundFlag)
                {
                    //System.Media.SystemSounds.Asterisk.Play();
                    //System.Media.SystemSounds.Beep.Play();
                    //System.Media.SystemSounds.Exclamation.Play();
                    //System.Media.SystemSounds.Hand.Play();
                    //System.Media.SystemSounds.Question.Play();
                    Console.Beep(500, 10);
                }

                Thread.Sleep(rocksSpeed / 5);
            }
        }