Ejemplo n.º 1
0
 public static void TopDoor(Room r, TileType fillType)
 {
     for (int x = TB_DOOR_X; x < TB_DOOR_X + TB_DOOR_WIDTH; x++){
         for (int y = r.Height - TB_DOOR_HEIGHT; y < r.Height; y++){
             r[x,y] = new Tile(fillType);
         }
     }
 }
Ejemplo n.º 2
0
 public static void RightDoor(Room r, TileType fillType)
 {
     for (int x = r.Width - LR_DOOR_WIDTH; x < r.Width; x++){
         for (int y = LR_DOOR_Y; y < LR_DOOR_Y + LR_DOOR_HEIGHT; y++){
             r[x,y] = new Tile(fillType);
         }
     }
 }
Ejemplo n.º 3
0
 public static void LeftDoor(Room r, TileType fillType)
 {
     for (int x = 0; x < LR_DOOR_WIDTH; x++){
         for (int y = LR_DOOR_Y; y < LR_DOOR_Y + LR_DOOR_HEIGHT; y++){
             r[x,y] = new Tile(fillType);
         }
     }
 }
Ejemplo n.º 4
0
 public static void BottomDoor(Room r, TileType fillType)
 {
     for (int x = TB_DOOR_X; x < TB_DOOR_X + TB_DOOR_WIDTH; x++){
         for (int y = 0; y < TB_DOOR_HEIGHT; y++){
             r[x,y] = new Tile(fillType);
         }
     }
 }
Ejemplo n.º 5
0
Archivo: Room.cs Proyecto: JvJ/CotWM
        public static Room RoomFromMaze(Maze m)
        {
            Room ret = new Room(m.Width, m.Height);

            for (int x = 0; x < ret.Width; x++){
                for (int y = 0; y < ret.Height; y++){
                    switch(m[x,y]){
                    case MazeTileType.WALL:
                        ret[x,y] = new Tile(TileType.ROCK);
                        break;
                    case MazeTileType.SPACE:
                        ret[x,y] = new Tile(TileType.BLANK);
                        break;
                    default:
                        ret[x,y] = new Tile(TileType.BLANK);
                        break;
                    }
                }
            }

            return ret;
        }
Ejemplo n.º 6
0
Archivo: Room.cs Proyecto: JvJ/CotWM
        /// <summary>
        /// Totally random room generation 
        /// </summary>
        /// <param name="width">
        /// A <see cref="System.Int32"/>
        /// </param>
        /// <param name="height">
        /// A <see cref="System.Int32"/>
        /// </param>
        /// <returns>
        /// A <see cref="Room"/>
        /// </returns>
        public static Room RandomRoom(int width, int height)
        {
            System.Random r = new System.Random();

            Room ret = new Room(width, height);

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    TileType t = TileType.BLANK;

                    switch (r.Next() % 3)
                    {
                        case 0:
                            t = TileType.BLANK;
                            break;
                        case 1:
                            t = TileType.ROCK;
                            break;
                        case 2:
                            t = TileType.SNOW;
                            break;
                    }

                    ret[x, y] = new Tile(t);
                }
            }

            return ret;
        }