Exemplo n.º 1
0
    private BaseLevel SetupStage(BaseLevel level, Node background, bool initial = false)
    {
        stageNode.AddChild(level);

        Hunter hunter = Hunter.Instance();

        Entities.AddChild(hunter);

        this.Player           = hunter;
        CurrentStage          = level.GetStage(MoonHunter.Instance.GameState.LastSaveStage);
        hunter.GlobalPosition = CurrentStage.GetPlayerSpawn();

        SetCameraLimits(CurrentStage.GetGlobalRect());

        MainCamera.Target     = hunter;
        MainCamera.Current    = true;
        MainCamera.LockTarget = CurrentStage.LockPlayer;

        SetupLevelStage(!initial);

        return(level);
    }