Chaos_Kitchen/Scripts/Interactibles/Crate.gd

26 lines
647 B
GDScript3
Raw Normal View History

extends ItemContainer
2024-02-17 12:42:08 +01:00
# Called when the node enters the scene tree for the first time.
func _ready():
var firstitem = Item.new()
firstitem.name = "rouge"
firstitem.Icon = Sprite2D.new()
2024-02-19 12:16:42 +01:00
firstitem.Icon.set_texture(preload("res://GraphicalAssets/Sprite/IMG_0156.PNG"))
firstitem.Icon.set_texture_filter(CanvasItem.TEXTURE_FILTER_NEAREST)
items.append(firstitem)
2024-02-17 12:42:08 +01:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_body_entered(body : Player):
body.can_interact.emit(self)
2024-02-17 12:42:08 +01:00
func _on_body_exited(body: Player):
body.remove_interact.emit() # Replace with function body.