示例#1
0
 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);
 }
示例#2
0
 protected void AddLevel(Level level)
 {
     Levels[level.Name] = level;
     if (CurrentLevel == null)
         CurrentLevel = level;
 }