mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 23:41:54 +08:00
a7e05cff65
将子弹AI预设类从PresetsAI重命名为PresetAIs 为BulletBase添加autoDestroyOnHitMap选项控制地图碰撞销毁 修改多个子弹脚本使用新的PresetAIs类名 为ChickSprint子弹添加地图碰撞伤害逻辑
13 lines
480 B
GDScript
13 lines
480 B
GDScript
class_name PresetAIs
|
|
|
|
static func lockLauncher(bullet: BulletBase, launcher: EntityBase, onTexture: bool = false):
|
|
bullet.position = launcher.texture.global_position if onTexture else launcher.position
|
|
static func forward(bullet: BulletBase, rotation: float):
|
|
bullet.forward(Vector2.from_angle(rotation))
|
|
static func trace(bullet: BulletBase, target: Vector2, speed: float):
|
|
bullet.rotation = lerp_angle(
|
|
bullet.rotation,
|
|
bullet.position.angle_to_point(target),
|
|
speed
|
|
)
|