the-crypt/Items/Collectable.gd
2020-07-21 20:06:39 -05:00

10 lines
179 B
GDScript

extends Area2D
class_name Collectable
export var ID: int = 0
func _on_Area2D_body_entered(body):
if body.get("Inventory") != null:
body.Inventory.add_item(ID)
queue_free()