1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-24 17:14:23 +00:00
hella-farm/behaviours/collectable.gd

18 lines
375 B
GDScript

@icon("res://behaviours/collectable.svg")
extends Area2D
class_name Collectable
## Emits [signal collected] when the mouse enters the given [CollisionShape2D].
signal collected
@export var qty: int = 1
@export var tag: StringName = &""
func _on_mouse_entered() -> void:
collected.emit(tag)
func _on_collected() -> void:
Log.p(self, "Collected: %sx %s" % [qty, tag])