1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00

feat(Bullets): 调整子弹碰撞时的相机震动和反冲效果

增加相机震动强度并优化反冲力计算公式,使用子弹速度和伤害的立方根来计算反冲力,使效果更符合游戏设计需求
This commit is contained in:
2026-03-24 22:07:20 +08:00
parent d9078f8cbd
commit bda92cc95c
+2 -2
View File
@@ -28,8 +28,8 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
eff.modulate = bullet.modulate.blend(bullet.texture.modulate)
eff.rotation = position.angle_to_point(bullet.position)
eff.shot()
CameraManager.shake(200, 250)
launcher.impluse((position - bullet.position).normalized() * sqrt(bullet.speed) * 500)
CameraManager.shake(250, 300)
launcher.impluse((position - bullet.position).normalized() * (bullet.speed * bullet.getDamage()) ** (1.0 / 3) * 250)
# 摧毁其他子弹
bullet.tryDestroy()
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)