hero-mark-2/objects/collectibles/key.gd
2023-05-08 03:16:41 -04:00

15 lines
293 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_hitbox"):
Game.keys += value
Game.score += 5
Audio.play_sound(Audio.a_gold,Audio.ac_collectible)
queue_free()