Ejemplo n.º 1
0
        private void loadRandomDungeon(Engine.ObjectGrid parent, RandomDungeonGenerator generator)
        {
            var rooms = LoadRandomDungeonRooms(parent, generator);

            for (int x = 0; x < rooms.GetLength(0); x++)
            {
                for (int y = 0; y < rooms.GetLength(1); y++)
                {
                    parent.setTile(x + (int)generator.Position.X, y + (int)generator.Position.Y, rooms[x, y]);
                }
            }
        }
Ejemplo n.º 2
0
        public override void Setup(GameMode gameMode)
        {
            base.Setup(gameMode);
            IsTopDown = false;
            var levelGrid = new Engine.ObjectGrid("levelGrid", this, 3, 3, 1920, 960);

            levelGrid.CanCollide = true;
            AddGridToLevelGrid(0, 0, levelGrid, new string[] { "96" });
            AddGridToLevelGrid(1, 0, levelGrid, new string[] { "97" });
            AddGridToLevelGrid(2, 0, levelGrid, new string[] { "98" });
            AddGridToLevelGrid(2, 1, levelGrid, new string[] { "46" });
            AddGridToLevelGrid(0, 1, levelGrid, new string[] { "26" });
            AddGridToLevelGrid(0, 2, levelGrid, new string[] { "100" });
            AddGridToLevelGrid(1, 1, levelGrid, new string[] { "99" });
            AddGridToLevelGrid(1, 2, levelGrid, new string[] { "110" });
            Add(levelGrid);

            var teleporterback = new Teleporter("teleporter", this, "MainWorld", new Microsoft.Xna.Framework.Vector2(4416, 5184));

            teleporterback.Position    = new Microsoft.Xna.Framework.Vector2(3456, 2688);
            teleporterback.BoundingBox = new Rectangle(0, 0, 96, 96);
            Add(teleporterback);

            var MinidungeonItem = new UpgradePickup("Alles100", this, new SpriteSheet("Textures/Items/Alles100"), "Increases all stats by 100!");

            MinidungeonItem.Position    = new Vector2(3360, 2688);
            MinidungeonItem.Health      = 100;
            MinidungeonItem.Damage      = 100;
            MinidungeonItem.AttackSpeed = 100;
            MinidungeonItem.Speed       = 100;

            var MinidungeonItem2 = new UpgradePickup("Health100", this, new SpriteSheet("Textures/Items/Health100"), "Increases Health by 100!");

            MinidungeonItem2.Position = new Vector2(1536, 400);
            MinidungeonItem2.Health   = 100;

            Add(MinidungeonItem);
            Add(MinidungeonItem2);
        }
Ejemplo n.º 3
0
 public Map(string id, ObjectGrid grid, int tileSize, Object parent) : base(id, parent)
 {
     grid.Parent = this;
     Add(grid);
     BoundingBox = grid.BoundingBox;
 }