Bullet pattern isn't behaving as expected
- by Fibericon
I have a boss that's supposed to continuously shoot five streams of bullets, each at a different angle. It starts off just fine, but doesn't seem to want to use its entire array of bullets. No matter how large I set the length of bulletList, the boss simply stops shooting after a couple of seconds, then pick up again shortly. Here's what I'm using to generate the pattern:
Vector3 direction = new Vector3(0.5f, -1, 0);
for (int r = 0; r < boss.gun.bulletList.Length; r++)
{
if (!boss.gun.bulletList[r].isActive)
{
boss.gun.bulletList[r].direction = direction;
boss.gun.bulletList[r].speed = boss.gun.BulletSpeedAdjustment;
boss.gun.bulletList[r].position = boss.position;
boss.gun.bulletList[r].isActive = true;
break;
}
}
direction = new Vector3(-0.5f, -1, 0);
//Repeat with four similar for loops, to place a bullet in each direction
It doesn't seem to matter if the bulletList length is 1000 or 100000. What could be the issue here?