Exemplo n.º 1
0
        public TileList(Gmap gamemap, Unit ghost)
        {
            EntityList = new List<DepthSortedEntity>();

            DepthSortedEntity tmp = null;

            /*	Get the tiles (DIAMOND SHAPE !):	*/
            for (int i = 0; i < gamemap.height; i++)
            {
                for (int j = 0; j < i+1; j++)
                {
                    tmp = new DepthSortedEntity( j, i-j, gamemap.getHeight(j, i-j), gamemap.tileType(j, i-j), 0F );
                    EntityList.Add(tmp);
                }
            }
            for (int i = 1; i < gamemap.height+1; i++)
            {
                for (int j = 0; j < gamemap.width-i; j++)
                {
                    tmp = new DepthSortedEntity(i + j, gamemap.width - j - 1, gamemap.getHeight(i + j, gamemap.width - j - 1), gamemap.tileType(i + j, gamemap.width - j - 1), 0F);
                    EntityList.Add(tmp);
                }
            }

            /*	Add the ghost (HIS INDEX IS 7 FROM NOW ON !!!!):	*/
            tmp = new DepthSortedEntity(ghost.pos.PosXMatrix, ghost.pos.PosYMatrix, gamemap.getHeight(ghost.pos.PosXMatrix, ghost.pos.PosYMatrix), 7, 0F);
            EntityList.Add(tmp);

            this.SortList();
        }
Exemplo n.º 2
0
        public TileList(Gmap gamemap, Unit ghost)
        {
            EntityList = new List <DepthSortedEntity>();

            DepthSortedEntity tmp = null;


            /*	Get the tiles (DIAMOND SHAPE !):	*/
            for (int i = 0; i < gamemap.height; i++)
            {
                for (int j = 0; j < i + 1; j++)
                {
                    tmp = new DepthSortedEntity(j, i - j, gamemap.getHeight(j, i - j), gamemap.tileType(j, i - j), 0F);
                    EntityList.Add(tmp);
                }
            }
            for (int i = 1; i < gamemap.height + 1; i++)
            {
                for (int j = 0; j < gamemap.width - i; j++)
                {
                    tmp = new DepthSortedEntity(i + j, gamemap.width - j - 1, gamemap.getHeight(i + j, gamemap.width - j - 1), gamemap.tileType(i + j, gamemap.width - j - 1), 0F);
                    EntityList.Add(tmp);
                }
            }

            /*	Add the ghost (HIS INDEX IS 7 FROM NOW ON !!!!):	*/
            tmp = new DepthSortedEntity(ghost.pos.PosXMatrix, ghost.pos.PosYMatrix, gamemap.getHeight(ghost.pos.PosXMatrix, ghost.pos.PosYMatrix), 7, 0F);
            EntityList.Add(tmp);

            this.SortList();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            _gamemap = new Gmap(@"Content\gamefile.txt", @"Content\heightmap.txt");
            _cam     = new Camera();

            /*	THIS IS FOR THE CUSTOM CURSOR:	*/
            this.IsMouseVisible = true;
            Cursor myCursor = NativeMethods.LoadCustomCursor(@"Content\myCursor.cur");
            Form   winForm  = (Form)Form.FromHandle(this.Window.Handle);

            winForm.Cursor = myCursor;
            /*	CURSOR END.	*/

            /*	GET A FIRST KEYBOARD STATE:	*/
            KBstate_old = Keyboard.GetState();
            _cursor     = new IsoPoint();


            base.Initialize();
        }
Exemplo n.º 4
0
 public Astar(Route route, Gmap gamemap)
 {
     this.route   = route;
     this.gamemap = gamemap;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            _gamemap = new Gmap(@"Content\gamefile.txt", @"Content\heightmap.txt");
            _cam = new Camera();

            /*	THIS IS FOR THE CUSTOM CURSOR:	*/
            this.IsMouseVisible = true;
            Cursor myCursor = NativeMethods.LoadCustomCursor(@"Content\myCursor.cur");
            Form winForm = (Form)Form.FromHandle(this.Window.Handle);
            winForm.Cursor = myCursor;
            /*	CURSOR END.	*/

            /*	GET A FIRST KEYBOARD STATE:	*/
            KBstate_old = Keyboard.GetState();
            _cursor = new IsoPoint();

            base.Initialize();
        }