All audio stuff moved to audio autoload and removed game.tscn in favor of just game.gd

This commit is contained in:
pennyrigate 2023-02-25 23:44:13 -05:00
parent 30cfad6e7e
commit e1a30188a6
21 changed files with 134 additions and 97 deletions

View file

@ -7,5 +7,5 @@ func _on_Area2D_area_entered(area):
if area.is_in_group("player"):
Game.arrows += value
Game.score += 25
Game.play_sound(Game.a_arrow,Game.ac_collectible)
Audio.play_sound(Audio.a_arrow,Audio.ac_collectible)
queue_free()

View file

@ -11,5 +11,5 @@ func _on_Area2D_area_entered(area):
if area.is_in_group("player"):
Game.golds += value
Game.score += 5
Game.play_sound(Game.a_gold,Game.ac_collectible)
Audio.play_sound(Audio.a_gold,Audio.ac_collectible)
queue_free()

View file

@ -9,9 +9,9 @@ func _ready():
func _on_Area2D_area_entered(area):
#Collect
if area.is_in_group("player"):
Game.ac_music.stream_paused = true
Game.play_sound(Game.a_shard,Game.ac_collectible)
Game.ac_collectible.connect("finished", Game.ac_music, "set_stream_paused", [false])
Audio.ac_music.stream_paused = true
Audio.play_sound(Audio.a_shard,Audio.ac_collectible)
Audio.ac_collectible.connect("finished", Audio.ac_music, "set_stream_paused", [false])
Game.score += 500
Game.shards += value
Game.shards_collected[number] = true

View file

@ -23,12 +23,12 @@ func _ready():
func _on_Area2D_area_entered(area):
#Collect
if area.is_in_group("player"):
Game.play_sound(Game.a_star,Game.ac_collectible)
Audio.play_sound(Audio.a_star,Audio.ac_collectible)
Game.score += 100
Game.stars[color] = true
#5 Star reward
if Game.stars[0] && Game.stars[1] && Game.stars[2] && Game.stars[3] && Game.stars[4]:
Game.play_sound(Game.a_shard,Game.ac_collectible)
Audio.play_sound(Audio.a_shard,Audio.ac_collectible)
Game.shards += 1
Game.shards_collected[4] = true
Game.score += 500