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/Needle.gd
T

22 lines
572 B
GDScript
Raw Normal View History

extends BulletBase
class_name NeedleBullet
var forwarding: bool = false
func spawn():
hitbox.disabled = true
func ai():
PresetBulletAI.forward(self , rotation)
if forwarding:
speed += 0.5
else:
speed -= 0.25
if speed <= 0:
forwarding = true
hitbox.disabled = false
func succeedToHit(_dmg: float, entity: EntityBase):
var effect = EffectController.create(ComponentManager.getEffect("Dustdown"), entity.position)
effect.rotation = rotation
effect.shot()
rotation = Vector2.from_angle(rotation).bounce((entity.position - position).normalized()).angle()