Example #1
0
        internal Dungeon BuildLevel(RoomType[,] plan)
        {
            this.Dungeon = new Dungeon();

            for (int x = 0; x < Level.LEVEL_WIDTH; x++)
                for (int y = 0; y < Level.LEVEL_HEIGHT; y++)
                {
                    Room room = plan[x, y].CreateRoom();
                    this.Dungeon.AddRoom(room, new Vector2(x, y));
                }

            this.BuildLadders();
            this.BuildStart();
            this.BuildExit();

            return this.Dungeon;
        }
Example #2
0
        public Level()
        {
            CollisionSolver.Level = this;
            Block.Graphic = Controller.Content.Load<Texture2D>("tilemap");
            Block.BorderGraphic = Controller.Content.Load<Texture2D>("level/borders_bunker");
            this.Collidable = true;

            this.InitializeBackground();
            this.Architect = new Architect();
            this.Builder = new Builder();
            this.Furnisher = new Furnisher();

            RoomType[,] plan = this.Architect.GenerateLevel();
            this.Dungeon = this.Builder.BuildLevel(plan);

            this.Furnisher.FurnishRooms(this.Dungeon.Rooms);

            this.AddChild(this.Dungeon);
        }