added null check for witch and player for gameover screen highlight if fruits would drop on last frame
parent
965c6fb632
commit
eeea6d2d59
|
|
@ -12,9 +12,12 @@ var _sfx_player: AudioStreamPlayer
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
body_entered.connect(_on_body_entered)
|
body_entered.connect(_on_body_entered)
|
||||||
witch = get_node("/root/Game/Witch")
|
witch = get_node_or_null("/root/Game/Witch")
|
||||||
|
player = get_node_or_null("/root/Game/Player")
|
||||||
|
if witch == null or player == null:
|
||||||
|
queue_free()
|
||||||
|
return
|
||||||
collected.connect(witch._on_collect)
|
collected.connect(witch._on_collect)
|
||||||
player = get_node("/root/Game/Player")
|
|
||||||
_sfx_player = AudioStreamPlayer.new()
|
_sfx_player = AudioStreamPlayer.new()
|
||||||
_sfx_player.stream = _collect_sfx
|
_sfx_player.stream = _collect_sfx
|
||||||
_sfx_player.volume_db = -18
|
_sfx_player.volume_db = -18
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue