Updated event_bus to have shield change single; attempted to update
player's set shield but running into problems at runtime.
This commit is contained in:
parent
d64504189a
commit
1ebba28e5d
7 changed files with 18 additions and 12 deletions
11
ui.gd
11
ui.gd
|
|
@ -6,20 +6,21 @@ extends MarginContainer
|
|||
var shader_active = false
|
||||
|
||||
func _ready():
|
||||
get_node("Player.Ship").node_ready.connect("shield_ui", self, "_on_shield_ui")
|
||||
get_node("Player.Ship").node_ready.connect("shield_ui", self, "_on_shield_ui")
|
||||
EventBus.shield_changed.connect(_on_shield_changed)
|
||||
|
||||
func update_score(value):
|
||||
score_counter.display_digits(value)
|
||||
|
||||
|
||||
func update_shield(max_value, value, old_value):
|
||||
func _on_shield_changed(max_value: int, old_value: int, new_value: int) -> void:
|
||||
|
||||
shield_bar.max_value = max_value
|
||||
shield_bar.value = value
|
||||
shield_bar.value = new_value
|
||||
|
||||
print("update_shield"," ","Current ",(value), " ", "(Max ",(max_value),")"," ","Old Value:"," ",old_value)
|
||||
print("update_shield"," ","Current ",(new_value), " ", "(Max ",(max_value),")"," ","Old Value:"," ",old_value)
|
||||
|
||||
if value >= max_value:
|
||||
if new_value >= max_value:
|
||||
print("No need to tween!")
|
||||
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue