mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
9f82b7f9fa
添加链枪子弹的图片资源、脚本和场景文件 为RainbowCat子弹添加穿透属性和生命周期 在子弹AI预设中添加面向鼠标的功能
15 lines
616 B
GDScript
15 lines
616 B
GDScript
class_name PresetBulletAI
|
|
|
|
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
|
|
)
|
|
static func faceToMouse(bullet: BulletBase):
|
|
bullet.rotation = bullet.position.angle_to_point(bullet.get_global_mouse_position())
|