CollisionDetectionTest/EnemyBullets.c
/* Creates the bullets for the Arc enemy */
Creates the bullets for the Arc enemy
Creates the bullets for the Arc enemy
void Enemy_Fire_Arc(Enemy *enemy, EnemyBullet *enemyBullets[], Sound *sound)
{
	int i;			
	int four = 0;	
	for (i = 0; i < 50; ++i)
	{
		if (enemyBullets[i] == NULL && four <= 3)
		{
			enemyBullets[i] = EnemyBullet_Create(sound, enemy, four);
			++four;
		}
		else if (four >= 4)
			break;
	}
}
void Enemy_Fire_Arc ( Enemy * enemy , EnemyBullet * enemyBullets [ ] , Sound * sound ) { int i ; int four = 0 ; for ( i = 0 ; i < 50 ; ++ i ) { if ( enemyBullets [ i ] == NULL && four <= 3 ) { enemyBullets [ i ] = EnemyBullet_Create ( sound , enemy , four ) ; ++ four ; } else if ( four >= 4 ) break ; } }
Creates the bullets for the Arc enemy
Creates the bullets for the Arc enemy
/* Loop counter */ /* Total of four bullets being spawned */ /* Finds a free memory */ /* If memory is free and there are still bullets to spawn */ /* Max number of bullets spawned, break out */