mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-06 03:37:13 +08:00
14 lines
394 B
GDScript
14 lines
394 B
GDScript
|
|
extends BulletBase
|
||
|
|
class_name WoodBullet
|
||
|
|
|
||
|
|
var speedV2: Vector2 = Vector2.ZERO
|
||
|
|
|
||
|
|
func spawn():
|
||
|
|
speedV2 = Vector2.from_angle(rotation) * 10
|
||
|
|
func ai():
|
||
|
|
if is_instance_valid(launcher.currentFocusedBoss):
|
||
|
|
speedV2 += (launcher.currentFocusedBoss.position - launcher.position).normalized() * 1
|
||
|
|
speed = speedV2.length() / 2.0
|
||
|
|
rotation = speedV2.angle()
|
||
|
|
PresetBulletAI.forward(self , rotation)
|