Ejemplo n.º 1
0
        public void LodLevel()
        {
            imgGameOver      = new ImgGameOver();
            intervalGameOver = SizeGame.HeighWindowGame;
            StateOfLevel     = StateOfLevel.Game;

            for (int i = 1; i <= 10; i++)
            {
                listInformationTank.Add(new InformationTank(new Point(540, i * 18)));
                listInformationTank.Add(new InformationTank(new Point(560, i * 18)));
            }

            string[] linesTileMap = Properties.Resources.Level_1.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);

            int x = 0, y = 0;

            foreach (string line in linesTileMap)
            {
                foreach (char c in line)
                {
                    if (c == 'B')
                    {
                        listBrickWall.Add(new BrickWall(new Point(x, y)));
                    }

                    x += SizeGame.WidtchSmoll;
                }
                x  = 0;
                y += SizeGame.HeighSmoll;
            }

            eagle = new Eagle(respawnEagle);

            tankPlayer = new SmallTankPlayer(respawnPlayer, Direction.Up);

            tankEnemy = new PlainTankEnemy(respawnEnemy1, Direction.Down);
            listTankEnemy.Add(tankEnemy);

            tankEnemy = new PlainTankEnemy(respawnEnemy2, Direction.Down);
            listTankEnemy.Add(tankEnemy);

            tankEnemy = new PlainTankEnemy(respawnEnemy3, Direction.Down);
            listTankEnemy.Add(tankEnemy);

            listTankPlayer.Add(tankPlayer);
            listEagle.Add(eagle);

            countEnemy = 3;
        }
Ejemplo n.º 2
0
        public void DownloadLevel(int n)
        {
            timerWin = 50;

            this.Clear();
            carentLevel = n;

            StateOfLevel = StateOfLevel.Download;

            string path = @"..\..\Resources\Content\Maps\" + carentLevel.ToString();

            string[] linesTileMap = File.ReadAllLines(path);
            TanksEnemy = linesTileMap[26];

            for (int i = 1; i <= 10; i++)
            {
                listInformation.Add(new InformationTank(new Point(27 * SettingsGame.WidtchSmoll, i * SettingsGame.HeighSmoll)));
                listInformation.Add(new InformationTank(new Point(28 * SettingsGame.WidtchSmoll, i * SettingsGame.HeighSmoll)));
            }

            listInformation.Add(new InformationAboutLevel(carentLevel, new Point(28 * SettingsGame.WidtchSmoll, 23 * SettingsGame.HeighSmoll)));
            listInformation.Add(new InformationAboutLivesPlayer(1));

            int x = 0, y = 0;

            foreach (string line in linesTileMap)
            {
                foreach (char c in line)
                {
                    switch (c)
                    {
                    case '#':
                        listWall.Add(new BrickWall(new Point(x, y)));
                        break;

                    case '@':
                        listWall.Add(new ConcreteWall(new Point(x, y)));
                        break;

                    case '~':
                        listWater.Add(new Water(new Point(x, y)));
                        break;

                    case '%':
                        listOther.Add(new Forest(new Point(x, y)));
                        break;

                    case '-':
                        listIce.Add(new Ice(new Point(x, y)));
                        break;
                    }
                    x += SettingsGame.WidtchSmoll;
                }
                x  = 0;
                y += SettingsGame.HeighSmoll;
            }

            informationDownloadLevel = new InformationDownloadLevel(carentLevel);

            eagle = new Eagle(respawnEagle);
            listPlayer.Add(eagle);
        }