inventaire fonctionnel #13

This commit is contained in:
Altaezio
2025-08-03 19:38:46 +02:00
committed by Zacharie Guet
parent b164141d00
commit bca2300443
16 changed files with 112 additions and 46 deletions

View File

@@ -1,4 +1,12 @@
extends Control
func _on_root_gui_player_stats_updated(player:Player):
func _on_root_gui_player_updated(player: Player):
$EnergyInfo/Label.text = str(player.energy)
var children = $Inventory.get_children()
for child in children:
child.free()
for item in player.inventory.items:
var item_rect = TextureRect.new()
item_rect.texture = item.icon
$Inventory.add_child(item_rect)