Exemple #1
0
        /// <summary>
        /// Pass a text symbol and the appropriate type gets created and added to the map
        /// </summary>
        /// <param name="symbol"></param>
        public MapTile CreateTile(char symbol, int x, int y)
        {
            switch (symbol)
            {
            //blank tile
            case ' ':
            {
                MapTileSpace t = new MapTileSpace();
                t.X         = x;
                t.Y         = y;
                Tiles[y, x] = t;
            }
            break;

            //wall tile
            case '#':
            {
                MapTileWall w = new MapTileWall();
                w.X         = x;
                w.Y         = y;
                Tiles[y, x] = w;
            }
            break;

            //door tile
            case '%':
            {
                MapTileDoor d = new MapTileDoor();
                d.X         = x;
                d.Y         = y;
                Tiles[y, x] = d;
            }
            break;

            //stairs up tile
            case '«':
            {
                MapTileStairs d = new MapTileStairs(-1);
                d.X         = x;
                d.Y         = y;
                Tiles[y, x] = d;
            }
            break;

            //stairs down tile
            case '»':
            {
                MapTileStairs d = new MapTileStairs(1);
                d.X         = x;
                d.Y         = y;
                Tiles[y, x] = d;
            }
            break;
            }
            return(Tiles[y, x]);
        }
Exemple #2
0
        /// <summary>
        /// Pass a text symbol and the appropriate type gets created and added to the map
        /// </summary>
        /// <param name="symbol"></param>
        public MapTile CreateTile(char symbol, int x, int y)
        {
            switch (symbol)
            {
            //blank tile
            case ' ':
            {
                MapTileSpace t = new MapTileSpace();
                t.X         = x;
                t.Y         = y;
                Tiles[y, x] = t;
            }
            break;

            //wall tile
            case '#':
            {
                MapTileWall w = new MapTileWall();
                w.X         = x;
                w.Y         = y;
                Tiles[y, x] = w;
            }
            break;

            //door tile
            case '%':
            {
                MapTileDoor d = new MapTileDoor();
                d.X         = x;
                d.Y         = y;
                Tiles[y, x] = d;
            }
            break;

            //blank tile with a player on it
            case '1':
            {
                MapTileSpace t = new MapTileSpace();
                t.X         = x;
                t.Y         = y;
                Tiles[y, x] = t;

                ThePlayer.X = x;
                ThePlayer.Y = y;
            }
            break;
            }
            return(Tiles[y, x]);
        }
Exemple #3
0
        /// <summary>
        /// Pass a text symbol and the appropriate type gets created and added to the map
        /// </summary>
        /// <param name="symbol"></param>
        public MapTile CreateTile(char symbol, int x, int y)
        {
            switch (symbol)
            {
            //blank tile
            case ' ':
            {
                MapTileSpace t = new MapTileSpace();
                t.X         = x;
                t.Y         = y;
                Tiles[y, x] = t;
            }
            break;

            //wall tile
            case '#':
            {
                MapTileWall w = new MapTileWall();
                w.X         = x;
                w.Y         = y;
                Tiles[y, x] = w;
            }
            break;

            //door tile
            case '%':
            {
                MapTileDoor d = new MapTileDoor();
                d.X         = x;
                d.Y         = y;
                Tiles[y, x] = d;
            }
            break;

            //blank tile
            case '1':
            {
                MapTileSpace t = new MapTileSpace();
                t.X         = x;
                t.Y         = y;
                Tiles[y, x] = t;
                //TODO add code to create player object
            }
            break;
            }
            return(Tiles[y, x]);
        }