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

@@ -0,0 +1,14 @@
class_name PickupHP
extends PickupBase
@export var value: float = 25.0
@onready var collision_shape_2d: CollisionShape2D = $Area2D/CollisionShape2D
func pickup() -> void:
if not player:
push_error("pickup called on %s without player set" % self)
return
player.take_damage(-value)
queue_free()