1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/AIPresets/Bullet.gd
T
fallingshrimp 9f82b7f9fa feat(子弹): 添加链枪子弹资源与逻辑
添加链枪子弹的图片资源、脚本和场景文件
为RainbowCat子弹添加穿透属性和生命周期
在子弹AI预设中添加面向鼠标的功能
2025-09-21 12:46:32 +08:00

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())