diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 13:20:13 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 13:20:13 +0200 |
commit | 83985c5b2f9829c7f335e31158bd7d3b56a3e2d6 (patch) | |
tree | bb7648f0a1b77275bc8ee9b8364bede847dba589 /godot/scenes/Game.gd | |
parent | f48908a84490657bc03f4b41d0fc977c1381d0b9 (diff) | |
download | 2022-83985c5b2f9829c7f335e31158bd7d3b56a3e2d6.tar.gz 2022-83985c5b2f9829c7f335e31158bd7d3b56a3e2d6.tar.bz2 2022-83985c5b2f9829c7f335e31158bd7d3b56a3e2d6.zip |
jingle at the end
Diffstat (limited to 'godot/scenes/Game.gd')
-rw-r--r-- | godot/scenes/Game.gd | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/godot/scenes/Game.gd b/godot/scenes/Game.gd index 10bfad0..fef2cc8 100644 --- a/godot/scenes/Game.gd +++ b/godot/scenes/Game.gd @@ -1,7 +1,7 @@ extends Spatial const NUM_LEVELS = 9 -const PAR = [1,2,3,4,5,6,7,8,9] +const PAR = [5,2,3,4,5,6,7,8,9] # level control var current_level_id = 0 @@ -19,6 +19,8 @@ func _ready(): current_strokes = 0 levels[0].show() + + $JinglePlayer.stream.loop_mode = AudioStreamSample.LOOP_DISABLED # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -49,6 +51,8 @@ func _on_MainMenuButton_pressed(): func end_level(): open_scoreboard() evaluate_player(current_strokes, PAR[current_level_id]) + $BGMPLayer.stream_paused = true + $JinglePlayer.play() post_game = true @@ -91,6 +95,9 @@ func next_level(): close_scoreboard() $Evaluation.hide() + + $BGMPLayer.stream_paused = false + $JinglePlayer.stop() func evaluate_player(strokes, par): @@ -113,6 +120,10 @@ func evaluate_player(strokes, par): elif diff == 2: $Evaluation/EvaluationLabel.text = "DOUBLE BOGEY" else: - $Evaluation/EvaluationLabel.text = "+%d" % diff + $Evaluation/EvaluationLabel.text = "+ %d" % diff $Evaluation.show() + + +func _on_JinglePlayer_finished(): + $BGMPLayer.stream_paused = false |