game: add hp pickup
This commit is contained in:
@@ -10,6 +10,7 @@ extends Node2D
|
||||
const COLOR_CRIT = Color.GOLD
|
||||
const COLOR_REGULAR = Color.WHITE
|
||||
const COLOR_PLAYER = Color.CRIMSON
|
||||
const COLOR_HEAL = Color.CHARTREUSE
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -17,8 +18,10 @@ func _ready() -> void:
|
||||
label.add_theme_color_override("font_color", COLOR_PLAYER)
|
||||
if critical_damage:
|
||||
label.add_theme_color_override("font_color", COLOR_CRIT)
|
||||
if damage_taken < 0:
|
||||
label.add_theme_color_override("font_color", COLOR_HEAL)
|
||||
label.add_theme_font_size_override("font_size", 8)
|
||||
label.text = "%0.0f" % damage_taken
|
||||
label.text = "%0.0f" % absf(damage_taken)
|
||||
animation_player.play("normal_damage")
|
||||
animation_player.animation_finished.connect(_on_animation_finished)
|
||||
|
||||
|
Reference in New Issue
Block a user