Bees return nectar, UI stuff
This commit is contained in:
parent
76e7ec7ec7
commit
5865778c77
12 changed files with 175 additions and 17 deletions
23
ui/scripts/ui_component.gd
Normal file
23
ui/scripts/ui_component.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
extends Control
|
||||
class_name UIComponent
|
||||
|
||||
var update_interval : float = 1
|
||||
var last_update : float = 0
|
||||
|
||||
@onready var nectar_bar = get_node("%NectarBar")
|
||||
|
||||
func _ready():
|
||||
Log.pr("UIComponent ready")
|
||||
update_ui()
|
||||
|
||||
func _process(delta):
|
||||
last_update += delta
|
||||
|
||||
if last_update > update_interval:
|
||||
last_update = 0
|
||||
update_ui()
|
||||
|
||||
func update_ui():
|
||||
Log.pr("UIComponent update_ui")
|
||||
|
||||
nectar_bar.value = GameState.gathered_nectar
|
||||
Loading…
Add table
Add a link
Reference in a new issue