Exemple #1
0
        public LevelBluePrint GenerateBlueprint()
        {
            var blueprint = new LevelBluePrint();

            foreach (var tile in _Tiles)
            {
                blueprint.Add(tile);
            }

            return(blueprint);
        }
Exemple #2
0
        public static Level GenerateLevel(LevelBluePrint BluePrint, GraphicsDevice device)
        {
            Utility.TextureGenerator TextureGen = new Utility.TextureGenerator(device);
            var level = new Level();

            for (int i = 0; i < BluePrint.Storage.Count; i++)
            {
                BluePrint.OpenPrint(i);


                var tile = new Tile((Tiles.TileTypes)Convert.ToInt32(BluePrint.TileType), TextureGen.CreateTexture(Convert.ToInt32(BluePrint.TileWidth),
                                                                                                                   Convert.ToInt32(BluePrint.TileHeight), new Color(Convert.ToUInt32(BluePrint.Color))),
                                    new Microsoft.Xna.Framework.Vector2((float)Convert.ToInt32(BluePrint.X), (float)Convert.ToInt32(BluePrint.Y)),
                                    new Color(Convert.ToUInt32(BluePrint.Color)));

                level.AddTile(tile);
            }

            return(level);
        }