feat: damage incoming -> HP +-

This commit is contained in:
istamarahsan 2025-01-26 11:32:17 +07:00
parent abd2feaab8
commit 728d848e5b
2 changed files with 11 additions and 13 deletions

View file

@ -146,13 +146,12 @@ layout_mode = 1
anchors_preset = 5 anchors_preset = 5
anchor_left = 0.5 anchor_left = 0.5
anchor_right = 0.5 anchor_right = 0.5
offset_left = -83.5 offset_left = 84.0
offset_top = 300.0 offset_top = 24.0
offset_right = 83.5 offset_right = 251.0
offset_bottom = 323.0 offset_bottom = 47.0
grow_horizontal = 2 grow_horizontal = 2
text = "Incoming Damage: 0" text = "HP: +0"
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Own"] [node name="HBoxContainer" type="HBoxContainer" parent="Own"]
visible = false visible = false
@ -268,14 +267,13 @@ anchor_left = 0.5
anchor_top = 1.0 anchor_top = 1.0
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = -83.5 offset_left = 84.0
offset_top = -325.0 offset_top = -52.0
offset_right = 83.5 offset_right = 251.0
offset_bottom = -302.0 offset_bottom = -29.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 0 grow_vertical = 0
text = "Incoming Damage: 0" text = "HP: +0"
horizontal_alignment = 1
[node name="StartGameButton" type="Button" parent="."] [node name="StartGameButton" type="Button" parent="."]
layout_mode = 1 layout_mode = 1

View file

@ -80,7 +80,7 @@ func _on_update(transition):
if monster: if monster:
monster_card_ui.visible = true monster_card_ui.visible = true
monster_card_ui.show_monster(monster) monster_card_ui.show_monster(monster)
incoming_damage_label.text = "Incoming Damage: " + str(monster.health_delta) incoming_damage_label.text = "HP " + ("+0" if monster.health_delta == 0 else str(monster.health_delta))
else: else:
monster_card_ui.visible = false monster_card_ui.visible = false