23 lines
437 B
GDScript3
Raw Normal View History

extends StaticBody
class_name Key
2019-11-18 18:16:46 +01:00
export(int) var key_id
2019-12-14 21:05:09 +01:00
onready var outline = get_node("KeyMesh/Outline") as MeshInstance
2019-11-18 18:16:46 +01:00
func _ready ():
if Inventory.contains_item_with_name(self.name):
Logger.info("key allready collected: TODO: delete")
queue_free()
2019-11-18 18:16:46 +01:00
func do_interact(var player):
player.key_chain.append(key_id)
queue_free()
func is_class(type): return type == "Key" or .is_class(type)
func get_class(): return "Key"