Beispiel #1
0
    public override void PostProcess(float delta)
    {
        if (juni.UpHeld)
        {
            juni.velocity.y = -125f;
            juni.transitionState(new ClimbState(juni));
        }
        else if (!juni.DownHeld)
        {
            juni.velocity.y = 25f;
            if (slide_sound.Playing)
            {
                slide_sound.Stop();
            }
            juni.MotionParticles.CurrentMotion = JuniMotionParticles.JuniMotion.NONE;
        }
        else
        {
            // Holding down, do slide sound. Gravity controls motion
            if (!slide_sound.Playing)
            {
                slide_sound.Play();
            }
            juni.MotionParticles.CurrentMotion = JuniMotionParticles.JuniMotion.CLIMB;
        }

        if (juni.JumpEdge)
        {
            juni.velocity.x = juni.FacingRight ? -130f : 130f;
            juni.executeJump();
        }
    }
Beispiel #2
0
 public bool StopSfx(AudioStreamPlayer2D player)
 {
     player.Stop();
     Logger.Debug("Stop Sfx 2D: " + player.Stream.ResourcePath);
     RemoveChild(player);
     return(true);
 }
Beispiel #3
0
    public void GameOver()
    {
        MusicPlay.Stop();
        player.Visible = false;
        NpcTimer.Stop();
        PanelGameOver.Visible = true;


        var ScoreCoinLabel = (Label)GetNode("GameOver/CoinScore/ScoreCoin");

        ScoreCoinLabel.Text = ScoreCoin.ToString();


        // proses score

        //dari autoload script DataScore
        var DataScoreVaribale = (DataScore)GetNode("/root/DataScore");

        //Pengolahan data
        ScoreBarrelFinal = DataScoreVaribale.NilaiBarrel * 500;
        ScoreMeteorFinal = DataScoreVaribale.NilaiMeteor * 500;
        ScoreCoinFinal   = ScoreCoin * 250;

        score = ScoreBarrelFinal + ScoreMeteorFinal + ScoreCoinFinal;

        Label LabelYourScore = (Label)GetNode("GameOver/YourScore/YourScoreValue");

        LabelYourScore.Text = score.ToString();
    }
Beispiel #4
0
    public void _on_btn_start_button_down()
    {
        minusNyawa = 0;
        NpcTimer.Start();
        player.Visible = true;
        MeteorTimer.Start();

        var menuGui = (Node2D)GetNode("Menu");

        menuGui.Visible = false;

        MusicMenu.Stop();
        MusicPlay.Play();

        ambulance();
    }
Beispiel #5
0
 private void OnDeathEvent(DeathEvent dei)
 {
     if (dei.target.IsInGroup("RedBlob"))
     {
         playerReference = null;
     }
     soundEffects.Stop();
     music.Stop();
 }
Beispiel #6
0
    public void Stop()
    {
        switch (_type)
        {
        case SoundType.NORMAL:
        case SoundType.RANDOM_SOUND_GD:
            _sound.Stop();
            break;

        case SoundType.RANDOM_SOUND_CSHARP:
            _soundRnd.Stop();
            break;
        }
    }
    //testing

    public void OnStartNextLevel()
    {
        PackedScene scene = GD.Load <PackedScene>("res://levels/Game.tscn");

        RemoveChild(currentScene);

        currentScene = scene.Instance();
        currentScene.Connect("ready", this, "OnLevelReady");
        currentScene.Connect("LevelCompleted", this, "OnLevelCompleted");
        currentScene.Connect("GameOver", this, "OnGameOver");

        musicPlayer.Stop();
        AddChild(currentScene);
    }
Beispiel #8
0
 public void Remove()
 {
     remove.Stop();
     remove.PitchScale = randomPitch();
     remove.Play(0);
 }
Beispiel #9
0
 public void Place()
 {
     place.Stop();
     place.PitchScale = randomPitch();
     place.Play(0);
 }
Beispiel #10
0
 public void Jump()
 {
     jump.Stop();
     jump.PitchScale = randomPitch();
     jump.Play(0);
 }
Beispiel #11
0
 public void Hit()
 {
     hit.Stop();
     hit.PitchScale = randomPitch();
     hit.Play(0);
 }