示例#1
0
 public void MoveRight()
 {
     this.setGridPosition(this.X + 1, this.Y);
     board.setGridPositionOccupied(this.X, this.Y);
     board.setGridPositionOpen(this.X - 1, this.Y);
     this.setPosition(board.getPosition(this).X, board.getPosition(this).Y);
 }
示例#2
0
        public void setLevelState()
        {
            board.setGridPositionOpen(darwin);
            darwin.setGridPosition(2, 2);

            board.setGridPositionOpen(firstZombie);

            firstZombie.setGridPosition(10, 10);

            // reset each leaf for new level
            foreach (Leaf leaf in this.leaves)
            {
                leaf.resetLeaf();
            }

            board.setGridPositionOpen(fastZombie1);
            fastZombie1.chasingDarwin = false;
            fastZombie1.goBackToSleep();
            fastZombie1.setGridPosition(15, 15);

            board.setGridPositionOpen(brain);
            brain.setGridPosition(5, 18);

            darwin.setHuman();
            darwin.setDarwinAlive();
            playDeathSound  = true;
            gameOverCounter = 0;
            firstSwitch.turnOn();
            secondSwitch.turnOn();
            board.setGridPositionOccupied(firstSwitch);
            board.setGridPositionOccupied(secondSwitch);

            gameOver = false;
            gameWin  = false;

            Keyboard.GetState();
        }
示例#3
0
        // for conveniently reseting level
        public void setLevelState()
        {
            gameOver = false;
            gameWin  = false;

            fellDownPit     = false;
            fellDownCounter = 0;

            board.setGridPositionOpen(darwin);
            darwin.setGridPosition(2, 20);

            zTime.reset();

            board.setGridPositionOpen(firstZombie);
            board.setGridPositionOpen(secondZombie);
            board.setGridPositionOpen(thirdZombie);
            board.setGridPositionOpen(fourthZombie);
            board.setGridPositionOpen(fifthZombie);
            board.setGridPositionOpen(sixthZombie);
            board.setGridPositionOpen(brain);
            board.setGridPositionOpen(potion);

            firstZombie.setGridPosition(10, 10);
            board.setGridPositionOccupied(firstZombie.X, firstZombie.Y);
            firstZombie.setZombieAlive(true);

            secondZombie.setGridPosition(10, 16);
            board.setGridPositionOccupied(secondZombie.X, secondZombie.Y);
            secondZombie.setZombieAlive(true);

            thirdZombie.setGridPosition(12, 10);
            board.setGridPositionOccupied(thirdZombie.X, thirdZombie.Y);
            thirdZombie.setZombieAlive(true);

            fourthZombie.setGridPosition(20, 7);
            board.setGridPositionOccupied(fourthZombie.X, fourthZombie.Y);
            fourthZombie.setZombieAlive(true);

            fifthZombie.setGridPosition(22, 10);
            board.setGridPositionOccupied(fifthZombie.X, fifthZombie.Y);
            fifthZombie.setZombieAlive(true);

            sixthZombie.setGridPosition(22, 10);
            board.setGridPositionOccupied(sixthZombie.X, sixthZombie.Y);
            sixthZombie.setZombieAlive(true);

            potion.setGridPosition(25, 4);

            brain.setGridPosition(3, 3);
            brain.setVisible(true);
            board.setGridPositionOccupied(brain.X, brain.Y);

            potion.reset();
            darwin.setHuman();
            darwin.setDarwinAlive();
            playDeathSound = true;
            firstSwitch.turnOn();

            firstSwitch.turnOn();

            Keyboard.GetState();
        }
示例#4
0
        public void setLevelState()
        {
            board.setGridPositionOpen(darwin);
            darwin.setGridPosition(21, 20);
            board.setGridPositionOccupied(darwin);

            board.setGridPositionOpen(firstZombie.X, firstZombie.Y);
            firstZombie.setGridPosition(10, 9);
            board.setGridPositionOccupied(firstZombie.X, firstZombie.Y);
            firstZombie.setZombieAlive(true);

            board.setGridPositionOpen(secondZombie.X, secondZombie.Y);
            secondZombie.setGridPosition(12, 9);
            board.setGridPositionOccupied(secondZombie.X, secondZombie.Y);
            secondZombie.setZombieAlive(true);

            board.setGridPositionOpen(thirdZombie.X, thirdZombie.Y);
            thirdZombie.setGridPosition(8, 8);
            board.setGridPositionOccupied(thirdZombie.X, thirdZombie.Y);
            thirdZombie.setZombieAlive(true);

            board.setGridPositionOpen(fourthZombie.X, fourthZombie.Y);
            fourthZombie.setGridPosition(8, 12);
            board.setGridPositionOccupied(fourthZombie.X, fourthZombie.Y);
            fourthZombie.setZombieAlive(true);

            List <Zombie> myZombieList = new List <Zombie>();

            myZombieList.Add(firstZombie);
            myZombieList.Add(secondZombie);
            myZombieList.Add(thirdZombie);
            myZombieList.Add(fourthZombie);
            cannibalZombie.updateListOfZombies(myZombieList);

            board.setGridPositionOpen(cannibalZombie.X, cannibalZombie.Y);
            cannibalZombie.setGridPosition(29, 3);
            board.setGridPositionOccupied(cannibalZombie.X, cannibalZombie.Y);
            cannibalZombie.setZombieAlive(true);

            potion.setGridPosition(3, 3);
            potion.reset();

            zTime.reset();
            zTime.setTime(zTimeReset.getTime());

            darwin.setHuman();
            darwin.setDarwinAlive();
            playDeathSound  = true;
            playSound       = true;
            gameOverCounter = 0;
            gameOver        = false;
            gameWin         = false;

            Keyboard.GetState();
        }