Exemple #1
0
    public void StartLoading(Lvl level, bool reloadLevel = true)
    {
        currentLevel = level;
        enemiesManager.SetLevel(currentLevel);
        round.Play(((int)currentLevel + 1));

        if (reloadLevel)
        {
            var levelScene = GD.Load <PackedScene>(string.Format("res://Resources/Levels/{0}", levels[currentLevel]));
            levelInstance          = (Node2D)levelScene.Instance();
            levelInstance.Position = scene.GetNode <Node2D>("LevelSpawnPoint").Position;

            scene.GetNode("LevelRoot").AddChild(levelInstance);
        }
    }