private static void Collision(ScreenElements rock)
        {
            switch (rock.value)
            {
            case '*': dwarf.IncreaseLives(); break;

            case '#': bombs.SetBombs(1, 41, 6); break;

            case '@': dwarf.DecreaseLives(); break;

            case '%': SetRocksSpeed(100); break;

            case '$': specialBombs.SetBombs(1, 69, 15); break;

            case '+': SetRocksSpeed(-100); break;

            case '&': SetRocksDensity(-3); break;

            case '!': SetRocksDensity(3); break;

            case ';': GameOver(); break;

            case '^': SetCounter(100); break;

            case '.': SetBullets(10); break;

            default: break;
            }
        }
Example #2
0
 public Dwarf(int fieldWidth, int fieldHeight)
 {
     leftBracket  = new ScreenElements(fieldWidth / 2 - 1, fieldHeight - 2, '(', 15);
     dwarf        = new ScreenElements(fieldWidth / 2, fieldHeight - 2, 'O', 15);
     rightBracket = new ScreenElements(fieldWidth / 2 + 1, fieldHeight - 2, ')', 15);
     leftBracket.Show();
     dwarf.Show();
     rightBracket.Show();
     this.fieldWidth = fieldWidth;
     this.dwarfLives = 3;
     this.ShowLives();
 }
 public Dwarf(int fieldWidth, int fieldHeight)
 {
     leftBracket = new ScreenElements(fieldWidth / 2 - 1, fieldHeight - 2, '(', 15);
     dwarf = new ScreenElements(fieldWidth / 2, fieldHeight - 2, 'O', 15);
     rightBracket = new ScreenElements(fieldWidth / 2 + 1, fieldHeight - 2, ')', 15);
     leftBracket.Show();
     dwarf.Show();
     rightBracket.Show();
     this.fieldWidth = fieldWidth;
     this.dwarfLives = 3;
     this.ShowLives();
 }
 private static void InitSpecialRocks()
 {
     specialRocks[0] = new ScreenElements(1, 1, '*', 10); // Gives Life;
     specialRocks[1] = new ScreenElements(1, 1, '%', 10); // Reduce the speed of the falling rocks;
     specialRocks[2] = new ScreenElements(1, 1, '#', 10); // Bomb - removes rocks and bonuses alike from the screen;
     specialRocks[3] = new ScreenElements(1, 1, '$', 10); // Special bomb - removes only the rocks from the screen;
     specialRocks[4] = new ScreenElements(1, 1, '&', 10); // Reduce density of the falling rocks;
     specialRocks[5] = new ScreenElements(1, 1, '^', 10); // Gives bonus points;
     specialRocks[6] = new ScreenElements(1, 1, '.', 10); // The player can shoot the rocks;
     specialRocks[7] = new ScreenElements(1, 1, '!', 12); // Increase the density of the rocks;
     specialRocks[8] = new ScreenElements(1, 1, '+', 12); // Increase the speed of the falling rocks;
     specialRocks[9] = new ScreenElements(1, 1, ';', 12); // Instant kill - the player is killed instantly;
 }
 private static void InitSpecialRocks()
 {
     specialRocks[0] = new ScreenElements(1, 1, '*', 10); // Gives Life;
     specialRocks[1] = new ScreenElements(1, 1, '%', 10); // Reduce the speed of the falling rocks;
     specialRocks[2] = new ScreenElements(1, 1, '#', 10); // Bomb - removes rocks and bonuses alike from the screen;
     specialRocks[3] = new ScreenElements(1, 1, '$', 10); // Special bomb - removes only the rocks from the screen;
     specialRocks[4] = new ScreenElements(1, 1, '&', 10); // Reduce density of the falling rocks;
     specialRocks[5] = new ScreenElements(1, 1, '^', 10); // Gives bonus points;
     specialRocks[6] = new ScreenElements(1, 1, '.', 10); // The player can shoot the rocks;
     specialRocks[7] = new ScreenElements(1, 1, '!', 12); // Increase the density of the rocks;
     specialRocks[8] = new ScreenElements(1, 1, '+', 12); // Increase the speed of the falling rocks;
     specialRocks[9] = new ScreenElements(1, 1, ';', 12);  // Instant kill - the player is killed instantly;
 }
        private static void Collision(ScreenElements rock)
        {
            switch (rock.value)
            {
                case '*': dwarf.IncreaseLives(); break;
                case '#': bombs.SetBombs(1, 41, 6); break;
                case '@': dwarf.DecreaseLives(); break;
                case '%': SetRocksSpeed(100); break;
                case '$': specialBombs.SetBombs(1, 69, 15); break;
                case '+': SetRocksSpeed(-100); break;
                case '&': SetRocksDensity(-3); break;
                case '!': SetRocksDensity(3); break;
                case ';': GameOver(); break;
                case '^': SetCounter(100); break;
                case '.': SetBullets(10); break;

                default: break;
            }
        }