Ejemplo n.º 1
0
        public FoundRoadTest(Game game, GraphicsDeviceManager graphics)
            : base(game)
        {
            this.width  = graphics.PreferredBackBufferWidth;
            this.height = graphics.PreferredBackBufferHeight;
            this.effect = new BasicEffect(game.GraphicsDevice);
            this.effect.VertexColorEnabled = true;
            this.graphics = graphics;
            int w, h;

            if (width % 10 != 0)
            {
                w = width / 10;
            }
            else
            {
                w = width / 10 - 1;
            }
            if (height % 10 != 0)
            {
                h = height / 10;
            }
            else
            {
                h = height / 10 - 1;
            }
            this.start = new MyAStarPoint(0, 0);
            this.end   = new MyAStarPoint(w, h);
            this.aStar = new MyAStar(width / 10, height / 10, start, end);
            lineData   = new VertexPositionColor[w * h * 2];
            data       = new int[width / 10, height / 10];
        }
Ejemplo n.º 2
0
 void Awake()
 {
     instance   = this;
     plane      = GameObject.Find("Plane").transform;
     parentList = new Stack <string> ();
     openList   = new List <Grid> ();
     closeList  = new List <Grid> ();
 }
Ejemplo n.º 3
0
 void Awake()
 {
     instance = this;
     plane    = GameObject.Find("Plane").transform;
     //start = GameObject.Find ("Start").transform;
     //end = GameObject.Find ("End").transform;
     //obstacle = GameObject.Find ("Obstacle").transform;
     parentList = new Stack <string> ();
     openList   = new ArrayList();
     closeList  = new ArrayList();
 }