Esempio n. 1
0
        public LevelBuilder(int width, int height, Rectangle finish, Rectangle shop, LevelBuilder nextLevel)
        {
            coins       = new List <Rectangle>();
            walls       = new List <Rectangle>();
            lava        = new List <Rectangle>();
            Width       = width;
            Height      = height;
            this.finish = finish;
            this.shop   = shop;
            if (shop.Height != 0)
            {
                hints.Add(new Hint(new Rectangle(0, 0, width, height),
                                   "Для выбора предметов из инвентаря используйте 1, 2, 3, чтобы снять - Z",
                                   l => l.player.Tools.Count > 0));
                hints.Add(new Hint(shop, "Нажмите С чтобы войти в магазин"));
            }

            monsters       = new List <Monster>();
            this.nextLevel = nextLevel;
        }
Esempio n. 2
0
 public Level(int LevelHeight, int LevelWidth,
              IEnumerable <Rectangle> walls, IEnumerable <Rectangle> coins, IEnumerable <Rectangle> lava,
              int gForce, Player player, IEnumerable <Monster> monsters, Rectangle finish, Rectangle shop, LevelBuilder nextLevel, List <Hint> hints = null)
 {
     this.hints       = hints ?? new List <Hint>();
     IsOver           = false;
     NeedToChangeHint = false;
     this.LevelHeight = LevelHeight;
     this.LevelWidth  = LevelWidth;
     Walls            = walls.Select(r => new GameCell(CellType.Wall, r)).ToArray();
     Coins            = new Dictionary <Rectangle, int>();
     foreach (var coin in coins)
     {
         Coins[coin] = 1;
     }
     Lava           = lava.Select(r => new GameCell(CellType.Lava, r)).ToArray();
     gravityForce   = gForce;
     this.player    = player;
     this.monsters  = monsters.ToList();
     this.finish    = finish;
     this.shop      = shop;
     this.nextLevel = nextLevel;
 }