hero-mark-2/objects/collectibles/gold.gd
2022-12-08 23:28:49 -05:00

15 lines
284 B
GDScript

extends Node2D
export var value = 1
func _ready():
#Sync all coinframes
$AnimatedSprite.play()
func _on_Area2D_area_entered(area):
#Collect
if area.is_in_group("player"):
Game.golds += value
Game.score += 5
Game.play_sound(Game.a_gold,Game.ac_collectible)
queue_free()