Example #1
0
 private void checkForGameOver(Vortex myVortex)
 {
     if (darwin.isOnTop(myVortex))
     {
         gameOver = true;
         fellDownPit = true;
     }
 }
Example #2
0
        private void setVortexes()
        {
            Vortex vn1 = new Vortex(board, 4, 4);
            Vortex vn2 = new Vortex(board, 5, 4);
            Vortex vn3 = new Vortex(board, 6, 4);
            Vortex vn4 = new Vortex(board, 7, 4);
            Vortex vn5 = new Vortex(board, 8, 4);
            Vortex vn6 = new Vortex(board, 9, 4);
            Vortex vn7 = new Vortex(board, 10, 4);
            Vortex vn8 = new Vortex(board, 11, 4);
            Vortex vn9 = new Vortex(board, 12, 4);
            Vortex vn10 = new Vortex(board, 13, 4);
            Vortex vn11 = new Vortex(board, 14, 4);
            Vortex vn12 = new Vortex(board, 15, 4);
            Vortex vn13 = new Vortex(board, 16, 4);
            Vortex vn14 = new Vortex(board, 17, 4);
            Vortex vn15 = new Vortex(board, 18, 4);
            Vortex vn16 = new Vortex(board, 19, 4);
            Vortex vn17 = new Vortex(board, 20, 4);
            Vortex vn18 = new Vortex(board, 21, 4);
            Vortex vn19 = new Vortex(board, 22, 4);
            Vortex vn20 = new Vortex(board, 23, 4);
            Vortex vn21 = new Vortex(board, 24, 4);
            Vortex vn22 = new Vortex(board, 25, 4);
            Vortex vn23 = new Vortex(board, 26, 4);
            Vortex vn24 = new Vortex(board, 27, 4);
            Vortex vn25 = new Vortex(board, 28, 4);

            Vortex vs1 = new Vortex(board, 4, 19);
            Vortex vs2 = new Vortex(board, 5, 19);
            Vortex vs3 = new Vortex(board, 6, 19);
            Vortex vs4 = new Vortex(board, 7, 19);
            Vortex vs5 = new Vortex(board, 8, 19);
            Vortex vs6 = new Vortex(board, 9, 19);
            Vortex vs7 = new Vortex(board, 10, 19);
            Vortex vs8 = new Vortex(board, 11, 19);
            Vortex vs9 = new Vortex(board, 12, 19);
            Vortex vs10 = new Vortex(board, 13, 19);
            Vortex vs11 = new Vortex(board, 14, 19);
            Vortex vs12 = new Vortex(board, 15, 19);
            Vortex vs13 = new Vortex(board, 16, 19);
            Vortex vs14 = new Vortex(board, 17, 19);
            Vortex vs15 = new Vortex(board, 18, 19);
            Vortex vs16 = new Vortex(board, 19, 19);
            Vortex vs17 = new Vortex(board, 20, 19);
            Vortex vs18 = new Vortex(board, 21, 19);
            Vortex vs19 = new Vortex(board, 22, 19);
            Vortex vs20 = new Vortex(board, 23, 19);
            Vortex vs21 = new Vortex(board, 24, 19);
            Vortex vs22 = new Vortex(board, 25, 19);
            Vortex vs23 = new Vortex(board, 26, 19);
            Vortex vs24 = new Vortex(board, 27, 19);
            Vortex vs25 = new Vortex(board, 28, 19);

            Vortex ve1 = new Vortex(board, 28, 5);
            Vortex ve2 = new Vortex(board, 28, 6);
            Vortex ve3 = new Vortex(board, 28, 7);
            Vortex ve4 = new Vortex(board, 28, 8);
            Vortex ve5 = new Vortex(board, 28, 9);
            Vortex ve6 = new Vortex(board, 28, 10);
            Vortex ve7 = new Vortex(board, 28, 11);
            Vortex ve8 = new Vortex(board, 28, 12);
            Vortex ve9 = new Vortex(board, 28, 13);
            Vortex ve10 = new Vortex(board, 28, 14);
            Vortex ve11 = new Vortex(board, 28, 15);
            Vortex ve12 = new Vortex(board, 28, 16);
            Vortex ve13 = new Vortex(board, 28, 17);
            Vortex ve14 = new Vortex(board, 28, 18);

            Vortex vw1 = new Vortex(board, 4, 5);
            Vortex vw2 = new Vortex(board, 4, 6);
            Vortex vw3 = new Vortex(board, 4, 7);
            Vortex vw4 = new Vortex(board, 4, 8);
            Vortex vw5 = new Vortex(board, 4, 9);
            Vortex vw6 = new Vortex(board, 4, 10);
            Vortex vw7 = new Vortex(board, 4, 11);
            Vortex vw8 = new Vortex(board, 4, 12);
            Vortex vw9 = new Vortex(board, 4, 13);
            Vortex vw10 = new Vortex(board, 4, 14);
            Vortex vw11 = new Vortex(board, 4, 15);
            Vortex vw12 = new Vortex(board, 4, 16);
            Vortex vw13 = new Vortex(board, 4, 17);
            Vortex vw14 = new Vortex(board, 4, 18);

            vortexes = new Vortex[78] { vn1, vn2, vn3, vn4, vn5, vn6, vn7, vn8, vn9, vn10, vn11, vn12, vn13, vn14, vn15, vn16, vn17, vn18, vn19, vn20, vn21, vn22, vn23, vn24, vn25,
                                        vs1, vs2, vs3, vs4, vs5, vs6, vs7, vs8, vs9, vs10, vs11, vs12, vs13, vs14, vs15, vs16, vs17, vs18, vs19, vs20, vs21, vs22, vs23, vs24, vs25,
                                        ve1, ve2, ve3, ve4, ve5, ve6, ve7, ve8, ve9, ve10, ve11, ve12, ve13, ve14,
                                        vw1, vw2, vw3, vw4, vw5, vw6, vw7, vw8, vw9, vw10, vw11, vw12, vw13, vw14 };
        }
Example #3
0
        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            // set up all basic game objects for level1 here
            gameState = new GameState();
            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);
            gameStart2 = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);

            board = new GameBoard(new Vector2(33, 25), new Vector2(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight));
            darwin = new Darwin(board);
            firstZombie = new Zombie(10, 10, 15, 5, 15, 5, board);
            secondZombie = new Zombie(10, 16, 15, 5, 15, 5, board);
            thirdZombie = new Zombie(12, 10, 15, 5, 15, 5, board);
            fourthZombie = new Zombie(20, 7, 27, 15, 22, 2, board);
            fifthZombie = new Zombie(22, 10, 25, 15, 22, 2, board);
            sixthZombie = new Zombie(21, 4, 25, 15, 15, 2, board);

            String zombieString = "This a zombie,\n don't near him \nas a human!!";
            zombieMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, zombieString);

            String darwinString = "This is darwin,\n move with arrows, \n z to transform, \n a for actions";
            darwinMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, darwinString);

            String switchString = "This is a switch\n face it and press A\n to see what happens!!";
            switchMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, switchString);

            String brainString = "Move the brain as a \nzombie.\n Zombie's like brains!!";
            brainMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, brainString);

            stairs = new Stairs(board);

            brain = new Brain(board, 3, 3);

            BasicObject[] removableWalls = setRemovableWallsInLevelOne();

            BasicObject switchSquare = new BasicObject(board);
            switchSquare.X = 13;
            switchSquare.Y = 2;

            firstSwitch = new Switch(switchSquare, board, removableWalls);

            // Initial starting position
            darwin.setGridPosition(2, 20);

            if (board.isGridPositionOpen(darwin))
            {
                board.setGridPositionOccupied(darwin.X, darwin.Y);
                darwin.setPosition(board.getPosition(darwin).X, board.getPosition(darwin).Y);
            }

            // Darwin's lag movement
            counterReady = counter = 5;

            if (board.isGridPositionOpen(21, 20))
            {
                stairs.setGridPosition(27, 21);
                stairs.setDestination(board.getPosition(27, 21));
            }

            zTime = new ZombieTime(board);

            vortex = new Vortex(board, 19, 20);

            setPotionPosition(25, 4);

            setWalls();
        }