fixed shield UI not clearing on game restart
This commit is contained in:
@@ -28,9 +28,9 @@ var mage_unlocked: bool = 0
|
||||
|
||||
|
||||
func check_high_score(level_title: String, wave_reached: int, endless: bool) -> void:
|
||||
if endless:
|
||||
if endless and endless_high_scores[level_title] < wave_reached:
|
||||
endless_high_scores[level_title] = wave_reached
|
||||
else:
|
||||
elif level_high_scores[level_title] < wave_reached:
|
||||
level_high_scores[level_title] = wave_reached
|
||||
|
||||
|
||||
|
||||
@@ -159,6 +159,8 @@ func spawn_players() -> void:
|
||||
base_took_damage.connect(player.hud.set_lives_count)
|
||||
root_scene.add_child(player)
|
||||
p_i += 1
|
||||
print("objective health: " + str(objective_health))
|
||||
print("player ui health: " + str(player.hud.shield_ui.health))
|
||||
|
||||
|
||||
func ready_player(player_ready_true: bool) -> void:
|
||||
|
||||
@@ -6,70 +6,87 @@
|
||||
[ext_resource type="Texture2D" uid="uid://bifqfvhsu4c2f" path="res://UI/ShieldUI/health_hit-Sheet.png" id="4_yanml"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5gv4u"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 0, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ye2cs"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 66, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gmtb0"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 132, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ylmjw"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 198, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ulao6"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 264, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_usluy"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 330, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kgv6k"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 396, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ymret"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 462, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d35xv"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 528, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yyjyl"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 594, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p3fdm"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 660, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2xxhe"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 726, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8cwn3"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 792, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q14re"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 858, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nmmm8"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 924, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vp71v"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 990, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_slxus"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("4_yanml")
|
||||
region = Rect2(0, 0, 66, 66)
|
||||
|
||||
|
||||
@@ -27,3 +27,7 @@ func hit() -> void:
|
||||
shield.take_damage(damage)
|
||||
for x: int in damage:
|
||||
lives_bar.take_life()
|
||||
|
||||
|
||||
func _on_button_2_pressed() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
@@ -42,6 +42,10 @@ text = ">"
|
||||
layout_mode = 2
|
||||
text = "hit"
|
||||
|
||||
[node name="Button2" type="Button" parent="Controls" unique_id=1570558672]
|
||||
layout_mode = 2
|
||||
text = "reset"
|
||||
|
||||
[node name="ShieldUI" parent="." unique_id=591084228 instance=ExtResource("2_iketu")]
|
||||
layout_mode = 0
|
||||
offset_left = 130.0
|
||||
@@ -59,3 +63,4 @@ offset_bottom = 115.0
|
||||
[connection signal="pressed" from="Controls/VBoxContainer/Button" to="." method="decrease_damage"]
|
||||
[connection signal="pressed" from="Controls/VBoxContainer/Button2" to="." method="increase_damage"]
|
||||
[connection signal="pressed" from="Controls/Button" to="." method="hit"]
|
||||
[connection signal="pressed" from="Controls/Button2" to="." method="_on_button_2_pressed"]
|
||||
|
||||
Reference in New Issue
Block a user