Exemplo n.º 1
0
        public void InitializeRooster(int init)
        {
            //Populate List to hold vector3 node positions for rooster

            roosterPathValues.Add(new Vector3(1300, 270, 1000));  //0
            roosterPathValues.Add(new Vector3(1300, 270, 3500));  //1
            roosterPathValues.Add(new Vector3(1300, 270, 5200));  //2
            roosterPathValues.Add(new Vector3(2200, 270, 4000));  //3
            roosterPathValues.Add(new Vector3(3500, 270, 1000));  //4
            roosterPathValues.Add(new Vector3(3000, 270, 3500));  //5
            roosterPathValues.Add(new Vector3(3500, 270, 3500));  //6
            roosterPathValues.Add(new Vector3(3500, 270, 5200));  //7
            roosterPathValues.Add(new Vector3(3700, 270, 2200));  //8
            roosterPathValues.Add(new Vector3(3700, 270, 4300));  //9
            roosterPathValues.Add(new Vector3(4800, 270, 1000));  //10
            roosterPathValues.Add(new Vector3(4800, 270, 3500));  //11
            roosterPathValues.Add(new Vector3(4800, 270, 5200));  //12
            roosterPathValues.Add(new Vector3(2150, 270, 2200));  //13
            roosterPathValues.Add(new Vector3(2200, 270, 3500));  //14

            //populate array with path connections for rooster
            roosterPathA = new int[,] {
                {0,1,0,0,1,0,0,0,0,0,0,0,0,0,0}, //0
                {1,0,1,1,0,0,0,0,0,0,0,0,0,0,1}, //1
                {0,1,0,1,0,0,0,1,0,0,0,0,0,0,0}, //2
                {0,1,1,0,0,1,0,1,0,0,0,0,0,0,1}, //3
                {1,0,0,0,0,1,1,0,1,0,1,0,0,0,0}, //4
                {0,0,0,1,1,0,1,1,0,0,0,0,0,0,1}, //5
                {0,0,0,0,1,1,0,1,1,1,0,1,0,0,0}, //6
                {0,0,1,1,0,1,1,0,0,1,0,0,1,0,0}, //7
                {0,0,0,0,1,0,1,0,0,0,1,1,0,0,0}, //8
                {0,0,0,0,0,0,1,1,0,0,0,1,1,0,0}, //9
                {0,0,0,0,1,0,0,0,1,0,0,1,0,0,0}, //10
                {0,0,0,0,0,0,1,0,1,1,1,0,1,0,0}, //11
                {0,0,0,0,0,0,0,1,0,1,0,1,0,0,0}, //12
                {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, //13
                {0,1,0,1,0,0,1,0,0,0,0,0,0,0,0}  //14
            };

            //bounding box setting
            barn = new BoundBox(2000, 3000, 1600, 2750);
            fence = new BoundBox(620, 5405, 370, 6005);

            //get rooster initial position
            roosterInitNode = init;

            //set rooster current position equal to the initial position
            roosterCurrentNode = roosterInitNode;
            position = (roosterPathValues[roosterCurrentNode]);
            RoosterNextNode();
            rotation = 0;
            //position = roosterPathValues[14];
        }
Exemplo n.º 2
0
        public void initializeFox(Vector3 newPosition, int numChic)
        {
            // set the poistion to the spot it starts off at
            position = newPosition;
            positionOld = newPosition;

            //set the amount of max chickens we have
            chickenList = new ChickenClass[numChic];

            //path values
            foxPathValues.Add(new Vector3( 800, 180,  600));  //0
            foxPathValues.Add(new Vector3( 800, 180, 3500));  //1
            foxPathValues.Add(new Vector3( 800, 180, 5700));  //2
            foxPathValues.Add(new Vector3(1950, 180, 1500));  //3
            foxPathValues.Add(new Vector3(1950, 180, 2700));  //4
            foxPathValues.Add(new Vector3(2800, 180, 4200));  //5
            foxPathValues.Add(new Vector3(3000, 180, 1500));  //6
            foxPathValues.Add(new Vector3(3000, 180, 2700));  //7
            foxPathValues.Add(new Vector3(3400, 180,  600));  //8
            foxPathValues.Add(new Vector3(3300, 180, 5700));  //9
            foxPathValues.Add(new Vector3(4000, 180, 2600));  //10
            foxPathValues.Add(new Vector3(4000, 180, 3700));  //11
            foxPathValues.Add(new Vector3(5200, 180,  600));  //12
            foxPathValues.Add(new Vector3(5200, 180, 3500));  //13
            foxPathValues.Add(new Vector3(5200, 180, 5700));  //14
            foxPathValues.Add(new Vector3(1500, 180, 5700));  //15
            foxPathValues.Add(new Vector3(1500, 180, 6500));  //16  start and run to position

            //populate array with path connections for rooster
            foxPathA = new int[,] {
                {0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0},  //0
                {1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0},  //1
                {0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0},  //2
                {1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0},  //3
                {0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0},  //4
                {0,1,1,0,1,0,0,1,0,1,0,1,0,0,0,0,0},  //5
                {0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0},  //6
                {0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,0},  //7
                {1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0},  //8
                {0,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0},  //9
                {0,0,0,0,0,0,0,1,1,0,0,1,1,1,0,0,0},  //10
                {0,0,0,0,0,1,0,1,0,1,1,0,0,1,1,0,0},  //11
                {0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0},  //12
                {0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0},  //13
                {0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0},  //14
                {0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0},  //15
                {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}   //16
            };

            //get rooster initial position
            foxInitNode = 16;

            //set rooster current position equal to the initial position
            foxCurrentNode = foxInitNode;
            position = (foxPathValues[foxCurrentNode]);
            FoxNextNode();
            position = (foxPathValues[16]);
            rotation = MathHelper.Pi;

            //bounding box for fox
            barn = new BoundBox(2000, 3000, 1600, 2650);
            fence = new BoundBox(620, 5405, 370, 6005);
        }