the-crypt/Items/Collectable.gd
2020-07-21 23:39:14 -05:00

11 lines
208 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)
Player.unlocked.append(ID)
queue_free()