Readd game over sound
Was gone for some reason
This commit is contained in:
parent
16a13dad6c
commit
7f4f2a8f5b
File diff suppressed because one or more lines are too long
@ -82,6 +82,7 @@ pitch_scale = 1.5
|
|||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
label_nodepath = NodePath("LabelScore")
|
label_nodepath = NodePath("LabelScore")
|
||||||
popup_nodepath = NodePath("PopupWon")
|
popup_nodepath = NodePath("PopupWon")
|
||||||
|
gameover_sound_path = NodePath("../GameOverSound")
|
||||||
|
|
||||||
[node name="LabelScore" type="Label" parent="HUD"]
|
[node name="LabelScore" type="Label" parent="HUD"]
|
||||||
margin_left = 15.0
|
margin_left = 15.0
|
||||||
|
@ -2,11 +2,13 @@ extends Control
|
|||||||
|
|
||||||
export(NodePath) var label_nodepath
|
export(NodePath) var label_nodepath
|
||||||
export(NodePath) var popup_nodepath
|
export(NodePath) var popup_nodepath
|
||||||
|
export(NodePath) var gameover_sound_path
|
||||||
|
|
||||||
const SCORE = 100
|
const SCORE = 100
|
||||||
|
|
||||||
var _labelScore: Label
|
var _labelScore: Label
|
||||||
var _popup: Popup
|
var _popup: Popup
|
||||||
|
var _gameover_sound: AudioStreamPlayer
|
||||||
var _score: int = 0
|
var _score: int = 0
|
||||||
|
|
||||||
|
|
||||||
@ -17,6 +19,9 @@ func _ready():
|
|||||||
_popup = get_node(popup_nodepath) as Popup
|
_popup = get_node(popup_nodepath) as Popup
|
||||||
assert(null != _popup)
|
assert(null != _popup)
|
||||||
|
|
||||||
|
_gameover_sound = get_node(gameover_sound_path) as AudioStreamPlayer
|
||||||
|
assert(null != _gameover_sound)
|
||||||
|
|
||||||
|
|
||||||
func increaseScore():
|
func increaseScore():
|
||||||
_score += SCORE
|
_score += SCORE
|
||||||
@ -28,6 +33,7 @@ func increaseScore():
|
|||||||
|
|
||||||
|
|
||||||
func gameOver():
|
func gameOver():
|
||||||
|
_gameover_sound.play()
|
||||||
_endGame(false)
|
_endGame(false)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user