Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit f57dd59e authored by stevennovaryo's avatar stevennovaryo
Browse files

feat: fix pickup item bug

parent 8438e855
Branches
No related tags found
1 merge request!16Steven/item stack
......@@ -26,14 +26,14 @@ func _physics_process(delta):
global_position = global_position.move_toward(target.global_position, speed)
func collect(inventory : Resource):
sound.play()
var item : Item = stats.duplicate() as Item
#item._set_item_name(stats.name)
#item._set_item_desc(stats.description)
#item._set_item_icon(stats.icon)
var result = inventory.insert_item_to_inventory(item, amount)
if result:
if result == true:
# To Be Discussed, only delete when it is added to inventory
sound.play()
collision.call_deferred("set", "disabled", true)
sprite.visible = false
print(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment