1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat: 添加小鸡角色显示名称,更新Boss状态条和伤害标签逻辑,增强EntityBase类的移动和攻击功能

This commit is contained in:
2025-08-26 14:26:45 +08:00
parent 5c64d01f7c
commit 5923660195
6 changed files with 86 additions and 10 deletions
+11 -3
View File
@@ -3,10 +3,18 @@ class_name DamageLabel
@export var damage: float = 0
@export var crit: bool = false
@onready var label: Label = $"%label"
@onready var animator: AnimationPlayer = $"%animator"
func _ready():
$"%label".text = str(round(damage)) + ("!!!" if crit else "")
$"%animator".play("show")
await $"%animator".animation_finished
if damage == 0:
label.text = "MISS"
else:
label.text = str(round(damage)) + ("!!!" if crit else "")
animator.play("show")
await animator.animation_finished
queue_free()
static func create(spawnDamage: float, spawnCrit: bool, spawnPosition: Vector2, addToWorld: bool = true) -> DamageLabel:
var instance = preload("res://components/UI/DamageLabel.tscn").instantiate()