예제 #1
0
파일: Agent.cs 프로젝트: xingped/BomberBall
        public void InitializePieSliceSensorEnemies()
        {
            //create ranges to add
            List<Tuple<float, float>> ranges = new List<Tuple<float, float>>();
            ranges.Add(new Tuple<float, float>(MathHelper.ToRadians(315), MathHelper.ToRadians(45)));
            ranges.Add(new Tuple<float, float>(MathHelper.ToRadians(45), MathHelper.ToRadians(135)));
            ranges.Add(new Tuple<float, float>(MathHelper.ToRadians(135), MathHelper.ToRadians(225)));
            ranges.Add(new Tuple<float, float>(MathHelper.ToRadians(225), MathHelper.ToRadians(315)));

            //create adjacency list that is fed into the pie slice sensor
            InitializeAdjacencyListEnemies();

            //create the pie slice sensor
            m_PieSliceSensorEnemies = new PieSliceSensor(ranges, m_AdjacencyListEnemies);
        }
예제 #2
0
파일: Agent.cs 프로젝트: xingped/BomberBall
        public void InitializePieSliceSensorBombs()
        {
            //create ranges to add
            List<Tuple<float, float>> ranges = new List<Tuple<float, float>>();
            for (int i = 0; i < 8; i++)
            {
                ranges.Add(new Tuple<float, float>(MathHelper.ToRadians(i * 45), MathHelper.ToRadians(((i + 1) % 8) * 45)));
            }

            //create adjacency list to be fed into pie slices sensor
            InitializeAdjacencyListBombs();

            //create the pie slice sensor
            m_PieSliceSensorBombs = new PieSliceSensor(ranges, m_AdjacencyListBombs);
        }