Esempio n. 1
0
 // set ranges to whole board
 public CongaFollowerZombie(int startX, int startY, int mymaxX, int myminX, int mymaxY, int myminY, Vector2[] myPathList, CongaLeaderZombie myLeader, Darwin mydarwin, GameBoard myboard) :
     base(startX, startY, mymaxX, myminX, mymaxY, myminY, myboard)
 {
     allowRangeDetection = false;
     allowVision         = true;
     visionMaxX          = 4;
     visionMaxY          = 4;
     darwin           = mydarwin;
     pathList         = myPathList;
     ZOMBIE_MOVE_RATE = 20;
     startPosit       = new Vector2(startX, startY);
     leaderZombie     = myLeader;
 }
 // set ranges to whole board
 public CongaFollowerZombie(int startX, int startY, int mymaxX, int myminX, int mymaxY, int myminY, Vector2[] myPathList,CongaLeaderZombie myLeader, Darwin mydarwin, GameBoard myboard)
     : base(startX, startY, mymaxX, myminX, mymaxY, myminY, myboard)
 {
     allowRangeDetection = false;
     allowVision = true;
     visionMaxX = 4;
     visionMaxY = 4;
     darwin = mydarwin;
     pathList = myPathList;
     ZOMBIE_MOVE_RATE = 20;
     startPosit = new Vector2(startX,startY);
     leaderZombie = myLeader;
 }
Esempio n. 3
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();
        }