feat: 1. 添加武器击退功能,player 使用weapon_behavior/melee_behavior(hitbox 会调用 setup 初始化) 的 hitbox 击中 enemy_slow,enemy_slow拿到hitbox的knockback_power,以及hitbox指向enemy的方向,然后朝着该方向,使用power击退:调用enemy.gd 的 apply_knockback,然后_process中会对position修改,同时开启定时器,定时器结束的时候,使用 reset_knockback 重置

This commit is contained in:
luke358
2026-05-19 17:39:58 +08:00
parent cf8c5b90ff
commit 4fa565e0e9
10 changed files with 110 additions and 7 deletions
+6
View File
@@ -63,3 +63,9 @@ offset_top = -95.0
offset_bottom = -75.0
back_color = Color(0.015686275, 0.05490196, 0.16862746, 1)
fill_color = Color(0.37254903, 0.5372549, 0.75686276, 1)
[node name="KnockbackTimer" type="Timer" parent="." index="9" unique_id=1031574323]
wait_time = 0.4
one_shot = true
[connection signal="timeout" from="KnockbackTimer" to="." method="_on_knockback_timer_timeout"]