game: add hp pickup

This commit is contained in:
2025-08-20 05:36:23 +02:00
parent 1c85c94a9a
commit 2c781e4d2a
9 changed files with 44 additions and 9 deletions

View File

@@ -39,6 +39,9 @@ func take_damage(value: float) -> void:
if dead or god_mode:
return
player_stats.current_health -= value
player_stats.current_health = clampf(
player_stats.current_health, -1.0, player_stats.get_final("max_health", modifiers)
)
var dm = preload("res://scenes/damage_numbers.tscn").instantiate()
dm.damage_taken = value
dm.player_damage = false