Beispiel #1
0
        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();
            gameState.setState(GameState.state.Start);
            gameStart = 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, 9, 24, 5, 15, 5, board);
            secondZombie = new Zombie(12, 9, 24, 5, 15, 5, board);
            thirdZombie = new Zombie(8, 8, 24, 5, 15, 5, board);
            fourthZombie = new Zombie(8, 12, 17, 5, 20, 10, board);

            myZombieList= new List<Zombie>();
            myZombieList.Add(firstZombie);
            myZombieList.Add(secondZombie);
            myZombieList.Add(thirdZombie);
            myZombieList.Add(fourthZombie);
            cannibalZombie = new CannibalZombie(29,3,board.getNumSquaresX()-1,1,board.getNumSquaresY()-1,1,myZombieList,darwin,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 cannibalString = "Cannibal Zombies eat\n other zombies!!\n  Use this to\n your advantage!!";
            cannibalMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, cannibalString);

            stairs = new Stairs(board);

            removableWalls = setRemovableWallsInLevelTwo();

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

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

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

            zTime = new ZombieTime(board);
            zTimeReset = new ZombieTime(board);

            setWallsInLevelTwo();

            potion = new Potion(board);
            potion.setDestination(board.getPosition(3,3));
            potion.setGridPosition(3, 3);
        }
Beispiel #2
0
 private void setPotionPosition(int x, int y)
 {
     potion = new Potion(board);
     potion.setDestination(board.getPosition(x, y));
     potion.setGridPosition(x, y);
 }