Exemplo n.º 1
0
        private void OnMainMenuButtonPressed()
        {
            if (LeaderBoardService.CanAdd(GlobalState.State.Scores))
            {
                LeaderBoardService.UpdateLeaders(_playerName.Text, GlobalState.State.Scores);
            }

            GetTree().ChangeScene("res://ui/MainScreen.tscn");
        }
Exemplo n.º 2
0
        private void OnRestartButtonPressed()
        {
            if (LeaderBoardService.CanAdd(GlobalState.State.Scores))
            {
                LeaderBoardService.UpdateLeaders(_playerName.Text, GlobalState.State.Scores);
            }

            GetTree().ChangeScene("res://objects/World/World.tscn");
        }
Exemplo n.º 3
0
        public override void _Ready()
        {
            (FindNode("Scores", true) as Label).Text = $"Scores: {GlobalState.State.Scores}";
            _playerName = (FindNode("PlayerNameEditor", true) as LineEdit);

            if (!LeaderBoardService.CanAdd(GlobalState.State.Scores))
            {
                _playerName.Visible = false;
            }
        }