Compare commits
3 commits
efe5607f60
...
943325ce4b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
943325ce4b | ||
![]() |
7b231bd0f3 | ||
![]() |
36443b1790 |
|
@ -63,12 +63,11 @@ layout_mode = 1
|
||||||
anchors_preset = 2
|
anchors_preset = 2
|
||||||
anchor_top = 1.0
|
anchor_top = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
offset_top = -37.0
|
offset_top = -76.0
|
||||||
offset_right = 280.0
|
offset_right = 411.0
|
||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
theme_override_styles/background = SubResource("StyleBoxFlat_sbqmm")
|
theme_override_styles/background = SubResource("StyleBoxFlat_sbqmm")
|
||||||
theme_override_styles/fill = SubResource("StyleBoxFlat_hsy36")
|
theme_override_styles/fill = SubResource("StyleBoxFlat_hsy36")
|
||||||
max_value = 1.0
|
max_value = 1.0
|
||||||
value = 1.0
|
value = 1.0
|
||||||
rounded = true
|
|
||||||
show_percentage = false
|
show_percentage = false
|
||||||
|
|
|
@ -10,6 +10,12 @@ script/source = "extends HealthStatus
|
||||||
|
|
||||||
func _on_death() -> void:
|
func _on_death() -> void:
|
||||||
get_tree().change_scene_to_file.call_deferred(\"res://guis/main_menu.tscn\")
|
get_tree().change_scene_to_file.call_deferred(\"res://guis/main_menu.tscn\")
|
||||||
|
|
||||||
|
|
||||||
|
func _on_health_changed(remaining: int, _delta: int) -> void:
|
||||||
|
var hud := HeadsUpDisplay.get_singleton()
|
||||||
|
if hud:
|
||||||
|
hud.set_health_percentage(float(remaining) / float(self.get_max_health()))
|
||||||
"
|
"
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bxedw"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bxedw"]
|
||||||
|
@ -61,3 +67,4 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
shape = SubResource("CapsuleShape3D_eqqp1")
|
shape = SubResource("CapsuleShape3D_eqqp1")
|
||||||
|
|
||||||
[connection signal="death" from="HealthStatus" to="HealthStatus" method="_on_death"]
|
[connection signal="death" from="HealthStatus" to="HealthStatus" method="_on_death"]
|
||||||
|
[connection signal="health_changed" from="HealthStatus" to="HealthStatus" method="_on_health_changed"]
|
||||||
|
|
Loading…
Reference in a new issue