mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-22 08:04:23 +00:00
17 lines
333 B
GDScript
17 lines
333 B
GDScript
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])
|