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

            device = graphics.GraphicsDevice;

            gameState = new GameState();

            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);

            zTime = new ZombieTime(board);

            nurseryOne = new Nursery(board, darwin);
            nurseryTwo = new Nursery(board, darwin);

            fatBossZombie = new FatBossZombie(15, 4, 19, 14, 4, 3, darwin, board);
            fatBossZombie.resetGapeMode();
            stairs = new Stairs(board);

            walls = setWallsInLevelSix();

            setLevelState();
            gameState.setState(GameState.state.Start);
        }
예제 #2
0
 public void Update(GameTime gameTime, KeyboardState ks, Darwin darwin, ZombieTime zTime)
 {
     if(this.isOnTop(darwin) && !isConsumed)
     {
         consumePotion(zTime);
     }
 }
예제 #3
0
        private void consumePotion(ZombieTime zTime)
        {
            board.setGridPositionOpen(this);
            isConsumed = true;

            int updateTime = zTime.getTime() - healthReplenished;
            zTime.setTime(updateTime);

            potionSound.Play();
        }
예제 #4
0
 public void setZTimeLevel(MenuObject.ZombieTime mytime, LevelState myLevel)
 {
     if (myLevel == LevelState.Level2)
     {
         level2.setZTime(mytime);
     }
     else if (myLevel == LevelState.Level3)
     {
         level3.setZTime(mytime);
     }
     else if (myLevel == LevelState.Level4)
     {
         level4.setZTime(mytime);
     }
     else if (myLevel == LevelState.Level5)
     {
         level5.setZTime(mytime);
     }
     else if (myLevel == LevelState.Level6)
     {
         level6.setZTime(mytime);
     }
 }
예제 #5
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);
        }
예제 #6
0
        public void setZTime(ZombieTime mytime) 
        {
            zTime.setTime(mytime.getTime());

            zTimeReset = new ZombieTime(board);
            zTimeReset.reset();
            zTimeReset.setTime(mytime.getTime());
        }
예제 #7
0
        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();
            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);
            gameState.setState(GameState.state.Start);

            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);

            Vector2[] myPath = new Vector2[4];
            myPath[0] = new Vector2(8, 4);
            myPath[1] = new Vector2(8, 19);
            myPath[2] = new Vector2(25, 19);
            myPath[3] = new Vector2(25, 4);

            leaderZombie = new CongaLeaderZombie(8, 4, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath, darwin, board);

            followerZombies = new List<CongaFollowerZombie>();

            // all conga paths for the different conga zombies are created here along with all conga zombies
            myPath = new Vector2[8];
            myPath[0] = new Vector2(8,4);
            myPath[1] = new Vector2(8, 12);
            myPath[2] = new Vector2(8,19);
            myPath[3] = new Vector2(17, 19);
            myPath[4] = new Vector2(25,19);
            myPath[5] = new Vector2(25, 12);
            myPath[6] = new Vector2(25,4);
            myPath[7] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(10,4,board.getNumSquaresX(),0,board.getNumSquaresY(),0,myPath,leaderZombie,darwin,board));
            followerZombies.Add(new CongaFollowerZombie(12, 4, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath, leaderZombie,darwin, board));
            followerZombies.Add(new CongaFollowerZombie(14, 4, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath, leaderZombie,darwin, board));

            myPath = new Vector2[8];
            myPath[2] = new Vector2(8, 4);
            myPath[3] = new Vector2(8, 12);
            myPath[4] = new Vector2(8, 19);
            myPath[5] = new Vector2(17, 19);
            myPath[6] = new Vector2(25, 19);
            myPath[7] = new Vector2(25, 12);
            myPath[0] = new Vector2(25, 4);
            myPath[1] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(25, 8, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(25, 10, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(25, 14, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];
            myPath[4] = new Vector2(8, 4);
            myPath[5] = new Vector2(8, 12);
            myPath[6] = new Vector2(8, 19);
            myPath[7] = new Vector2(17, 19);
            myPath[0] = new Vector2(25, 19);
            myPath[1] = new Vector2(25, 12);
            myPath[2] = new Vector2(25, 4);
            myPath[3] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(22, 19, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(16, 19, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(14, 19, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];
            myPath[6] = new Vector2(8, 4);
            myPath[7] = new Vector2(8, 12);
            myPath[0] = new Vector2(8, 19);
            myPath[1] = new Vector2(17, 19);
            myPath[2] = new Vector2(25, 19);
            myPath[3] = new Vector2(25, 12);
            myPath[4] = new Vector2(25, 4);
            myPath[5] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(8, 12, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(8, 15, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];

            myPath[3] = new Vector2(8, 4);
            myPath[4] = new Vector2(8, 12);
            myPath[5] = new Vector2(8, 19);
            myPath[6] = new Vector2(17, 19);
            myPath[7] = new Vector2(25, 19);
            myPath[0] = new Vector2(25, 16);
            myPath[1] = new Vector2(25, 4);
            myPath[2] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(29, 17, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(29, 15, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(29, 16, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(29, 13, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];
            myPath[7] = new Vector2(8, 4);
            myPath[0] = new Vector2(8, 7);
            myPath[1] = new Vector2(8, 19);
            myPath[2] = new Vector2(17, 19);
            myPath[3] = new Vector2(25, 19);
            myPath[4] = new Vector2(25, 12);
            myPath[5] = new Vector2(25, 4);
            myPath[6] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(4, 7, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(4, 9, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(4, 8, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(4, 10, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            leaderZombie.setFollowers(followerZombies);

            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);

            stairs = new Stairs(board);

            BasicObject[] removableWalls = setRemovableWallsSwitchOne();

            BasicObject switchSquare = new BasicObject(board);
            switchSquare.X = 31;
            switchSquare.Y = 8;

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

            BasicObject[] removableWalls2 = setRemovableWallsSwitchTwo();

            BasicObject switchSquare2 = new BasicObject(board);
            switchSquare2.X = 1;
            switchSquare2.Y = 15;

            secondSwitch = new Switch(switchSquare2, board, removableWalls2);

            // Initial starting position
            darwin.setGridPosition(16, 22);

            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(16, 1))
            {
                stairs.setGridPosition(16, 1);
                stairs.setDestination(board.getPosition(16, 1));
            }

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

            setPotionPosition(28, 7);
            setPotion2Position(1, 7);

            setWallsInLevelFour();

            setDanceFloor();
        }
예제 #8
0
        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();
            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);
            gameState.setState(GameState.state.Level);

            board = new GameBoard(new Vector2(33, 25), new Vector2(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight));
            darwin = new 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);

            stairs = new Stairs(board);
            if (board.isGridPositionOpen(5, 18))
            {
                stairs.setGridPosition(5, 18);
            }

            // Initial starting position
            darwin.setGridPosition(6, 18);
            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;

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

            setPotionPosition(27, 5);

            setBoxes();
            setBoxPattern();
            pattern = new BoxPattern(board, spotsForPattern);

            setVortexes();

            setWalls();

            snake = new Snake(10, 9, 27, 5, 18, 5, board);
            snake2 = new Snake(8, 15, 27, 5, 18, 5, board);
            snake3 = new Snake(21, 9, 27, 5, 18, 5, board);
            snake4 = new Snake(21, 15, 27, 5, 18, 5, board);

            northZombie = new PyroZombie(15, 3, 25, 4, 3, 3, board);
            northZombie.setGridPosition(15, 3);
            northZombie.setCurrentPatrolPoint(new Vector2(27, 3));
            northZombie.setNextPatrolPoint(new Vector2(5, 3));
            
            southZombie = new PyroZombie(15, 20, 25, 4, 20, 20, board);
            southZombie.setGridPosition(15, 20);
            southZombie.setCurrentPatrolPoint(new Vector2(5, 20));
            southZombie.setNextPatrolPoint(new Vector2(27, 20));
           
            eastZombie = new PyroZombie(29, 11, 29, 29, 19, 4, board);
            eastZombie.setGridPosition(29, 11);
            eastZombie.setCurrentPatrolPoint(new Vector2(29, 17));
            eastZombie.setNextPatrolPoint(new Vector2(29, 6));

            westZombie = new PyroZombie(3, 11, 3, 3, 19, 4, board);
            westZombie.setGridPosition(3, 11);
            westZombie.setCurrentPatrolPoint(new Vector2(3, 5));
            westZombie.setNextPatrolPoint(new Vector2(3, 18));

            flames = new LinkedList<Flame>();

        }
예제 #9
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, 10, 15, 5, 15, 5, board);
            //secondZombie = new Zombie(10, 16, 15, 5, 15, 5, board);
            //thirdZombie = new Zombie(16, 10, 15, 5, 15, 5, board);

            fastZombie1 = new FastZombie(15, 15, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, board);

            this.leaves = new LinkedList<Leaf>();

            for (int i = 0; i < leafCount; i++)
            {
                this.leaves.AddLast(new Leaf(board, fastZombie1));
            }

            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);

            String fastString = "This one likes\n to sleep.\n Be careful\n not to wake him!!";
            fastMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, fastString);

            secondStair = new Stairs(board);

            brain = new Brain(board, 5, 18);

            BasicObject[] removableWallsAroundStairs = setRemovableWallsAroundStairs();

            BasicObject[] removableWallsAroundSwitch = setRemovableWallsAroundSwitch();

            BasicObject switchSquareOne = new BasicObject(board);
            switchSquareOne.X = 30;
            switchSquareOne.Y = 2;
            firstSwitch = new Switch(switchSquareOne, board, removableWallsAroundSwitch);

            BasicObject switchSquareTwo = new BasicObject(board);
            switchSquareTwo.X = 2;
            switchSquareTwo.Y = 21;
            secondSwitch = new Switch(switchSquareTwo, board, removableWallsAroundStairs);

            darwin.setGridPosition(2, 2);

            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(27, 21))
            {
                secondStair.setGridPosition(30, 21);
                secondStair.setDestination(board.getPosition(30, 21));
            }

            // add all the leaves to the map...
            leaves.ElementAt(0).setGridPosition(7, 7);
            leaves.ElementAt(1).setGridPosition(5, 15);
            leaves.ElementAt(2).setGridPosition(4, 2);
            leaves.ElementAt(3).setGridPosition(19, 7);
            leaves.ElementAt(4).setGridPosition(11, 21);
            leaves.ElementAt(5).setGridPosition(7, 8);
            leaves.ElementAt(6).setGridPosition(8, 17);
            leaves.ElementAt(7).setGridPosition(19, 2);
            leaves.ElementAt(8).setGridPosition(19, 1);
            leaves.ElementAt(9).setGridPosition(10, 14);
            leaves.ElementAt(10).setGridPosition(13, 4);
            leaves.ElementAt(11).setGridPosition(13, 3);
            leaves.ElementAt(12).setGridPosition(19, 16);
            leaves.ElementAt(13).setGridPosition(21, 7);
            leaves.ElementAt(14).setGridPosition(2, 16);
            leaves.ElementAt(15).setGridPosition(10, 18);
            leaves.ElementAt(16).setGridPosition(3, 16);
            leaves.ElementAt(17).setGridPosition(16, 15);
            leaves.ElementAt(18).setGridPosition(18, 8);
            leaves.ElementAt(19).setGridPosition(8, 5);
            leaves.ElementAt(20).setGridPosition(5, 7);
            leaves.ElementAt(21).setGridPosition(9, 5);
            leaves.ElementAt(22).setGridPosition(2, 6);
            leaves.ElementAt(23).setGridPosition(8, 8);
            leaves.ElementAt(24).setGridPosition(14, 6);
            leaves.ElementAt(25).setGridPosition(15, 7);
            leaves.ElementAt(26).setGridPosition(15, 8);
            leaves.ElementAt(27).setGridPosition(14, 10);
            leaves.ElementAt(28).setGridPosition(16, 18);
            leaves.ElementAt(29).setGridPosition(14, 22);
            leaves.ElementAt(30).setGridPosition(24, 2);
            leaves.ElementAt(31).setGridPosition(24, 3);
            leaves.ElementAt(32).setGridPosition(25, 6);
            leaves.ElementAt(33).setGridPosition(22, 8);
            leaves.ElementAt(34).setGridPosition(26, 6);
            leaves.ElementAt(35).setGridPosition(25, 10);
            leaves.ElementAt(36).setGridPosition(24, 11);
            leaves.ElementAt(37).setGridPosition(23, 14);
            leaves.ElementAt(38).setGridPosition(22, 17);
            leaves.ElementAt(39).setGridPosition(26, 20);
            leaves.ElementAt(41).setGridPosition(2, 22);
            leaves.ElementAt(42).setGridPosition(2, 20);
            leaves.ElementAt(43).setGridPosition(3, 21);
            leaves.ElementAt(44).setGridPosition(1, 21);
            leaves.ElementAt(45).setGridPosition(2, 18);
            leaves.ElementAt(46).setGridPosition(1, 18);
            leaves.ElementAt(47).setGridPosition(3, 18);
            leaves.ElementAt(48).setGridPosition(4, 18);
            leaves.ElementAt(49).setGridPosition(5, 19);
            leaves.ElementAt(50).setGridPosition(5, 20);
            leaves.ElementAt(51).setGridPosition(5, 21);
            leaves.ElementAt(52).setGridPosition(5, 22);
            leaves.ElementAt(53).setGridPosition(4, 1);
            leaves.ElementAt(54).setGridPosition(4, 2);
            leaves.ElementAt(55).setGridPosition(4, 3);
            leaves.ElementAt(56).setGridPosition(4, 4);
            leaves.ElementAt(57).setGridPosition(4, 5);
            leaves.ElementAt(58).setGridPosition(4, 6);
            leaves.ElementAt(59).setGridPosition(4, 7);
            leaves.ElementAt(60).setGridPosition(4, 8);
            leaves.ElementAt(61).setGridPosition(4, 9);
            leaves.ElementAt(62).setGridPosition(4, 10);
            leaves.ElementAt(63).setGridPosition(4, 11);
            leaves.ElementAt(64).setGridPosition(4, 12);
            leaves.ElementAt(65).setGridPosition(4, 13);
            leaves.ElementAt(66).setGridPosition(10, 4);
            leaves.ElementAt(67).setGridPosition(10, 5);
            leaves.ElementAt(68).setGridPosition(10, 6);
            leaves.ElementAt(69).setGridPosition(10, 7);
            leaves.ElementAt(70).setGridPosition(10, 8);
            leaves.ElementAt(71).setGridPosition(10, 9);
            leaves.ElementAt(72).setGridPosition(10, 10);
            leaves.ElementAt(73).setGridPosition(10, 11);
            leaves.ElementAt(74).setGridPosition(10, 12);
            leaves.ElementAt(75).setGridPosition(10, 13);
            leaves.ElementAt(76).setGridPosition(10, 14);
            leaves.ElementAt(77).setGridPosition(10, 15);
            leaves.ElementAt(78).setGridPosition(10, 16);
            leaves.ElementAt(79).setGridPosition(10, 17);
            leaves.ElementAt(80).setGridPosition(10, 18);
            leaves.ElementAt(81).setGridPosition(10, 19);
            leaves.ElementAt(82).setGridPosition(11, 19);
            leaves.ElementAt(83).setGridPosition(12, 19);
            leaves.ElementAt(84).setGridPosition(13, 19);
            leaves.ElementAt(85).setGridPosition(14, 19);
            leaves.ElementAt(86).setGridPosition(15, 19);
            leaves.ElementAt(87).setGridPosition(16, 19);
            leaves.ElementAt(88).setGridPosition(17, 19);
            leaves.ElementAt(89).setGridPosition(18, 19);
            leaves.ElementAt(90).setGridPosition(19, 19);
            leaves.ElementAt(91).setGridPosition(20, 19);
            leaves.ElementAt(92).setGridPosition(21, 19);
            leaves.ElementAt(93).setGridPosition(22, 19);
            leaves.ElementAt(94).setGridPosition(23, 19);
            leaves.ElementAt(95).setGridPosition(23, 18);
            leaves.ElementAt(96).setGridPosition(23, 17);
            leaves.ElementAt(97).setGridPosition(23, 16);
            leaves.ElementAt(98).setGridPosition(23, 15);
            leaves.ElementAt(99).setGridPosition(23, 14);
            leaves.ElementAt(100).setGridPosition(23, 13);
            leaves.ElementAt(101).setGridPosition(23, 12);
            leaves.ElementAt(102).setGridPosition(23, 11);
            leaves.ElementAt(103).setGridPosition(23, 10);
            leaves.ElementAt(104).setGridPosition(23, 9);
            leaves.ElementAt(105).setGridPosition(23, 8);
            leaves.ElementAt(106).setGridPosition(23, 7);
            leaves.ElementAt(107).setGridPosition(23, 6);
            leaves.ElementAt(108).setGridPosition(23, 5);
            leaves.ElementAt(109).setGridPosition(23, 4);
            leaves.ElementAt(110).setGridPosition(22, 4);
            leaves.ElementAt(111).setGridPosition(21, 4);
            leaves.ElementAt(112).setGridPosition(20, 4);
            leaves.ElementAt(113).setGridPosition(19, 4);
            leaves.ElementAt(114).setGridPosition(18, 4);
            leaves.ElementAt(115).setGridPosition(17, 4);
            leaves.ElementAt(116).setGridPosition(16, 4);
            leaves.ElementAt(117).setGridPosition(15, 4);
            leaves.ElementAt(118).setGridPosition(14, 4);
            leaves.ElementAt(119).setGridPosition(13, 4);
            leaves.ElementAt(120).setGridPosition(12, 4);
            leaves.ElementAt(121).setGridPosition(11, 4);

            leaves.ElementAt(134).setGridPosition(27, 1);
            leaves.ElementAt(135).setGridPosition(27, 2);
            leaves.ElementAt(136).setGridPosition(27, 3);

            leaves.ElementAt(122).setGridPosition(27, 4);
            leaves.ElementAt(123).setGridPosition(27, 5);
            leaves.ElementAt(124).setGridPosition(27, 6);
            leaves.ElementAt(125).setGridPosition(27, 7);
            leaves.ElementAt(126).setGridPosition(27, 8);
            leaves.ElementAt(127).setGridPosition(27, 9);
            leaves.ElementAt(128).setGridPosition(27, 10);
            leaves.ElementAt(129).setGridPosition(27, 11);
            leaves.ElementAt(130).setGridPosition(27, 12);
            leaves.ElementAt(131).setGridPosition(27, 13);
            leaves.ElementAt(132).setGridPosition(27, 14);
            leaves.ElementAt(133).setGridPosition(27, 15);

            zTime = new ZombieTime(board);
            zTimeReset = new ZombieTime(board);
        }
예제 #10
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();
        }