Beispiel #1
0
        public static void Initialize(Engine engine)
        {
            int startRow = 1;
            int startCol = 5;
            int endRow = WorldRows - 35;
            int endCol = WorldCols - 5;

            for (int j = startRow; j < endRow; j = j + 5)
            {
                for (int i = startCol; i < endCol; i = i + 12)
                {
                    Alien currAlien = new Alien(new MatrixCoordinates(j, i));

                    engine.AddObject(currAlien);
                }
            }

            StartTitle newTitle = new StartTitle(new MatrixCoordinates(29, 27));
            engine.AddObject(newTitle);

            for (int row = 0; row < WorldRows; row++)
            {
                Wall leftWall = new Wall(new MatrixCoordinates(row, 1), new char[,] { { '|' } });
                engine.AddObject(leftWall);

                Wall rightWall = new Wall(new MatrixCoordinates(row, 78), new char[,] { { '|' } });
                engine.AddObject(rightWall);
            }

            for (int col = 1; col < WorldCols; col++)
            {
                Wall ceilingWall = new Wall(new MatrixCoordinates(0, col), new char[,] { { '-' } });
                engine.AddObject(ceilingWall);
            }
        }
Beispiel #2
0
        public static void Initialize(Engine engine)
        {
            int startRow = 1;
            int startCol = 5;
            int endRow   = WorldRows - 35;
            int endCol   = WorldCols - 5;

            for (int j = startRow; j < endRow; j = j + 5)
            {
                for (int i = startCol; i < endCol; i = i + 12)
                {
                    Alien currAlien = new Alien(new MatrixCoordinates(j, i));

                    engine.AddObject(currAlien);
                }
            }

            StartTitle newTitle = new StartTitle(new MatrixCoordinates(29, 27));

            engine.AddObject(newTitle);

            for (int row = 0; row < WorldRows; row++)
            {
                Wall leftWall = new Wall(new MatrixCoordinates(row, 1), new char[, ] {
                    { '|' }
                });
                engine.AddObject(leftWall);

                Wall rightWall = new Wall(new MatrixCoordinates(row, 78), new char[, ] {
                    { '|' }
                });
                engine.AddObject(rightWall);
            }

            for (int col = 1; col < WorldCols; col++)
            {
                Wall ceilingWall = new Wall(new MatrixCoordinates(0, col), new char[, ] {
                    { '-' }
                });
                engine.AddObject(ceilingWall);
            }
        }