Inheritance: AcademyPopcorn.Ball
コード例 #1
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 1;
            int endCol = WorldCols - 1;
            int endRow = 10;

            //generate level
            for (int i = startCol; i < endCol; i++)
            {
                for (int j = startRow; j < endRow; j++)
                {
                    Block currBlock = BlockFactory.GetBlock(generator.Next(1, 10), new MatrixCoords(j, i));

                    engine.AddObject(currBlock);
                }
            }

            //Ball theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2 + 1 , 0), new MatrixCoords(-1, 1));

            Ball megaBall = new UnstoppableBall(new MatrixCoords(WorldRows - 1, WorldCols/2 +1), new MatrixCoords(-1, 1));

            engine.AddObject(megaBall);

            //engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #2
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            for (int i = 0; i < endCol + 2; i++)
            {
                engine.AddObject(new IndestructibleBlock(new MatrixCoords(startRow - 1, i)));
            }

            for (int i = startRow; i < 32; i++)
            {
                engine.AddObject(new IndestructibleBlock(new MatrixCoords(i, 0)));
                engine.AddObject(new IndestructibleBlock(new MatrixCoords(i, endCol + 1)));
            }

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                                          new MatrixCoords(-1, 1), -1);

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #3
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 1;
            int endCol   = WorldCols - 1;
            int endRow   = 10;

            //generate level
            for (int i = startCol; i < endCol; i++)
            {
                for (int j = startRow; j < endRow; j++)
                {
                    Block currBlock = BlockFactory.GetBlock(generator.Next(1, 10), new MatrixCoords(j, i));

                    engine.AddObject(currBlock);
                }
            }

            //Ball theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2 + 1 , 0), new MatrixCoords(-1, 1));

            Ball megaBall = new UnstoppableBall(new MatrixCoords(WorldRows - 1, WorldCols / 2 + 1), new MatrixCoords(-1, 1));

            engine.AddObject(megaBall);

            //engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #4
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block secondBlock = new Block(new MatrixCoords(startRow + 1, i));
                engine.AddObject(secondBlock);
            }

            for (int i = 3; i < 10; i++)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow + 3, i * 3));
                engine.AddObject(currBlock);
            }

            engine.AddObject(new ExplodingBlock(new MatrixCoords(startRow + 3, endCol - 1)));
            engine.AddObject(new ExplodingBlock(new MatrixCoords(startRow + 3, endCol - 5)));
            engine.AddObject(new ExplodingBlock(new MatrixCoords(startRow, endCol - 4)));
            engine.AddObject(new ExplodingBlock(new MatrixCoords(startRow, endCol - 9)));
            engine.AddObject(new ExplodingBlock(new MatrixCoords(startRow, 12)));
            engine.AddObject(new ExplodingBlock(new MatrixCoords(startRow, 17)));
            engine.AddObject(new GiftBlock(new MatrixCoords(startRow, 5)));
            engine.AddObject(new GiftBlock(new MatrixCoords(startRow, 10)));
            engine.AddObject(new GiftBlock(new MatrixCoords(startRow, 15)));

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            //engine.AddObject(theBall);

            MeteoriteBall metBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            engine.AddObject(metBall);

            UnstoppableBall unstopBall = new UnstoppableBall(new MatrixCoords(22, 10), new MatrixCoords(-1, 1));
            engine.AddObject(unstopBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            for (int i = 0; i < WorldRows; i++)
            {
                engine.AddObject(new IndestructibleBlock(new MatrixCoords(i, 0)));
                engine.AddObject(new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1)));
            }
            for (int i = 0; i < WorldCols; i++)
            {
                engine.AddObject(new IndestructibleBlock(new MatrixCoords(0, i)));
            }
            for (int i = 0; i < WorldCols; i++)
            {
                engine.AddObject(new GameOverBlock(new MatrixCoords(WorldRows, i)));
            }
            engine.AddTrailingObject(new TrailObject(new MatrixCoords(15, 20), new char[,] { { 'S', 't', 'a', 'r', 't' }, { 'G', 'a', 'm', 'e', ' ' } }, 10));
        }
コード例 #5
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock indBlock = new IndestructibleBlock(new MatrixCoords(0, i));

                engine.AddObject(indBlock);
            }

            for (int i = 1; i < WorldRows; i++)
            {
                IndestructibleBlock indBlock = new IndestructibleBlock(new MatrixCoords(i, 0));

                engine.AddObject(indBlock);
            }

            for (int i = 1; i < WorldRows; i++)
            {
                IndestructibleBlock indBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));

                engine.AddObject(indBlock);
            }

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);

            //Ball theMeteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            //engine.AddObject(theMeteoriteBall);

            Ball theUnsBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));

            engine.AddObject(theUnsBall);

            UnpassableBlock theUnpasBlock = new UnpassableBlock(new MatrixCoords(WorldRows - 19, WorldCols - 21));

            engine.AddObject(theUnpasBlock);

            GiftBlock theGiftBlock = new GiftBlock(new MatrixCoords(5, 7));

            engine.AddObject(theGiftBlock);
        }
コード例 #6
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                if (i == 3)
                {
                    ExplodingBlock expBlock = new ExplodingBlock(new MatrixCoords(startRow, i));
                    engine.AddObject(expBlock);
                    continue;
                }
                if (i == 2)
                {
                    GiftBlock giftblock = new GiftBlock(new MatrixCoords(startRow, i));
                    engine.AddObject(giftblock);
                    continue;
                }
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

               // Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
               //     new MatrixCoords(-1, 1));
            //MeteoriteBall theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            for (int i = startRow; i < Console.BufferHeight; i++)
            {
                engine.AddObject(new UnpassableBlock(new MatrixCoords(i, startCol - 1)));
            }
            for (int i = startRow; i < Console.BufferHeight; i++)
            {
                engine.AddObject(new UnpassableBlock(new MatrixCoords(i, WorldCols - 2)));
            }
            for (int i = startCol-1; i < WorldCols-1; i++)
            {
                engine.AddObject(new UnpassableBlock(new MatrixCoords(startRow - 1, i)));
            }
            Random rnd = new Random();
            for (int i = 0; i < 5; i++)
            {
                engine.AddObject(new UnpassableBlock(new MatrixCoords((rnd.Next(0, WorldCols)), (rnd.Next(0, WorldRows)))));
            }
        }
コード例 #7
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            // Task 1
            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock leftWall = new IndestructibleBlock(new MatrixCoords(i, 0));
                engine.AddObject(leftWall);
                IndestructibleBlock rightWall = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));
                engine.AddObject(rightWall);
            }

            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock ceiling = new IndestructibleBlock(new MatrixCoords(0, i));
                engine.AddObject(ceiling);
            }

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            // Task 5, 6, 7
            MeteoriteBall meteor = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));

            engine.AddObject(meteor);

            // Task 8, 9
            UnstoppableBall unstoppable = new UnstoppableBall(new MatrixCoords(4, 4), new MatrixCoords(1, 1));

            engine.AddObject(unstoppable);
            UnpassableBlock unpassable = new UnpassableBlock(new MatrixCoords(9, 9));

            engine.AddObject(unpassable);
            // Task 10
            ExplodingBlock explodeBlock = new ExplodingBlock(new MatrixCoords(8, 8));

            engine.AddObject(explodeBlock);

            // Task 11, 12
            GiftBlock gift = new GiftBlock(new MatrixCoords(10, 10));

            engine.AddObject(gift);
        }
コード例 #8
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                //if (i == 7)//Task 10 -> the first block that the ball hits is exploadable
                //{
                //    currBlock = new ExplodingBlock(new MatrixCoords(startRow, i));
                //}
                //Task 12 - bellow
                //if (i == endCol - 3) //the second block that the ball hits
                //{
                //    currBlock = new GiftBlock(new MatrixCoords(startRow, i));
                //}
                engine.AddObject(currBlock);
            }
            // Add walls - Task 1
            for (int row = 2; row < WorldRows; row++)
            {
                IndestructibleBlock leftWall = new IndestructibleBlock(new MatrixCoords(row, 0));
                IndestructibleBlock rightWall = new IndestructibleBlock(new MatrixCoords(row, WorldCols - 1));
                engine.AddObject(leftWall);
                engine.AddObject(rightWall);
            }
            for (int col = 0; col < WorldCols; col++)
            {
                IndestructibleBlock topWall = new IndestructibleBlock(new MatrixCoords(2, col));
                engine.AddObject(topWall);
            }
            // Task 9 - the UnpassableBlock, indestructible block
            //for (int i = 2; i < WorldCols / 2; i += 4)
            //{
            //    engine.AddObject(new UnpassableBlock(new MatrixCoords(4, i)));
            //}
            //Task 7 --> Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.
            //Ball meteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            //engine.AddObject(meteoriteBall);

            //Task 9 - > the ball destroys all, but bounces off UnpassableBlocks and the wall (so that we can keep playing :) )
            Ball theUnstopableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            engine.AddObject(theUnstopableBall);

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #9
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i), new [,] {{'#'}});

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 1, i), new[,] { { '#' } });

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 2, i), new[,] { { '#' } });

                engine.AddObject(currBlock);
            }

            Racket someRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            engine.AddObject(someRacket);

            for (int row = 3; row < WorldRows; row++)
            {
                UnpassableBlock leftWall = new UnpassableBlock(new MatrixCoords(row, 1));
                engine.AddObject(leftWall);
                UnpassableBlock rightWall = new UnpassableBlock(new MatrixCoords(row, endCol));
                engine.AddObject(rightWall);
            }
            for (int col = 1; col <= endCol; col++)
            {
                IndestructibleBlock topWall = new IndestructibleBlock(new MatrixCoords(startRow - 1, col));
                engine.AddObject(topWall);
            }

            //MeteoriteBall meteoriteBall = new MeteoriteBall(new MatrixCoords(7, 7), new MatrixCoords(1, 1));
            //engine.AddObject(meteoriteBall);

            UnstoppableBall unstoppableBall = new UnstoppableBall(new MatrixCoords(7, 7), new MatrixCoords(1, 1));
            engine.AddObject(unstoppableBall);

            ExplodingBlock explodingBlock = new ExplodingBlock(new MatrixCoords(startRow + 3, 15));
            engine.AddObject(explodingBlock);

            GiftBlock giftBlock = new GiftBlock(new MatrixCoords(startRow + 3, endCol - 1));
            engine.AddObject(giftBlock);
        }
コード例 #10
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            //Problem One - Create ceiling wall
            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock ceilBlock = new IndestructibleBlock(new MatrixCoords(0, i));

                engine.AddObject(ceilBlock);
            }

            //Problem One - Create side walls
            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock leftBlock = new IndestructibleBlock(new MatrixCoords(i, 0));
                IndestructibleBlock rightBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));

                engine.AddObject(leftBlock);
                engine.AddObject(rightBlock);
            }

            for (int i = startCol; i < endCol; i++)
            {
                //Problem Nine - Test UnpassableBlock
                //UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow, i));

                //Problem Ten - Test ExplodingBlock
                //ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow, i));

                //Problem Twelve - Test GiftBlock
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            //Problem Seven - Test MeteoriteBall
            //MeteoriteBall theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            //Problem Nine - Test UnstoppableBall
            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            //Problem Thirteen - Test ShootingRacket
            ShootingRacket theRacket = new ShootingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #11
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int endRow = WorldRows;
            int startCol = 2;
            int endCol = WorldCols - 2;


            //Task 1: Implementing Game field with adding a "for cycle" for rows
            //Task 10: Using UnpassableBlock 
            for (int row = startRow; row < endRow; row++)
            {
                for (int col = startCol; col < endCol; col++)
                {
                    if (row == startRow)
                    {
                        UnpassableBlock unpassable = new UnpassableBlock(new MatrixCoords(row, col));
                        engine.AddObject(unpassable);
                    }
                    if (row != startRow && (col == startCol || col == endCol - 1))
                    {
                        UnpassableBlock unpassable = new UnpassableBlock(new MatrixCoords(row, col));
                        engine.AddObject(unpassable);
                    }
                    else if (row <= startRow + 5 && row != startRow)
                    {
                        //Task12: Implementing GiftBlock.cs 
                        GiftBlock currBlock = new GiftBlock(new MatrixCoords(row, col));
                        engine.AddObject(currBlock);
                    }
                }

            }

            // Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 10),
            //     new MatrixCoords(-1, 1));

            //Task7: Implementing Meteorit Ball 
            //MeteoritBall meteoritBall = new MeteoritBall(new MatrixCoords(WorldRows / 2, 10), new MatrixCoords(-1, 1));

            //Task9: Implement Unstoppable ball
            UnstoppableBall ultimateBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 10), new MatrixCoords(-1, 1));

            engine.AddObject(ultimateBall);

            //TODO - Task 13: Implementing Shooting Ability
            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            engine.AddObject(theRacket);


        }
コード例 #12
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            for (int i = startCol; i < endCol; i++)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow - 2, i));

                engine.AddObject(currBlock);
            }

            for (int i = startCol; i < endCol; i+=2)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 1, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i += 2)
            {
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow + 2, i));

                engine.AddObject(currBlock);
            }
            Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            UnstoppableBall unstoppable = new UnstoppableBall(new MatrixCoords(WorldRows / 2+4, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);
            engine.AddObject(unstoppable);

            ShoothingRacket theRacket = new ShoothingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            //TrailObject test = new TrailObject(3, new MatrixCoords(5, 5), new char[1, 1]{{'H'}});
            //engine.AddObject(test);

            //walls
            InitializeWalls(engine);
        }
コード例 #13
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            // Task 1
            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock leftWall = new IndestructibleBlock(new MatrixCoords(i, 0));
                engine.AddObject(leftWall);
                IndestructibleBlock rightWall = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));
                engine.AddObject(rightWall);
            }

            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock ceiling = new IndestructibleBlock(new MatrixCoords(0, i));
                engine.AddObject(ceiling);
            }

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            // Task 5, 6, 7
            MeteoriteBall meteor = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            engine.AddObject(meteor);

            // Task 8, 9
            UnstoppableBall unstoppable = new UnstoppableBall(new MatrixCoords(4,4), new MatrixCoords(1, 1));
            engine.AddObject(unstoppable);
            UnpassableBlock unpassable = new UnpassableBlock(new MatrixCoords(9, 9));
            engine.AddObject(unpassable);
            // Task 10
            ExplodingBlock explodeBlock = new ExplodingBlock( new MatrixCoords(8,8));
            engine.AddObject(explodeBlock);

            // Task 11, 12
            GiftBlock gift = new GiftBlock(new MatrixCoords(10, 10));
            engine.AddObject(gift);
        }
コード例 #14
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            //task one
            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock ceilBlock = new IndestructibleBlock(new MatrixCoords(0, i));

                engine.AddObject(ceilBlock);
            }

            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock leftBlock = new IndestructibleBlock(new MatrixCoords(i, 0));
                IndestructibleBlock rightBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));

                engine.AddObject(leftBlock);
                engine.AddObject(rightBlock);
            }
            //

            //nineth task
            //tenth task
            //twelfth task
            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            //seventh task
            //nineth task
            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            //thirdteenth task
            ShootingRacket theRacket = new ShootingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #15
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            InitializeBlocks(engine, startRow, startCol, endCol);
            CreateFieldBorders(engine, startRow, startCol, endCol);

            Ball theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 2),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #16
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            InitializeBlocks(engine, startRow, startCol, endCol);
            CreateFieldBorders(engine, startRow, startCol, endCol);

            Ball theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 2),
                                               new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #17
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                //ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow, i));
                GiftBlock giftBlock = new GiftBlock(new MatrixCoords(startRow + 1, i));
                // engine.AddObject(currBlock);
                engine.AddObject(giftBlock);
            }
            // upper wall
            for (int col = 0; col < WorldCols; col++)
            {
                UnpassableBlocks block = new UnpassableBlocks(new MatrixCoords(0, col));
                engine.AddObject(block);
            }

            // left and right wall
            for (int row = 1; row < WorldRows; row++)
            {
                UnpassableBlocks leftblock  = new UnpassableBlocks(new MatrixCoords(row, 0));
                UnpassableBlocks rIghtblock = new UnpassableBlocks(new MatrixCoords(row, WorldCols - 1));
                engine.AddObject(leftblock);
                engine.AddObject(rIghtblock);
            }

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                                          new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket  = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            Racket theRacket1 = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength + 3);

            engine.AddObject(theRacket);
            engine.AddObject(theRacket1);
            //    Gift gift = new Gift(new MatrixCoords(0, 5));
            //    engine.AddObject(gift);
        }
コード例 #18
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;
            
            for (int i = startCol; i < endCol; i++)
            {
                //ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow, i));
                GiftBlock giftBlock = new GiftBlock(new MatrixCoords(startRow + 1, i));
                // engine.AddObject(currBlock);
                engine.AddObject(giftBlock);
            }
            // upper wall
            for (int col = 0; col < WorldCols; col++)
            {
                UnpassableBlocks block = new UnpassableBlocks(new MatrixCoords(0, col));
                engine.AddObject(block);
            }

            // left and right wall 
            for (int row = 1; row < WorldRows; row++)
            {
                UnpassableBlocks leftblock = new UnpassableBlocks(new MatrixCoords(row, 0));
                UnpassableBlocks rIghtblock = new UnpassableBlocks(new MatrixCoords(row, WorldCols - 1));
                engine.AddObject(leftblock);
                engine.AddObject(rIghtblock);
            }

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            Racket theRacket1 = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength + 3);
            engine.AddObject(theRacket);
            engine.AddObject(theRacket1);
            //    Gift gift = new Gift(new MatrixCoords(0, 5));
            //    engine.AddObject(gift);
        }
コード例 #19
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            // Task 1
            for (int j = 1; j < WorldRows; j++)
            {
                IndestructibleBlock leftBlock = new IndestructibleBlock(new MatrixCoords(j, 0));
                IndestructibleBlock rightBlock = new IndestructibleBlock(new MatrixCoords(j, WorldCols - 1));
                engine.AddObject(leftBlock);
                engine.AddObject(rightBlock);
            }

            // Task 1
            for (int z = 0; z < WorldCols; z++)
            {
                IndestructibleBlock topBlock = new IndestructibleBlock(new MatrixCoords(1, z));
                engine.AddObject(topBlock);
            }

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            //TrailObject trail = new TrailObject(new MatrixCoords(10, 10), new char[,] { {'T'} }, 10);
            //engine.AddObject(trail);
        }
コード例 #20
0
        static void Initialize(Engine engine)
        {
            int startRow = 2;
            int startCol = 1;
            int endCol = WorldCols - 2;

            for (int i = startCol; i <= endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            Ball theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #21
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;
            for (int i = startCol; i < endCol/2; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }
            for (int i = (endCol/2); i < endCol; i++) // making unpassable blocks
            {
                UnpassableBlock unpBlock = new UnpassableBlock(new MatrixCoords(startRow, i));
                engine.AddObject(unpBlock);
            }
            Ball theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2 + 1 , 0), new MatrixCoords(-1, 1));
            Ball unstBall = new UnstoppableBall(new MatrixCoords(10, WorldCols - 1), new MatrixCoords(-1, -1)); //creating unstoppable ball
            engine.AddObject(unstBall);
            engine.AddObject(theBall);
            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            engine.AddObject(theRacket);
        }
コード例 #22
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                engine.AddObject(currBlock);
            }
            //10
            ExplodingBlock exBlock = new ExplodingBlock(new MatrixCoords(4, 30));

            engine.AddObject(exBlock);
            //END 10

            //01.The AcademyPopcorn class contains an IndestructibleBlock class.
            //Use it to create side and ceiling walls to the game. You can ONLY edit the
            //AcademyPopcornMain.cs file.

            for (int row = 0; row < 40; row++)
            {
                IndestructibleBlock leftSideBlock  = new IndestructibleBlock(new MatrixCoords(row, 0));
                IndestructibleBlock rightSideBlock = new IndestructibleBlock(new MatrixCoords(row, WorldCols - 1));
                engine.AddObject(leftSideBlock);
                engine.AddObject(rightSideBlock);
            }

            for (int col = 0; col < WorldCols; col++)
            {
                IndestructibleBlock ceilingBlock = new IndestructibleBlock(new MatrixCoords(0, col));
                engine.AddObject(ceilingBlock);
            }
            //END 01

            //05
            TrailObject trailObj = new TrailObject(new MatrixCoords(8, 8), 8);
            //engine.AddObject(trailObj);
            //END 05

            //07.Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.
            MeteoriteBall metBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));

            engine.AddObject(metBall);
            //END 07

            //09
            ImpassableBlock imPassBlock = new ImpassableBlock(new MatrixCoords(4, 7));

            engine.AddObject(imPassBlock);
            UnstoppableBall unstopBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                                             new MatrixCoords(-1, 1));
            //engine.AddObject(unstopBall);
            //END 09

            //12
            GiftBlock gift = new GiftBlock(new MatrixCoords(7, 25));

            engine.AddObject(gift);
            //END 12

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            //engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #23
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 1, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 2, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol / 3; i++)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow + 4, i));

                engine.AddObject(currBlock);
            }

            // Exploding blocks. Chain reaction :)
            for (int i = endCol/2; i < endCol; i++)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(currBlock);
            }

            //Gift testGift = new Gift(new MatrixCoords(10, 20));
            //engine.AddObject(testGift);

            GiftBlock giftBlock = new GiftBlock(new MatrixCoords(7, 25));
            engine.AddObject(giftBlock);

            // TASK 1
            startCol = 0;
            endCol = WorldRows - 1;

            for (int i = startRow; i < endCol; i++) // LEFT SIDE
            {
                IndestructibleBlock currBlock = new IndestructibleBlock(new MatrixCoords(i, startCol));

                engine.AddObject(currBlock);
            }

            startCol = WorldCols - 1;

            for (int i = startRow; i < endCol; i++) // RIGHT SIDE
            {
                IndestructibleBlock currBlock = new IndestructibleBlock(new MatrixCoords(i, startCol));

                engine.AddObject(currBlock);
            }

            startRow = 2;
            startCol = 0;
            endCol = WorldCols;

            for (int i = startCol; i < endCol; i++) // CEILING
            {
                IndestructibleBlock currBlock = new IndestructibleBlock(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            // END TASK 1

            // Bellow the three balls are added to the engine
            Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            MeteoriteBall theMeteoriteBall = new MeteoriteBall(new MatrixCoords(20, 9),
                new MatrixCoords(-1, 1));

            UnstoppableBall theUnstoppableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 25),
               new MatrixCoords(-1, 1));

            engine.AddObject(theBall);
            engine.AddObject(theMeteoriteBall);
            engine.AddObject(theUnstoppableBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            // Part of TASK 5
            //TrailObject trailObject = new TrailObject(new MatrixCoords(10, 20), 5);

            //engine.AddObject(trailObject);
        }
コード例 #24
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            // "paint" blocks
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 2),
                                    new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            //TrailObject trailObject = new TrailObject(new MatrixCoords(4, 4), 3);
            //engine.AddObject(trailObject);

            // Таск 7
            // Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.

            //MeteoriteBall mBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2 + 1, 1), new MatrixCoords(-1, 1), 3);
            //engine.AddObject(mBall);

            // task 9
            // Test the UnpassableBlock and the UnstoppableBall by adding them
            // to the engine in AcademyPopcornMain.cs file

            UnstoppableBall unBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 2),
                                                         new MatrixCoords(-1, 1));
            //engine.AddObject(unBall);

            // "paint" unpassable blocks
            //for (int i = startCol; i < endCol; i++)
            //{
            //    UnpassableBlock currBlockTwo = new UnpassableBlock(new MatrixCoords(startRow + 2, i));

            //    engine.AddObject(currBlockTwo);
            //}

            // task 10
            //for (int i = startCol; i < endCol; i++)
            //{
            //    ExplodingBlock exBlock = new ExplodingBlock(new MatrixCoords(startRow + 2, i));
            //    engine.AddObject(exBlock);
            //}

            // task 11
            Gift gift = new Gift(new MatrixCoords(7, 15), new MatrixCoords(1, 0));

            engine.AddObject(gift);

            // task 12
            GiftBlock giftBlock = new GiftBlock(new MatrixCoords(5, 8));

            engine.AddObject(giftBlock);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            // task 1
            // The AcademyPopcorn class contains an IndestructibleBlock class.
            // Use it to create side and ceiling walls to the game.
            // You can ONLY edit the AcademyPopcornMain.cs file.
            for (int row = 0; row < WorldRows; row++)
            {
                IndestructibleBlock borderBlockLeft = new IndestructibleBlock(new MatrixCoords(row, 0));
                engine.AddObject(borderBlockLeft);
            }

            for (int row = 0; row < WorldRows; row++)
            {
                IndestructibleBlock borderBlockRight = new IndestructibleBlock(new MatrixCoords(row, WorldCols - 1));
                engine.AddObject(borderBlockRight);
            }

            for (int coll = 0; coll < WorldCols; coll++)
            {
                IndestructibleBlock borderBlockRight = new IndestructibleBlock(new MatrixCoords(0, coll));
                engine.AddObject(borderBlockRight);
            }
        }
コード例 #25
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            #region Add some layers of ordinary blocks and a layer of exploding block in the middle

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock1 = new Block(new MatrixCoords(startRow, i));
                Block currBlock2 = new Block(new MatrixCoords(startRow + 1, i));
                Block currBlock3 = new Block(new MatrixCoords(startRow + 2, i));

                engine.AddObject(currBlock1);
                engine.AddObject(currBlock2);
                engine.AddObject(currBlock3);
            }

            for (int i = startCol; i < endCol; i++)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(currBlock);
            }

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock1 = new Block(new MatrixCoords(startRow + 4, i));
                Block currBlock2 = new Block(new MatrixCoords(startRow + 5, i));
                Block currBlock3 = new Block(new MatrixCoords(startRow + 6, i));

                engine.AddObject(currBlock1);
                engine.AddObject(currBlock2);
                engine.AddObject(currBlock3);
            }

            #endregion

            #region Add a layer of gift objects

            //for (int i = startCol; i < endCol; i++)
            //{
            //    GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow, i));

            //    engine.AddObject(currBlock);
            //}

            #endregion

            #region Create side walls and a ceiling

            // create side walls
            for (int i = 0; i < WorldRows; i++)
            {
                // create a block for the left wall
                IndestructibleBlock leftWallBlock = new IndestructibleBlock(new MatrixCoords(i, 0));
                // create a block for the right wall
                IndestructibleBlock rightWallBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));

                engine.AddObject(leftWallBlock);
                engine.AddObject(rightWallBlock);
            }

            for (int i = 0; i < WorldCols; i++)
            {
                // create a block for the ceiling
                IndestructibleBlock ceilingBlock = new IndestructibleBlock(new MatrixCoords(0, i));

                engine.AddObject(ceilingBlock);
            }

            #endregion

            #region Add an impassable wall

            //for (int i = startRow + 1; i < WorldRows; i++)
            //{
            //    // create an impassable block
            //    ImpassableBlock impassableBlock = new ImpassableBlock(new MatrixCoords(i, 2 * WorldCols / 3 + 2));

            //    engine.AddObject(impassableBlock);
            //}

            #endregion

            #region Create an ordinary ball

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            #endregion

            #region Replace the ordinary ball with a MeteoriteBall object

            //MeteoriteBall theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1), 3);

            #endregion

            #region Replace the ordinary ball with an UnstoppableBall object

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));

            #endregion

            engine.AddObject(theBall);

            #region Add the racket

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            #endregion

            #region Add an instance of the TrailObject class

            //TrailObject ephemera = new TrailObject(
            //    new MatrixCoords(WorldRows / 3, WorldCols / 3), new char[,] { { '@' } }, 10);

            //engine.AddObject(ephemera);

            #endregion

            #region Add a single gift

            Gift gift = new Gift(new MatrixCoords(WorldRows / 3, WorldCols / 3), new char[,] { { '@' } });

            engine.AddObject(gift);

            #endregion
        }
コード例 #26
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            //The AcademyPopcorn class contains an IndestructibleBlock class. Use it to create side and ceiling walls to the game. You can ONLY edit the AcademyPopcornMain.cs file
            IndestructibleBlock indestructibleBlock = null;
            for (int row = 0; row < WorldRows; row++)
            {
                for (int col = 0; col < WorldCols; col++)
                {
                    if (row == 0)
                    {
                        indestructibleBlock = new IndestructibleBlock(new MatrixCoords(row, col));
                        engine.AddObject(indestructibleBlock);
                    }
                    else if (col == 0 || col == WorldCols - 1)
                    {
                        indestructibleBlock = new IndestructibleBlock(new MatrixCoords(row, col));
                        engine.AddObject(indestructibleBlock);
                    }
                }
            }

            for (int i = startCol; i < endCol; i++)
            {
                switch (i % 5)
                {
                    case 0:
                        ExplodingBlock explodingBlock = new ExplodingBlock(new MatrixCoords(startRow, i));
                        engine.AddObject(explodingBlock);
                        break;
                    default:
                        switch (i % 3)
                        {
                            case 0:
                                GiftBlock giftBlock = new GiftBlock(new MatrixCoords(startRow, i));
                                engine.AddObject(giftBlock);
                                break;
                            default:
                                Block currBlock = new Block(new MatrixCoords(startRow, i));
                                engine.AddObject(currBlock);
                                break;
                        }
                        break;
                }

            }

            for (int i = 4; i < endCol; i+=3)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(8, i));

                engine.AddObject(currBlock);
            }

            TrailObject to = new TrailObject(new MatrixCoords(5, 6), 15);
            engine.AddObject(to);

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            ShootingRacket theRacket = new ShootingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #27
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                engine.AddObject(currBlock);
                Block currBlock2 = new Block(new MatrixCoords(startRow + 2, i));
                engine.AddObject(currBlock2);
            }

            Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
              //  engine.AddObject(theBall);
            //7.Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.

               // MeteoriteBall theMeteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1), 3);
               // engine.AddObject(MatrixCoords);

            //9.Test the UnpassableBlock and the UnstoppableBall by adding them to the engine in AcademyPopcornMain.cs file

            UnstoppableBall unstopBall=new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            engine.AddObject(unstopBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            //add side walls
            /*1.The AcademyPopcorn class contains an IndestructibleBlock class. Use it to create side and ceiling walls to the game.
             * You can ONLY edit the AcademyPopcornMain.cs file. */

            for (int row = 0; row < WorldRows; row++)
            {
                IndestructibleBlock leftWallBlock = new IndestructibleBlock(new MatrixCoords(row, 0));
                engine.AddObject(leftWallBlock);
                IndestructibleBlock rightWallBlock = new IndestructibleBlock(new MatrixCoords(row,WorldCols-1));
                engine.AddObject(rightWallBlock);

            }

            for (int row = 0; row < WorldCols; row++)
            {
                 IndestructibleBlock topper = new IndestructibleBlock(new MatrixCoords(0, row));
                engine.AddObject(topper);
               // IndestructibleBlock bottem = new IndestructibleBlock(new MatrixCoords(WorldRows-2, row));
               // engine.AddObject(bottem);
            }

             for (int i = 1; i < WorldCols; i+=5)
            {
                ExplodingBlock explosion = new ExplodingBlock(new MatrixCoords(3, i));
                engine.AddObject(explosion);
            }

            for (int i = 1; i < WorldCols; i += 5)
            {
                GiftBlock giftBlock = new GiftBlock(new MatrixCoords(4, i));
                engine.AddObject(giftBlock);
            }

            ShootingRacket shoot = new ShootingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            engine.AddObject(shoot);
        }
コード例 #28
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock0 = new Block(new MatrixCoords(startRow-1, i));
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
                engine.AddObject(currBlock0);
            }

               //ExplodingBlock makes trails
             ExplodingBlock explodingBlock = new ExplodingBlock(new MatrixCoords(4,7));
             engine.AddObject(explodingBlock);

            //Ordinary ball
            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);

            //Meteorite Ball makes trails when it moves
            //MeteoriteBall meteroitBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            // engine.AddObject(meteroitBall);

            //Unstoppable Ball, can be stopped only by Unpassable Block
            UnstoppableBall unstoppableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            engine.AddObject(unstoppableBall);

            //Falling gift
            Gift giftObject = new Gift(new MatrixCoords(5, 15),
                new MatrixCoords(-1, 0));

            engine.AddObject(giftObject);

            //Gift Block
            GiftBlock giftBlock = new GiftBlock(new MatrixCoords(10, 10));
            engine.AddObject(giftBlock);

            //UnpassableBlock
            UnpassableBlock unpassableBlock = new UnpassableBlock(new MatrixCoords(15, 15));
            engine.AddObject(unpassableBlock);
            UnpassableBlock unpassableBlock1 = new UnpassableBlock(new MatrixCoords(15, 16));
            engine.AddObject(unpassableBlock1);
            UnpassableBlock unpassableBlock2 = new UnpassableBlock(new MatrixCoords(15, 17));
            engine.AddObject(unpassableBlock2);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

               //Creating second Racket
               //When you add second racket by addObject method, it checks whether the game has already a racket
               //If it does, we are removing the previous, and adding the new one.
               //Racket secondRacket = new Racket(new MatrixCoords(WorldRows -10, WorldCols / 2), RacketLength);
               //engine.AddObject(secondRacket);

            TrailObject trailObject = new TrailObject(new MatrixCoords(1, 1), 20);

            engine.AddObject(trailObject);

            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock indestructibleBlockLeft = new IndestructibleBlock(new MatrixCoords(i,0));
                IndestructibleBlock indestructibleBlockRight = new IndestructibleBlock(new MatrixCoords(i, WorldCols-1));
                engine.AddObject(indestructibleBlockLeft);
                engine.AddObject(indestructibleBlockRight);
            }

            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock indestructibleBlockCeiling = new IndestructibleBlock(new MatrixCoords(0, i));
                engine.AddObject(indestructibleBlockCeiling);
            }
        }
コード例 #29
0
        public void Initialize(Engine engine)
        {
            // Initialize ceiling
            for (int i = wallStartRow; i < WorldCols; i++)
            {
                Block ceiling = new IndestructibleBlock(new MatrixCoords(wallStartRow, i));
                engine.AddObject(ceiling);
            }

            // Initialize indestructible walls
            for (int i = wallStartRow + 1; i < WorldRows; i++)
            {
                Block leftWallBlock  = new IndestructibleBlock(new MatrixCoords(i, 0));
                Block rightWallBlock = new IndestructibleBlock(new MatrixCoords(i, GetCols - 1));
                engine.AddObject(leftWallBlock);
                engine.AddObject(rightWallBlock);
            }

            // Initialize exploding Blocks
            for (int i = startCol; i < endCol; i++)
            {
                if (i % 7 == 0)
                {
                    Block explBlock = new ExplodingBlock(new MatrixCoords(startRow + 1, i));
                    engine.AddObject(explBlock);
                }
            }

            // Initialize Unpassable Blocks
            for (int i = startCol; i < endCol; i++)
            {
                if (i % 5 == 0)
                {
                    Block unpassableBlock = new UnpassableBlock(new MatrixCoords(WorldRows / 2, i));
                    engine.AddObject(unpassableBlock);
                }
            }

            // Initialize Gift Blocks
            for (int i = startCol; i < endCol; i++)
            {
                if (i % 8 == 0)
                {
                    Block currBlock = new GiftBlock(new MatrixCoords(startRow - 1, i));
                    engine.AddObject(currBlock);
                }
            }

            // Original Blocks
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                engine.AddObject(currBlock);
            }

            // Original Ball

            //ball theball = new ball(new matrixcoords(worldrows / 2, 0),
            //new matrixcoords(-1, 1));

            //engine.addobject(theball);

            // Meteorite Ball Test

            //Ball theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);


            // Unstoppable Ball Test

            Ball theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                               new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, GetCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #30
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            //The AcademyPopcorn class contains an IndestructibleBlock class. Use it to create side and ceiling walls to the game. You can ONLY edit the AcademyPopcornMain.cs file
            IndestructibleBlock indestructibleBlock = null;

            for (int row = 0; row < WorldRows; row++)
            {
                for (int col = 0; col < WorldCols; col++)
                {
                    if (row == 0)
                    {
                        indestructibleBlock = new IndestructibleBlock(new MatrixCoords(row, col));
                        engine.AddObject(indestructibleBlock);
                    }
                    else if (col == 0 || col == WorldCols - 1)
                    {
                        indestructibleBlock = new IndestructibleBlock(new MatrixCoords(row, col));
                        engine.AddObject(indestructibleBlock);
                    }
                }
            }

            for (int i = startCol; i < endCol; i++)
            {
                switch (i % 5)
                {
                case 0:
                    ExplodingBlock explodingBlock = new ExplodingBlock(new MatrixCoords(startRow, i));
                    engine.AddObject(explodingBlock);
                    break;

                default:
                    switch (i % 3)
                    {
                    case 0:
                        GiftBlock giftBlock = new GiftBlock(new MatrixCoords(startRow, i));
                        engine.AddObject(giftBlock);
                        break;

                    default:
                        Block currBlock = new Block(new MatrixCoords(startRow, i));
                        engine.AddObject(currBlock);
                        break;
                    }
                    break;
                }
            }

            for (int i = 4; i < endCol; i += 3)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(8, i));

                engine.AddObject(currBlock);
            }

            TrailObject to = new TrailObject(new MatrixCoords(5, 6), 15);

            engine.AddObject(to);

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                                          new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            ShootingRacket theRacket = new ShootingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #31
0
ファイル: Program.cs プロジェクト: Termininja/TelerikAcademy
        // Drawing all objects
        static void Initialize(Engine engine)
        {
            // Wall coordinates
            for (int col = 0; col < WorldCols; col += WallGap)
            {
                if (col > WorldCols / 3 && col < 2 * WorldCols / 3) col += WallGap;
                for (int width = col; width < col + WallWidth; width++)
                {
                    for (int row = 0; row <= ((col != 0 && col < WorldCols - WallGap) ? WorldRows - 1 : WorldRows); row++)
                    {
                        if (col != 0 && col < WorldCols - WallGap && row == 2) row = 6;
                        if (col > WallGap && col < WorldCols - WallGap && row == 17) row = 22;
                        IndestructibleBlock Wall = new IndestructibleBlock(new MatrixCoords(row, width));
                        engine.AddObject(Wall);
                    }
                }
            }

            // Ceiling coordinates
            for (int col = 0; col < WorldCols; col++)
            {
                IndestructibleBlock ceiling = new IndestructibleBlock(new MatrixCoords(0, col));
                engine.AddObject(ceiling);
            }

            // Floor coordinates
            for (int col = 0; col < WorldCols - 1; col++)
            {
                if (col == WallGap + WallWidth) col = 3 * WallGap;
                IndestructibleBlock floor = new IndestructibleBlock(new MatrixCoords(WorldRows - 1, col));
                engine.AddObject(floor);
            }

            // Block coordinates
            for (int row = 0; row < BlockLines; row++)
            {
                if (row == 2) row = 3;
                for (int col = WallGap + WallWidth + 1; col < 3 * WallGap - 1; col++)
                {
                    if (row == 4 && (col == 3 * WallGap / 2 || col == 5 * WallGap / 2)) col++;
                    Block currBlock = new Block(new MatrixCoords(StartBlockRow + row, col));
                    engine.AddObject(currBlock);
                }
            }

            for (int col = WallGap + WallWidth + 1; col < 3 * WallGap - 1; col++)
            {
                if (col == WallGap + 7) col = 3 * WallGap - 5;
                Block currBlock2 = new Block(new MatrixCoords(5, col));
                engine.AddObject(currBlock2);
            }

            for (int row = 0; row < WorldRows - 2 * BlockLines + 1; row += 3)
            {
                for (int col = WallWidth + 1; col < WorldCols - WallWidth - 1; col++)
                {
                    if (col == WallGap - 1) col = 3 * WallGap + WallWidth + 1;
                    Block currBlock = new Block(new MatrixCoords(StartBlockRow + row, col));
                    engine.AddObject(currBlock);
                }
            }

            for (int col = WallGap + WallWidth + 5; col < 3 * WallGap - 5; col++)
            {
                UnpassableBlock unpassBlock = new UnpassableBlock(new MatrixCoords(5, col));
                engine.AddObject(unpassBlock);
            }

            ExplodingBlock exploBlock1 = new ExplodingBlock(new MatrixCoords(7, 3 * WallGap / 2));
            engine.AddObject(exploBlock1);
            ExplodingBlock exploBlock2 = new ExplodingBlock(new MatrixCoords(7, 5 * WallGap / 2));
            engine.AddObject(exploBlock2);

            // Ball coordinates
            Ball theBall = new Ball(new MatrixCoords(2 * WorldRows / 3, WorldCols / 2 - 10), new MatrixCoords(-1, 1));
            engine.AddObject(theBall);

            // Meteorite ball coordinates
            MeteoriteBall meteoBall = new MeteoriteBall(new MatrixCoords(WorldRows - 1, 1), new MatrixCoords(-1, 1));
            engine.AddObject(meteoBall);

            MeteoriteBall meteoBall2 = new MeteoriteBall(new MatrixCoords(WorldRows - 1, 3), new MatrixCoords(-1, 1));
            engine.AddObject(meteoBall2);

            MeteoriteBall meteoBall3 = new MeteoriteBall(new MatrixCoords(WorldRows - 1, 7), new MatrixCoords(-1, 1));
            engine.AddObject(meteoBall3);

            // Unstoppable ball coordinates
            UnstoppableBall unstopBall = new UnstoppableBall(new MatrixCoords(WorldRows - 8, WorldCols - WallWidth - 3), new MatrixCoords(-1, -1));
            engine.AddObject(unstopBall);

            // Racket coordinates
            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, (WorldCols - RacketLength) / 2), RacketLength);
            engine.AddObject(theRacket);

            // Gift coordinates
            for (int col = WallGap + 3; col < 3 * WallGap - 1; col++)
            {
                GiftBlock gift = new GiftBlock(new MatrixCoords(1, col));
                engine.AddObject(gift);
            }
        }
コード例 #32
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i += 2)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 1, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow + 2, i), new char[,] {{'%'}});

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 4, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol + 5; i < endCol - 5; i++)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(currBlock);
            }

            for (int i = 1; i < WorldRows; i++)
            {
                IndestructibleBlock newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(i, 0), '║');
                engine.AddObject(newIndestructubleBlock);
                newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1), '║');
                engine.AddObject(newIndestructubleBlock);
            }
            for (int i = 1; i < WorldCols - 1; i++)
            {
                IndestructibleBlock newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(0, i), '═');
                engine.AddObject(newIndestructubleBlock);
                newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(WorldRows - 1, i), '_');
                engine.AddObject(newIndestructubleBlock);
            }

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #33
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                //Adding a ExplodingBlock aka bomb here
                if (i == 18)
                {
                    ExplodingBlock bomb = new ExplodingBlock(new MatrixCoords(startRow + 1, i));
                    engine.AddObject(bomb);
                    continue;
                }
                //Adding a gift here
                if (i == endCol - 2)
                {
                    GiftBlock gift = new GiftBlock(new MatrixCoords(startRow + 1, i));
                    engine.AddObject(gift);
                    continue;
                }
                Block currBlock = new Block(new MatrixCoords(startRow + 1, i));
                engine.AddObject(currBlock);
            }
            //Task 1
            for (int i = startCol; i < endCol; i++)
            {
                //Start from 0 where is the start of the matrix
                Block indeBlock = new IndestructibleBlock(new MatrixCoords(i, 0));

                engine.AddObject(indeBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block indeBlock = new IndestructibleBlock(new MatrixCoords(i, endCol));

                engine.AddObject(indeBlock);
            }
            for (int i = startCol - 1; i < endCol; i++)
            {
                Block indeBlock = new IndestructibleBlock(new MatrixCoords(startRow - 1, i));

                engine.AddObject(indeBlock);
            }
            //End of task 1

            //Task 5
            char[,] startChar = { { 'M', 'o', 'v', 'e', ' ', 'w', 'i', 't', 'h', ' ', '\'', 'a', '\'', ' ', 'a', 'n', 'd', ' ', '\'', 'd', '\'' } };
            TrailObject startMsg = new TrailObject(new MatrixCoords(0, 0), startChar, 20);
            engine.AddObject(startMsg);
            //End of Task 5

            //Task 7
            Ball theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            engine.AddObject(theBall);
            //End of task 7

            //Task 9  - UnpassableBlock added
            for (int i = startCol + 5; i < endCol - 17; i++)
            {
                Block unpassBlock = new UnpassableBlock(new MatrixCoords(startRow + 9, i));

                engine.AddObject(unpassBlock);
            }

            //Adding unstoppable Ball to the game at some position
            //When the ball destroys more than it should - it's from the colision detection
            Ball unstopBall = new UnstoppableBall(new MatrixCoords(20, 5),
                new MatrixCoords(-1, 1));
            engine.AddObject(unstopBall);
            //End of task 9

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            engine.AddObject(theRacket);
        }
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            for (int i = startCol - 1; i < endCol + 1; i++)
            {
                IndestructibleBlock wallBlock = new IndestructibleBlock(new MatrixCoords(startRow - 1, i));
                engine.AddObject(wallBlock);
            }
            for (int i = startRow; i < WorldRows; i++)
            {
                IndestructibleBlock wallBlock = new IndestructibleBlock(new MatrixCoords(i, startCol - 1));
                IndestructibleBlock wallBlock2 = new IndestructibleBlock(new MatrixCoords(i, endCol));
                engine.AddObject(wallBlock);
                engine.AddObject(wallBlock2);
            }

            //create a row of GiftBlocks
            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow+4, i));

                engine.AddObject(currBlock);
            }

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            //replace the normal ball with Meteorite ball
            //MeteoriteBall theMeteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            //engine.AddObject(theMeteoriteBall);

            //replace the MeteroriteBall with Unstoppable Ball
            Ball theUnstopableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            engine.AddObject(theUnstopableBall);

            //put some unpassable blocks
            for (int i = 2; i < WorldCols; i += 5)
            {
                engine.AddObject(new UnpassableBlock(new MatrixCoords(4, i)));
            }

            //create a sample Gift for testing
            Gift gift = new Gift(new MatrixCoords(1, WorldCols / 2));

            engine.AddObject(gift);
            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            TrailObject newTestTrailObject = new TrailObject(new MatrixCoords(startRow  + 10, startCol + 10), new char[,] { { 'V' } }, 20);
            engine.AddObject(newTestTrailObject);

            engine.AddObject(theRacket);
        }
コード例 #35
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            //ordinary ball
            Ball theBall = new Ball(new MatrixCoords(WorldRows / 3, 0),
                new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2 - 3), RacketLength);

            engine.AddObject(theRacket);

            /*1.The AcademyPopcorn class contains an IndestructibleBlock class. Use it to create side and ceiling walls to the game.
             You can ONLY edit the AcademyPopcornMain.cs file.*/
            for (int row = startRow - 1; row < WorldRows; row++)
            {
                IndestructibleBlock leftWallBlock = new IndestructibleBlock(new MatrixCoords(row, startCol - 1),
                    IndestructibleBlock.SymbolWall);
                engine.AddObject(leftWallBlock);
                IndestructibleBlock rightWallBlock = new IndestructibleBlock(new MatrixCoords(row, endCol),
                    IndestructibleBlock.SymbolWall);
                engine.AddObject(rightWallBlock);
            }
            //create ceiling (using symbolTop = "_")
            for (int col = startCol - 1; col < WorldCols - 1; col++)
            {
                IndestructibleBlock topWallBlock = new IndestructibleBlock(new MatrixCoords(1, col),
                    IndestructibleBlock.SymbolTop);
                engine.AddObject(topWallBlock);
            }

            TrailObject comet = new TrailObject(new MatrixCoords(WorldRows / 2, WorldCols / 4), new char[,] { { '*' } }, 8);
            engine.AddObject(comet);

            //7.Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.
            MeteoriteBall metBall = new MeteoriteBall(new MatrixCoords(WorldRows / 3, 0),
                new MatrixCoords(-1, 1), 3);
            //engine.AddObject(metBall);

            //9.Test the UnpassableBlock and the UnstoppableBall by adding them to the engine in AcademyPopcornMain.cs file
            UnstoppableBall unstopBall = new UnstoppableBall(new MatrixCoords(WorldRows / 3, 0), new MatrixCoords(-1, 1));
            engine.AddObject(unstopBall);

            for (int i = 3; i < WorldCols - 2; i = i + 2)
            {
                UnpassableBlock unpassableBlock = new UnpassableBlock(new MatrixCoords(4, i), 'U');
                engine.AddObject(unpassableBlock);
            }

            for (int i = 2; i < WorldCols; i = i + 2)
            {
              ExplodingBlock bombBlock = new ExplodingBlock(new MatrixCoords(4, i), 'B');
              engine.AddObject(bombBlock);
            }

            for (int i = 2; i < WorldCols; i = i + 2)
            {
                GiftBlock giftBlock = new GiftBlock(new MatrixCoords(5, i), 'G');
                engine.AddObject(giftBlock);
            }
        }
コード例 #36
0
ファイル: AcademyPopcornMain.cs プロジェクト: ddichov/CSharp
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 2, i));
                GiftBlock currBlock2 = new GiftBlock(new MatrixCoords(startRow + 4, i));
                engine.AddObject(currBlock);
                engine.AddObject(currBlock2);

                if (i < endCol / 4)   // Exercise 9, 10
                {
                    UnpassableBlock currUBlock = new UnpassableBlock(new MatrixCoords(startRow + 0, i));// Exercise 9
                    engine.AddObject(currUBlock);
                    if (i % 3 == 0)// Exercise 10
                    {
                        ExplodingBlock currEBlock = new ExplodingBlock(new MatrixCoords(startRow + 3, i));// Exercise 10
                        engine.AddObject(currEBlock);
                    }
                }
            }

            for (int i = 0; i < WorldCols; i++) // added. Exercise 1
            {
                IndestructibleBlock currBlock1=new IndestructibleBlock(new MatrixCoords(0,i));
                engine.AddObject(currBlock1);
            }

            for (int i = 1; i < WorldRows; i++) // added. Exercise 1
            {
                IndestructibleBlock currBlock1 = new IndestructibleBlock(new MatrixCoords(i, 0));
                IndestructibleBlock currBlock2 = new IndestructibleBlock(new MatrixCoords(i, WorldCols-1));
                engine.AddObject(currBlock1);
                engine.AddObject(currBlock2);
            }
             // added. Exercise 5
            TrailObject trObj1 = new TrailObject(new MatrixCoords(20, 36), new char[,] {{ 'f' }}, 10);
            engine.AddObject(trObj1);
            TrailObject trObj2 = new TrailObject(new MatrixCoords(15, 27), new char[,] { { 'R' } }, 15);
            engine.AddObject(trObj2);

            // // replaced with MeteoriteBall
            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            // //Exercise 7; replaced with UnstoppableBall
            //MeteoriteBall theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            // Exercise 9
            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            //Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            ShootingRacket theRacket = new ShootingRacket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength); //Exercise 13

            engine.AddObject(theRacket);
        }
コード例 #37
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                engine.AddObject(currBlock);
            }

            //Exploding blocks
            //When collide with the ball effect is like a wave. I cannot find mistake. :(
            /*for (int i = startCol; i < endCol; i++)
            {
                ExplodingBlock currExplodingBlock = new ExplodingBlock(new MatrixCoords(startRow + 1, i));
                engine.AddObject(currExplodingBlock);
            }*/

            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock currGiftBlock = new GiftBlock(new MatrixCoords(startRow + 2, i));
                engine.AddObject(currGiftBlock);
            }

            //Test the UnpassableBlock and the UnstoppableBall by adding them to the engine in AcademyPopcornMain.cs file
            for (int i = startCol; i < endCol / 2; i++)
            {
                UnpassableBlock currUnpassableBlock = new UnpassableBlock(new MatrixCoords(startRow + 3, i));
                engine.AddObject(currUnpassableBlock);
            }

            //Defaul ball
            //Uncomment this and comment Unstoppable Ball to switch between them
            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);

            //Test the UnpassableBlock and the UnstoppableBall by adding them to the engine in AcademyPopcornMain.cs file
            //Unstoppable Ball
            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);
            engine.AddObject(theRacket);

            /* The AcademyPopcorn class contains an IndestructibleBlock class.
             * Use it to create side and ceiling walls to the game.
             * You can ONLY edit the AcademyPopcornMain.cs file. */
            //Top
            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock borders = new IndestructibleBlock(new MatrixCoords(0,i));
                engine.AddObject(borders);
            }

            //Bottom is theRacket
            
            //Left
            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock borders = new IndestructibleBlock(new MatrixCoords(i, 0));
                engine.AddObject(borders);
            }
            //Right
            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock borders = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));
                engine.AddObject(borders);
            }

            /*Then test the TrailObject by adding an instance of it in the engine through the AcademyPopcornMain.cs file.*/
            TrailObject trailObject =
                new TrailObject(new MatrixCoords(WorldRows / 4, WorldCols / 4), new char[,] { {'@'} }, 20);
            //Life of trail object is lifetime * sleeptime
            engine.AddObject(trailObject);

            /*Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.*/
            //Uncomment this to see Meteorit ball with trail. Length of treil by defaul is tree.
            //MeteoriteBall meteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            //engine.AddObject(meteoriteBall);

            //Uncomment this and will see how fall down one 'gift' when you start game
            //Gift someGift = new Gift(new MatrixCoords(WorldRows / 2, WorldCols / 2), new char[,] { { 'G' } });
            //engine.AddObject(someGift);
        }
コード例 #38
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            //        Ball theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //new MatrixCoords(-1, 1));

            Ball theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
            new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            for (int row = 0; row < WorldRows; row++)
            {
                IndestructibleBlock leftSide = new IndestructibleBlock(new MatrixCoords(row, 0));

                engine.AddObject(leftSide);

                IndestructibleBlock rightSide = new IndestructibleBlock(new MatrixCoords(row, WorldCols - 1));

                engine.AddObject(rightSide);

            }

            for (int col = 1; col < WorldCols - 1; col++)
            {

                IndestructibleBlock ceiling = new IndestructibleBlock(new MatrixCoords(0, col));

                engine.AddObject(ceiling);
            }

            //TrailObject trailingObject = new TrailObject(new MatrixCoords(WorldRows / 2, WorldCols / 2), 10);

            UnpassableBlock unpassable = new UnpassableBlock(new MatrixCoords(WorldRows / 2, WorldCols / 2 ));

            engine.AddObject(unpassable);

            //ExplodingBlock exploadable = new ExplodingBlock(new MatrixCoords(4, 6));

            //engine.AddObject(exploadable);

            GiftBlock gift = new GiftBlock(new MatrixCoords(4, 6));

            engine.AddObject(gift);
        }
コード例 #39
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            #region Add some layers of ordinary blocks and a layer of exploding block in the middle

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock1 = new Block(new MatrixCoords(startRow, i));
                Block currBlock2 = new Block(new MatrixCoords(startRow + 1, i));
                Block currBlock3 = new Block(new MatrixCoords(startRow + 2, i));

                engine.AddObject(currBlock1);
                engine.AddObject(currBlock2);
                engine.AddObject(currBlock3);
            }

            for (int i = startCol; i < endCol; i++)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(currBlock);
            }

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock1 = new Block(new MatrixCoords(startRow + 4, i));
                Block currBlock2 = new Block(new MatrixCoords(startRow + 5, i));
                Block currBlock3 = new Block(new MatrixCoords(startRow + 6, i));

                engine.AddObject(currBlock1);
                engine.AddObject(currBlock2);
                engine.AddObject(currBlock3);
            }

            #endregion

            #region Add a layer of gift objects

            //for (int i = startCol; i < endCol; i++)
            //{
            //    GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow, i));

            //    engine.AddObject(currBlock);
            //}

            #endregion

            #region Create side walls and a ceiling

            // create side walls
            for (int i = 0; i < WorldRows; i++)
            {
                // create a block for the left wall
                IndestructibleBlock leftWallBlock = new IndestructibleBlock(new MatrixCoords(i, 0));
                // create a block for the right wall
                IndestructibleBlock rightWallBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));

                engine.AddObject(leftWallBlock);
                engine.AddObject(rightWallBlock);
            }

            for (int i = 0; i < WorldCols; i++)
            {
                // create a block for the ceiling
                IndestructibleBlock ceilingBlock = new IndestructibleBlock(new MatrixCoords(0, i));

                engine.AddObject(ceilingBlock);
            }

            #endregion

            #region Add an impassable wall

            //for (int i = startRow + 1; i < WorldRows; i++)
            //{
            //    // create an impassable block
            //    ImpassableBlock impassableBlock = new ImpassableBlock(new MatrixCoords(i, 2 * WorldCols / 3 + 2));

            //    engine.AddObject(impassableBlock);
            //}

            #endregion

            #region Create an ordinary ball

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            #endregion

            #region Replace the ordinary ball with a MeteoriteBall object

            //MeteoriteBall theBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1), 3);

            #endregion

            #region Replace the ordinary ball with an UnstoppableBall object

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));

            #endregion

            engine.AddObject(theBall);

            #region Add the racket

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            #endregion

            #region Add an instance of the TrailObject class

            //TrailObject ephemera = new TrailObject(
            //    new MatrixCoords(WorldRows / 3, WorldCols / 3), new char[,] { { '@' } }, 10);

            //engine.AddObject(ephemera);

            #endregion

            #region Add a single gift

            Gift gift = new Gift(new MatrixCoords(WorldRows / 3, WorldCols / 3), new char[, ] {
                { '@' }
            });

            engine.AddObject(gift);

            #endregion
        }
コード例 #40
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 1, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 2, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol / 3; i++)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow + 4, i));

                engine.AddObject(currBlock);
            }

            // Exploding blocks. Chain reaction :)
            for (int i = endCol / 2; i < endCol; i++)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(currBlock);
            }

            //Gift testGift = new Gift(new MatrixCoords(10, 20));
            //engine.AddObject(testGift);

            GiftBlock giftBlock = new GiftBlock(new MatrixCoords(7, 25));

            engine.AddObject(giftBlock);

            // TASK 1
            startCol = 0;
            endCol   = WorldRows - 1;

            for (int i = startRow; i < endCol; i++) // LEFT SIDE
            {
                IndestructibleBlock currBlock = new IndestructibleBlock(new MatrixCoords(i, startCol));

                engine.AddObject(currBlock);
            }

            startCol = WorldCols - 1;

            for (int i = startRow; i < endCol; i++) // RIGHT SIDE
            {
                IndestructibleBlock currBlock = new IndestructibleBlock(new MatrixCoords(i, startCol));

                engine.AddObject(currBlock);
            }

            startRow = 2;
            startCol = 0;
            endCol   = WorldCols;

            for (int i = startCol; i < endCol; i++) // CEILING
            {
                IndestructibleBlock currBlock = new IndestructibleBlock(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }

            // END TASK 1

            // Bellow the three balls are added to the engine
            Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
                                    new MatrixCoords(-1, 1));

            MeteoriteBall theMeteoriteBall = new MeteoriteBall(new MatrixCoords(20, 9),
                                                               new MatrixCoords(-1, 1));

            UnstoppableBall theUnstoppableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 25),
                                                                     new MatrixCoords(-1, 1));

            engine.AddObject(theBall);
            engine.AddObject(theMeteoriteBall);
            engine.AddObject(theUnstoppableBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);


            // Part of TASK 5
            //TrailObject trailObject = new TrailObject(new MatrixCoords(10, 20), 5);

            //engine.AddObject(trailObject);
        }
コード例 #41
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock0 = new Block(new MatrixCoords(startRow - 1, i));
                Block currBlock  = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
                engine.AddObject(currBlock0);
            }

            //ExplodingBlock makes trails
            ExplodingBlock explodingBlock = new ExplodingBlock(new MatrixCoords(4, 7));

            engine.AddObject(explodingBlock);

            //Ordinary ball
            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            //engine.AddObject(theBall);

            //Meteorite Ball makes trails when it moves
            //MeteoriteBall meteroitBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));
            // engine.AddObject(meteroitBall);

            //Unstoppable Ball, can be stopped only by Unpassable Block
            UnstoppableBall unstoppableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                                                  new MatrixCoords(-1, 1));

            engine.AddObject(unstoppableBall);

            //Falling gift
            Gift giftObject = new Gift(new MatrixCoords(5, 15),
                                       new MatrixCoords(-1, 0));

            engine.AddObject(giftObject);

            //Gift Block
            GiftBlock giftBlock = new GiftBlock(new MatrixCoords(10, 10));

            engine.AddObject(giftBlock);

            //UnpassableBlock
            UnpassableBlock unpassableBlock = new UnpassableBlock(new MatrixCoords(15, 15));

            engine.AddObject(unpassableBlock);
            UnpassableBlock unpassableBlock1 = new UnpassableBlock(new MatrixCoords(15, 16));

            engine.AddObject(unpassableBlock1);
            UnpassableBlock unpassableBlock2 = new UnpassableBlock(new MatrixCoords(15, 17));

            engine.AddObject(unpassableBlock2);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);

            //Creating second Racket
            //When you add second racket by addObject method, it checks whether the game has already a racket
            //If it does, we are removing the previous, and adding the new one.
            //Racket secondRacket = new Racket(new MatrixCoords(WorldRows -10, WorldCols / 2), RacketLength);
            //engine.AddObject(secondRacket);

            TrailObject trailObject = new TrailObject(new MatrixCoords(1, 1), 20);

            engine.AddObject(trailObject);

            for (int i = 0; i < WorldRows; i++)
            {
                IndestructibleBlock indestructibleBlockLeft  = new IndestructibleBlock(new MatrixCoords(i, 0));
                IndestructibleBlock indestructibleBlockRight = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1));
                engine.AddObject(indestructibleBlockLeft);
                engine.AddObject(indestructibleBlockRight);
            }

            for (int i = 0; i < WorldCols; i++)
            {
                IndestructibleBlock indestructibleBlockCeiling = new IndestructibleBlock(new MatrixCoords(0, i));
                engine.AddObject(indestructibleBlockCeiling);
            }
        }
コード例 #42
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol   = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i += 2)
            {
                ExplodingBlock currBlock = new ExplodingBlock(new MatrixCoords(startRow + 1, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock currBlock = new GiftBlock(new MatrixCoords(startRow + 2, i), new char[, ] {
                    { '%' }
                });

                engine.AddObject(currBlock);
            }
            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow + 4, i));

                engine.AddObject(currBlock);
            }
            for (int i = startCol + 5; i < endCol - 5; i++)
            {
                UnpassableBlock currBlock = new UnpassableBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(currBlock);
            }

            for (int i = 1; i < WorldRows; i++)
            {
                IndestructibleBlock newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(i, 0), '║');
                engine.AddObject(newIndestructubleBlock);
                newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1), '║');
                engine.AddObject(newIndestructubleBlock);
            }
            for (int i = 1; i < WorldCols - 1; i++)
            {
                IndestructibleBlock newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(0, i), '═');
                engine.AddObject(newIndestructubleBlock);
                newIndestructubleBlock = new IndestructibleBlock(new MatrixCoords(WorldRows - 1, i), '_');
                engine.AddObject(newIndestructubleBlock);
            }

            UnstoppableBall theBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                                                          new MatrixCoords(-1, 1));

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #43
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            #region Add Indestructible Blocks as ball delimeters

            for (int row = 0; row < WorldRows; row++)
            {
                for (int col = 0; col < WorldCols; col++)
                {
                    IndestructibleBlock currBlock = null;
                    if (row == 0)
                    {
                        currBlock = new IndestructibleBlock(new MatrixCoords(row, col));
                        engine.AddObject(currBlock);
                    }
                    else
                    {
                        if (col == 0 || col == WorldCols - 1)
                        {
                            currBlock = new IndestructibleBlock(new MatrixCoords(row, col));
                            engine.AddObject(currBlock);
                        }
                    }

                }
            }
            #endregion

            #region Add TrailObject

            //TrailObject trailObject = new TrailObject(new MatrixCoords(WorldRows, WorldCols),
            //                                          new char[,] { { '°' } }, 5);
            //engine.AddObject(trailObject);

            #endregion

            #region Add Blocks

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                Block currBlock2 = new Block(new MatrixCoords(startRow + 1, i));
                engine.AddObject(currBlock);
                engine.AddObject(currBlock2);
            }
            #endregion

            #region Add unpassable Blocks

            //for (int i = startCol; i < endCol; i = i + 4)
            //{
            //    UnpassableBlock unpassableBlock = new UnpassableBlock(new MatrixCoords(startRow + 5, i));

            //    engine.AddObject(unpassableBlock);
            //}
            for (int i = startCol; i < endCol; i = i + 3)
            {
                UnpassableBlock unpassableBlock = new UnpassableBlock(new MatrixCoords(WorldRows - 8, i));

                engine.AddObject(unpassableBlock);
            }
            #endregion

            #region Add exploding Blocks

            for (int i = startCol; i < endCol; i = i + 1)
            {
                ExplodingBlock expoldingBlock = new ExplodingBlock(new MatrixCoords(startRow + 2, i));

                engine.AddObject(expoldingBlock);
            }
            #endregion

            #region Add gift Blocks

            for (int i = startCol; i < endCol; i++)
            {
                GiftBlock giftBlock = new GiftBlock(new MatrixCoords(startRow + 3, i));

                engine.AddObject(giftBlock);
            }
            #endregion

            #region Add Meteorite Ball

            MeteoriteBall meteoriteBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            #endregion

            #region Add unstoppableBall Ball

            UnstoppableBall unstoppableBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));

            #endregion

            #region Add Ball

            Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            #endregion

            engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }
コード例 #44
0
        static void Initialize(Engine engine)
        {
            int startRow = 3;
            int startCol = 2;
            int endCol = WorldCols - 2;

            for (int i = startCol; i < endCol; i++)
            {
                Block currBlock = new Block(new MatrixCoords(startRow, i));
                engine.AddObject(currBlock);
                
            }
            //10
            ExplodingBlock exBlock = new ExplodingBlock(new MatrixCoords(4,30));
            engine.AddObject(exBlock);
            //END 10

            //01.The AcademyPopcorn class contains an IndestructibleBlock class. 
            //Use it to create side and ceiling walls to the game. You can ONLY edit the 
            //AcademyPopcornMain.cs file.

            for (int row = 0; row < 40; row++)
            {
                IndestructibleBlock leftSideBlock = new IndestructibleBlock(new MatrixCoords(row, 0));
                IndestructibleBlock rightSideBlock = new IndestructibleBlock(new MatrixCoords(row, WorldCols - 1));
                engine.AddObject(leftSideBlock);
                engine.AddObject(rightSideBlock);
            }

            for (int col = 0; col < WorldCols; col++)
            {
                IndestructibleBlock ceilingBlock = new IndestructibleBlock(new MatrixCoords(0, col));
                engine.AddObject(ceilingBlock);
            }
            //END 01

            //05
            TrailObject trailObj = new TrailObject(new MatrixCoords(8, 8), 8);
            //engine.AddObject(trailObj);
            //END 05

            //07.Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file.
            MeteoriteBall metBall = new MeteoriteBall(new MatrixCoords(WorldRows / 2, 0), new MatrixCoords(-1, 1));
            engine.AddObject(metBall);
            //END 07

            //09
            ImpassableBlock imPassBlock = new ImpassableBlock(new MatrixCoords(4, 7));
            engine.AddObject(imPassBlock);
            UnstoppableBall unstopBall = new UnstoppableBall(new MatrixCoords(WorldRows / 2, 0),
                new MatrixCoords(-1, 1));
            //engine.AddObject(unstopBall);
            //END 09

            //12
            GiftBlock gift = new GiftBlock(new MatrixCoords(7,25));
            engine.AddObject(gift);
            //END 12

            //Ball theBall = new Ball(new MatrixCoords(WorldRows / 2, 0),
            //    new MatrixCoords(-1, 1));

            //engine.AddObject(theBall);

            Racket theRacket = new Racket(new MatrixCoords(WorldRows - 1, WorldCols / 2), RacketLength);

            engine.AddObject(theRacket);
        }