Exemplo n.º 1
0
        private void moveDarwin(KeyboardState ks, GameBoard board, int currentDarwinX, int currentDarwinY)
        {
            if (ks.IsKeyDown(Keys.Right))
            {
                facing = Dir.Right;
                if (board.isGridPositionOpen(currentDarwinX + 1, currentDarwinY))
                {
                    this.MoveRight();
                }

                /*else
                 * {
                 *  collision = true;
                 * }*/
            }
            if (ks.IsKeyDown(Keys.Left))
            {
                facing = Dir.Left;
                if (board.isGridPositionOpen(currentDarwinX - 1, currentDarwinY))
                {
                    this.MoveLeft();
                }

                /*else
                 * {
                 *  collision = true;
                 * }*/
            }
            if (ks.IsKeyDown(Keys.Up))
            {
                facing = Dir.Up;
                if (board.isGridPositionOpen(currentDarwinX, currentDarwinY - 1))
                {
                    this.MoveUp();
                }

                /*else
                 * {
                 *  collision = true;
                 * }*/
            }
            if (ks.IsKeyDown(Keys.Down))
            {
                facing = Dir.Down;
                if (board.isGridPositionOpen(currentDarwinX, currentDarwinY + 1))
                {
                    this.MoveDown();
                }

                /*else
                 * {
                 *  collision = true;
                 * }*/
            }
        }
Exemplo n.º 2
0
        /* constructor
         *  sets an initial area for the zombie to take up
         *  mymaxX, myminX are the max/min allowed horizontal range for the zombie
         *  mymaxY, myminY are the max/min allowed vertical range for the zombie
         *  Gameboard myboard -- the board which the zombie is moving on
         **/
        public Zombie(int startX, int startY, int mymaxX, int myminX, int mymaxY, int myminY, GameBoard myboard) : base(myboard)
        {
            maxX = mymaxX;
            maxY = mymaxY;
            minX = myminX;
            minY = myminY;

            // start with no zombie vision
            allowVision = false;
            visionMaxX  = 0;
            visionMaxY  = 0;

            allowRangeDetection = true;
            board = myboard;

            this.X = startX;
            this.Y = startY;

            if (board.isGridPositionOpen(this))
            {
                board.setGridPositionOccupied(this.X, this.Y);
            }

            destination = new Rectangle(0, 0, ZOMBIE_WIDTH, ZOMBIE_HEIGHT);
            this.setPosition(board.getPosition(this).X, board.getPosition(this).Y);
            source = new Rectangle(0, 0, ZOMBIE_WIDTH, ZOMBIE_HEIGHT);
        }
Exemplo n.º 3
0
        /* constructor
        *  sets an initial area for the zombie to take up
        *  mymaxX, myminX are the max/min allowed horizontal range for the zombie
        *  mymaxY, myminY are the max/min allowed vertical range for the zombie
        *  Gameboard myboard -- the board which the zombie is moving on
        **/
        public Zombie(int startX, int startY, int mymaxX, int myminX, int mymaxY, int myminY, GameBoard myboard) : base(myboard)
        {
            maxX = mymaxX;
            maxY = mymaxY;
            minX = myminX;
            minY = myminY;

            // start with no zombie vision
            allowVision = false;
            visionMaxX = 0;
            visionMaxY = 0;

            allowRangeDetection = true;
            board = myboard;

            this.X = startX;
            this.Y = startY;

            if (board.isGridPositionOpen(this))
            {
                board.setGridPositionOccupied(this.X, this.Y);
            }

            destination = new Rectangle(0, 0, ZOMBIE_WIDTH, ZOMBIE_HEIGHT);
            this.setPosition(board.getPosition(this).X, board.getPosition(this).Y);
            source = new Rectangle(0, 0, ZOMBIE_WIDTH, ZOMBIE_HEIGHT);
        }
Exemplo n.º 4
0
        private BasicObject[] setRemovableWallsInLevelTwo()
        {
            //later add an x and y to the constructor
            BasicObject s1 = new BasicObject(board);

            s1.X = 24;
            s1.Y = 19;

            BasicObject s2 = new BasicObject(board);

            s2.X = 24;
            s2.Y = 20;

            BasicObject s3 = new BasicObject(board);

            s3.X = 24;
            s3.Y = 21;

            BasicObject s4 = new BasicObject(board);

            s4.X = 24;
            s4.Y = 22;

            BasicObject s5 = new BasicObject(board);

            s5.X = 24;
            s5.Y = 18;


            removableWalls = new BasicObject[5] {
                s1, s2, s3, s4, s5
            };

            foreach (BasicObject bo in removableWalls)
            {
                if (board.isGridPositionOpen(bo))
                {
                    board.setGridPositionOccupied(bo);
                }
            }
            return(removableWalls);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
        // used for recursion
        // This is currently a huge mess, do not use this
        private void aStarHelper(Vector2 curPt, Vector2 goalPt, double costSoFar)
        {
            Vector2        minCostPt  = new Vector2(100000, 100000);
            Vector2        secCostPt  = new Vector2(100000, 100000);
            double         minCost    = 7000000000;
            double         curCostEst = 70000000;
            double         secMinCost = 70000000;
            bool           foundGoal  = false;
            List <Vector2> ptsToCheck = new List <Vector2>();

            //set cur node to checked
            hasBeenChecked[(int)curPt.X, (int)curPt.Y] = true;

            aStarSolution[curSpot] = curPt;
            curSpot++;

            Console.Out.WriteLine("x:{0},y:{1},num:{2}", curPt.X, curPt.Y, curSpot);
            //check all neighbours to curPt
            if (board.isGridPositionOpen((int)curPt.X + 1, (int)curPt.Y) && !hasBeenChecked[(int)curPt.X + 1, (int)curPt.Y])
            {
                curCostEst = (costSoFar + Math.Abs(goalPt.X - (curPt.X + 1)) + Math.Abs(goalPt.Y - curPt.Y));
                if (minCost > curCostEst)
                {
                    minCost   = curCostEst;
                    minCostPt = new Vector2(curPt.X + 1, curPt.Y);
                }
                else if (secMinCost >= curCostEst)
                {
                    secMinCost = curCostEst;
                    secCostPt  = new Vector2(curPt.X + 1, curPt.Y);
                }

                if (goalPt.X == curPt.X + 1 && goalPt.Y == curPt.Y)
                {
                    foundGoal = true;
                }
            }
            if (board.isGridPositionOpen((int)curPt.X - 1, (int)curPt.Y) && !hasBeenChecked[(int)curPt.X - 1, (int)curPt.Y])
            {
                curCostEst = (costSoFar + Math.Abs(goalPt.X - (curPt.X - 1)) + Math.Abs(goalPt.Y - curPt.Y));
                if (minCost > curCostEst)
                {
                    minCost   = curCostEst;
                    minCostPt = new Vector2(curPt.X - 1, curPt.Y);
                }
                else if (secMinCost >= curCostEst)
                {
                    secMinCost = curCostEst;
                    secCostPt  = new Vector2(curPt.X - 1, curPt.Y);
                }

                if (goalPt.X == curPt.X - 1 && goalPt.Y == curPt.Y)
                {
                    foundGoal = true;
                }
            }
            if (board.isGridPositionOpen((int)curPt.X, (int)curPt.Y + 1) && !hasBeenChecked[(int)curPt.X, (int)curPt.Y + 1])
            {
                curCostEst = (costSoFar + Math.Abs(goalPt.X - curPt.X) + Math.Abs(goalPt.Y - (curPt.Y + 1)));
                if (minCost > curCostEst)
                {
                    minCost   = curCostEst;
                    minCostPt = new Vector2(curPt.X, curPt.Y + 1);
                }
                else if (secMinCost >= curCostEst)
                {
                    secMinCost = curCostEst;
                    secCostPt  = new Vector2(curPt.X, curPt.Y + 1);
                }

                if (goalPt.X == curPt.X && goalPt.Y == curPt.Y + 1)
                {
                    foundGoal = true;
                }
            }
            if (board.isGridPositionOpen((int)curPt.X, (int)curPt.Y - 1) && !hasBeenChecked[(int)curPt.X, (int)curPt.Y - 1])
            {
                curCostEst = (costSoFar + Math.Abs(goalPt.X - curPt.X) + Math.Abs(goalPt.Y - (curPt.Y - 1)));
                if (minCost > curCostEst)
                {
                    minCost   = curCostEst;
                    minCostPt = new Vector2(curPt.X, curPt.Y - 1);
                }
                else if (secMinCost >= curCostEst)
                {
                    secMinCost = curCostEst;
                    secCostPt  = new Vector2(curPt.X, curPt.Y - 1);
                }

                if (goalPt.X == curPt.X && goalPt.Y == curPt.Y - 1)
                {
                    foundGoal = true;
                }
            }

            if (foundGoal)
            {
                curSpot++;
                aStarSolution[curSpot] = goalPt;
                foundLength            = curSpot + 1;
                foundSolution          = true;
            }
            else if (minCostPt.X == 100000 || curSpot > 90)
            {
                //abort path cannot be found
                foundSolution = false;
            }
            else if (foundGoal == false)
            {
                //Console.Out.WriteLine("{0},{1},{2},{3}",curSpot,minCostPt.X,minCostPt.Y,costSoFar);
                aStarHelper(minCostPt, goalPt, costSoFar + 1);

                if (secMinCost < 70000000)
                {
                    curSpot--;
                    aStarHelper(secCostPt, goalPt, costSoFar + 1);
                }
            }

            hasBeenChecked[(int)curPt.X, (int)curPt.Y] = false;
            curSpot--;
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 private void moveDarwin(KeyboardState ks, GameBoard board, int currentDarwinX, int currentDarwinY)
 {
     if (ks.IsKeyDown(Keys.Right))
     {
         facing = Dir.Right;
         if (board.isGridPositionOpen(currentDarwinX + 1, currentDarwinY))
         {
             this.MoveRight();
         }
         /*else
         {
             collision = true;
         }*/
     }
     if (ks.IsKeyDown(Keys.Left))
     {
         facing = Dir.Left;
         if(board.isGridPositionOpen(currentDarwinX -1, currentDarwinY))
         {
             this.MoveLeft();
         }
         /*else
         {
             collision = true;
         }*/
         
     }
     if (ks.IsKeyDown(Keys.Up))
     {
         facing = Dir.Up;
         if(board.isGridPositionOpen(currentDarwinX, currentDarwinY - 1))
         {
             this.MoveUp();
         }
         /*else
         {
             collision = true;
         }*/
     }
     if (ks.IsKeyDown(Keys.Down))
     {
         facing = Dir.Down;
         if(board.isGridPositionOpen(currentDarwinX, currentDarwinY + 1))
         {
             this.MoveDown();
         }
         /*else
         {
             collision = true;
         }*/
     }
 }
Exemplo n.º 9
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();
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
        private void moveDarwin(KeyboardState ks, GameBoard board, int currentDarwinX, int currentDarwinY)
        {
            // has a direction been picked to go in, used to get rid of diagonal movement
            bool hasPicked = false;

            if (ks.IsKeyDown(Keys.Right))
            {
                if (board.isGridPositionOpen(currentDarwinX + 1, currentDarwinY) && !hasPicked && facing == Dir.Right)
                {
                    hasPicked = true;
                    moveDirection = Dir.Right;
                    inMotion = true;
                    downCount = 1;
                }
                else
                {
                    facing = Dir.Right;
                    downCount = 0;
                }
            }
            if (ks.IsKeyDown(Keys.Left))
            {
                if (board.isGridPositionOpen(currentDarwinX - 1, currentDarwinY) && !hasPicked && facing == Dir.Left)
                {
                    hasPicked = true;
                    moveDirection = Dir.Left;
                    inMotion = true;
                    downCount = 1;
                }
                else
                {
                    facing = Dir.Left;
                    downCount = 0;
                }

            }
            if (ks.IsKeyDown(Keys.Up))
            {

                if (board.isGridPositionOpen(currentDarwinX, currentDarwinY - 1) && !hasPicked && facing == Dir.Up)
                {
                    hasPicked = true;
                    moveDirection = Dir.Up;
                    inMotion = true;
                    downCount = 1;
                }
                else
                {
                    facing = Dir.Up;
                    downCount = 0;
                }
            }
            if (ks.IsKeyDown(Keys.Down))
            {
                if (board.isGridPositionOpen(currentDarwinX, currentDarwinY + 1) && !hasPicked && facing == Dir.Down)
                {
                    hasPicked = true;
                    moveDirection = Dir.Down;
                    inMotion = true;
                    downCount = 1;
                }
                else
                {
                    facing = Dir.Down;
                    downCount = 0;
                }
            }
        }
Exemplo n.º 12
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();
        }
Exemplo n.º 13
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);
        }
Exemplo n.º 14
0
        private void moveDarwin(KeyboardState ks, GameBoard board, int currentDarwinX, int currentDarwinY)
        {
            // has a direction been picked to go in, used to get rid of diagonal movement
            bool hasPicked = false;

            if (ks.IsKeyDown(Keys.Right))
            {
                if (board.isGridPositionOpen(currentDarwinX + 1, currentDarwinY) && !hasPicked && facing == Dir.Right)
                {
                    hasPicked     = true;
                    moveDirection = Dir.Right;
                    inMotion      = true;
                    downCount     = 1;
                }
                else
                {
                    facing    = Dir.Right;
                    downCount = 0;
                }
            }
            if (ks.IsKeyDown(Keys.Left))
            {
                if (board.isGridPositionOpen(currentDarwinX - 1, currentDarwinY) && !hasPicked && facing == Dir.Left)
                {
                    hasPicked     = true;
                    moveDirection = Dir.Left;
                    inMotion      = true;
                    downCount     = 1;
                }
                else
                {
                    facing    = Dir.Left;
                    downCount = 0;
                }
            }
            if (ks.IsKeyDown(Keys.Up))
            {
                if (board.isGridPositionOpen(currentDarwinX, currentDarwinY - 1) && !hasPicked && facing == Dir.Up)
                {
                    hasPicked     = true;
                    moveDirection = Dir.Up;
                    inMotion      = true;
                    downCount     = 1;
                }
                else
                {
                    facing    = Dir.Up;
                    downCount = 0;
                }
            }
            if (ks.IsKeyDown(Keys.Down))
            {
                if (board.isGridPositionOpen(currentDarwinX, currentDarwinY + 1) && !hasPicked && facing == Dir.Down)
                {
                    hasPicked     = true;
                    moveDirection = Dir.Down;
                    inMotion      = true;
                    downCount     = 1;
                }
                else
                {
                    facing    = Dir.Down;
                    downCount = 0;
                }
            }
        }