Readd game over sound

Was gone for some reason
This commit is contained in:
karl 2019-11-23 22:35:03 +01:00
parent 16a13dad6c
commit 7f4f2a8f5b
3 changed files with 15 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -82,6 +82,7 @@ pitch_scale = 1.5
script = ExtResource( 5 )
label_nodepath = NodePath("LabelScore")
popup_nodepath = NodePath("PopupWon")
gameover_sound_path = NodePath("../GameOverSound")
[node name="LabelScore" type="Label" parent="HUD"]
margin_left = 15.0

View File

@ -2,11 +2,13 @@ extends Control
export(NodePath) var label_nodepath
export(NodePath) var popup_nodepath
export(NodePath) var gameover_sound_path
const SCORE = 100
var _labelScore: Label
var _popup: Popup
var _gameover_sound: AudioStreamPlayer
var _score: int = 0
@ -16,6 +18,9 @@ func _ready():
_popup = get_node(popup_nodepath) as Popup
assert(null != _popup)
_gameover_sound = get_node(gameover_sound_path) as AudioStreamPlayer
assert(null != _gameover_sound)
func increaseScore():
@ -28,6 +33,7 @@ func increaseScore():
func gameOver():
_gameover_sound.play()
_endGame(false)