Technically a game
This commit is contained in:
14
client/Scripts/Component/Pickup.gd
Normal file
14
client/Scripts/Component/Pickup.gd
Normal file
@ -0,0 +1,14 @@
|
||||
extends "res://Scripts/Component/Interactable.gd"
|
||||
|
||||
export var item : String
|
||||
export var tip : String = ""
|
||||
|
||||
func _ready():
|
||||
connect("interacted", self, "_on_interact")
|
||||
|
||||
func _on_interact():
|
||||
player.add_item(item)
|
||||
if len(tip) >= 1:
|
||||
var gui = get_tree().root.get_node("World").get_node("GUI")
|
||||
gui.display_tip(tip)
|
||||
queue_free()
|
Reference in New Issue
Block a user