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:
@@ -27,6 +27,8 @@ func _on_hurtbox_component_on_damaged(hitbox: HitboxComponent) -> void:
|
||||
Global.on_create_block_text.emit(self)
|
||||
return
|
||||
|
||||
|
||||
|
||||
set_flash_material()
|
||||
health_component.take_damage(hitbox.damage)
|
||||
Global.on_create_damage_text.emit(self, hitbox)
|
||||
|
||||
Reference in New Issue
Block a user