1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-29 07:21:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/VectorStar.gd
T

21 lines
546 B
GDScript

extends BulletBase
class_name VectorStar
var tracer: EntityBase = null
var forwardTime: float = 1000
var forwarded: bool = false
var rotateSpeed: float = 1
func ai():
texture.rotation_degrees += rotateSpeed
rotateSpeed += 0.25
PresetBulletAI.forward(self, rotation)
if timeLived() <= forwardTime:
speed = 10 * ((forwardTime - timeLived()) / forwardTime)
elif forwarded:
speed = (timeLived() - forwardTime) / 30
else:
forwarded = true
if is_instance_valid(tracer):
rotation = position.angle_to_point(tracer.getTrackingAnchor())