hero-mark-2/objects/collectibles/shard.gd
2023-01-03 20:52:30 -05:00

16 lines
383 B
GDScript

extends Node2D
export var value = 1
export var number = 0 #Used for saving which specific shards collected
func _ready():
$AnimationPlayer.play("glow")
func _on_Area2D_area_entered(area):
#Collect
if area.is_in_group("player"):
Game.play_sound(Game.a_shard,Game.ac_collectible)
Game.score += 500
Game.shards += value
Game.shards_collected[number] = true
queue_free()