Esempio n. 1
0
 private void NewGame()
 {
     _camera.Position = _startPos.Position;
     _player          = (Jumper)_jumper.Instance();
     _player.Position = _startPos.Position;
     AddChild(_player);
     _player.Connect("OnCapture", this, nameof(OnJumperCapture));
     SpawCircle(_startPos.Position);
 }
Esempio n. 2
0
    public void NewGame()
    {
        _score = 0;
        _level = 1;
        _hud.UpdateScore(_score);
        var camera        = GetNode <Camera2D>("Camera2D");
        var startPosition = GetNode <Position2D>("StartPosition");

        _player          = (Jumper)_jumperScene.Instance();
        _player.Position = startPosition.Position;
        AddChild(_player);

        _player.Connect("Captured", this, nameof(OnJumperCaptured));
        _player.Connect("Died", this, nameof(OnJumperDied));
        SpawnCircle(startPosition.Position);

        _hud.Show();
        _hud.ShowMessage("GO!!");

        if (GameSettings.Instance().EnableMusic)
        {
            _musicPlayer.Play();
        }
    }