shard titles pop up in game

This commit is contained in:
pennyrigate 2023-05-20 21:01:41 -04:00
parent a13a9cee10
commit afa641901c
10 changed files with 108 additions and 8 deletions

View file

@ -1,14 +1,19 @@
extends Node2D
signal collected(shard_number)
export var value = 1
export var number = 0 #Used for saving which specific shards collected
func _ready():
var hud = get_tree().get_nodes_in_group("hud").pop_back()
connect("collected",hud,"shard_popup")
$AnimationPlayer.play("glow")
func _on_Area2D_body_entered(body):
#Collect
if body.is_in_group("player"):
emit_signal("collected",number)
Audio.play_shard_sound()
Game.score += 500
Game.shards += value