private void AddFirstLevel() { // Load all level information from XML: map and enemies. MapInformation mapInformation = new MapInformation(Game); mapInformation.LoadMapFromXML("test map"); MapGenerator mapGen = new MapGenerator(Game); TileMap map = mapGen.Generate(mapInformation, camera); // Create a level from that xml level information Level firstLevel = new Level(Game, "First Island", map, mapGen.Enemies, player); AddLevel(firstLevel); }
protected void AddLevel(Level level) { Levels[level.Name] = level; if (CurrentLevel == null) CurrentLevel = level; }