Scriptable bullet emitter

This commit is contained in:
MaddoScientisto 2025-03-15 11:44:30 +01:00
commit 4261009c33
17 changed files with 251 additions and 74 deletions

View file

@ -19,12 +19,12 @@ public partial class PatternTest : AttackPattern
private double burstTimer;
private BulletSpawner spawner;
public override void Start(Boss boss)
public override void Start(Node2D parent)
{
Boss = boss;
Parent = parent;
timer = 0;
burstTimer = 0;
spawner = boss.GetNode<BulletSpawner>("BulletSpawner");
spawner = Parent.GetNode<BulletSpawner>("BulletSpawner");
}
public override void UpdatePattern(double delta)
@ -33,7 +33,7 @@ public partial class PatternTest : AttackPattern
burstTimer += delta;
if (timer < duration && burstTimer >= burstInterval)
{
spawner.SpawnBullet(Boss.GlobalPosition, Vector2.Right, bulletSpeed, owner, bulletCount, bulletScene: BulletScene);
spawner.SpawnBullet(Parent.GlobalPosition, Vector2.Right, bulletSpeed, owner, bulletCount, bulletScene: BulletScene);
burstTimer = 0;
}
}