feat: implement damage dummy system, floating UI numbers, and double-barrel shotgun mechanics

This commit is contained in:
DottsGit
2026-06-04 13:15:26 -04:00
parent d8cb91e593
commit a8b3619f2e
7 changed files with 206 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
extends Label
class_name FloatingDamageText
var target_pos: Vector3
var camera: Camera3D
var float_offset: float = 0.0
func _ready() -> void:
# Setup Tween for floating up and fading out
var tween = create_tween()
tween.set_parallel(true)
# Float up 100 pixels
tween.tween_property(self, "float_offset", 100.0, 1.0)
# Fade out
tween.tween_property(self, "modulate:a", 0.0, 1.0)
tween.chain().tween_callback(queue_free)
func _process(_delta: float) -> void:
if not is_instance_valid(camera):
queue_free()
return
if camera.is_position_behind(target_pos):
visible = false
else:
visible = true
var screen_pos = camera.unproject_position(target_pos)
# Center the label on the point, then subtract the float offset (moving up on screen)
position = screen_pos - size / 2.0 + Vector2(0, -float_offset)