13 lines
333 B
GDScript
13 lines
333 B
GDScript
extends Control
|
|
|
|
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)
|