Ejemplo n.º 1
0
 public LevelData()
 {
     Tiles      = new List <Tile>();
     Clues      = new List <Clue>();
     Enemies    = new List <Enemy>();
     Player     = new Player();
     Background = new Background();
     ExitArea   = new ExitArea();
 }
Ejemplo n.º 2
0
        private void GenerateTestLevelXML()
        {
            GameDefinitions.LevelData level = new GameDefinitions.LevelData();

            GameDefinitions.Player player = new GameDefinitions.Player();
            player.Location = Vector2.Zero;
            level.Player    = player;

            GameDefinitions.Tile tile = new GameDefinitions.Tile();
            tile.Active   = true;
            tile.Location = Vector2.Zero;
            tile.Tag      = "tag";
            tile.Texture  = "textureAsset";
            level.Tiles.Add(tile);

            GameDefinitions.Clue clue = new GameDefinitions.Clue();
            clue.Location = Vector2.Zero;
            clue.Texture  = "textureAsset";
            level.Clues.Add(clue);

            GameDefinitions.Background backg = new GameDefinitions.Background();
            backg.Texture = "textureAsset";

            GameDefinitions.Enemy enemy = new GameDefinitions.Enemy();
            enemy.Action             = 0;
            enemy.Behavior           = 0;
            enemy.Invincible         = false;
            enemy.Location           = Vector2.Zero;
            enemy.PathLength         = 0;
            enemy.Respawn            = false;
            enemy.RespawnDelay       = 0;
            enemy.ReversePathAtStart = false;
            enemy.Step   = 0;
            enemy.Target = "tag";
            enemy.Type   = 0;
            level.Enemies.Add(enemy);

            GameDefinitions.ExitArea exit = new GameDefinitions.ExitArea();
            exit.Location  = Vector2.Zero;
            level.ExitArea = exit;

            TLSA.Engine.Tools.XML.Serializers.SerializeToFile(level, "test.lev");
        }