CollisionDetectionTest/EnemyBullets.c
/* Initialises enemy bullet based on the enemy that will fire */
Initialises enemy bullet based on the enemy that will fire
Initialises enemy bullet based on the enemy that will fire
void EnemyBullet_Type_Init(EnemyBullet *enemyBullet, Enemy *enemy)
{
	if (enemy->type == 2)
	{
		enemyBullet->art = normalBullet;
		enemyBullet->bullet_type = 2;
	}
	else if (enemy->type == 3)
	{
		enemyBullet->bullet_type = 3;
		if (enemy->id == 1)
			enemyBullet->art = bigBullet_P1;
		else enemyBullet->art = bigBullet_P2;
	}
	else if (enemy->type == 4)
	{
		enemyBullet->art = peaBullet;
		enemyBullet->bullet_type = 4;
		enemyBullet->base_timer = 40;
	}
	else if (enemy->type == 5)
	{
		if (enemyBullet->left == 0 && enemyBullet->right == 0)
		{
			enemyBullet->art = normalBullet;
		}
		else if (enemyBullet->left == 1)
		{
			if (enemy->id == 1)
				enemyBullet->art = leftBullet;
			else if (enemy->id == 2)
				enemyBullet->art = rightBullet;
		}
		else if (enemyBullet->right == 1)
		{
			if (enemy->id == 1)
				enemyBullet->art = rightBullet;
			else if (enemy->id == 2)
				enemyBullet->art = leftBullet;
		}
		enemyBullet->bullet_type = 5;
	}
	else if (enemy->type == 6)
	{
		enemyBullet->art = torpedoBullet;
		enemyBullet->bullet_type = 6;
		enemyBullet->base_timer = -50;
		enemyBullet->torp_track_timer = 0;
	}
}
void EnemyBullet_Type_Init ( EnemyBullet * enemyBullet , Enemy * enemy ) { if ( enemy -> type == 2 ) { enemyBullet -> art = normalBullet ; enemyBullet -> bullet_type = 2 ; } else if ( enemy -> type == 3 ) { enemyBullet -> bullet_type = 3 ; if ( enemy -> id == 1 ) enemyBullet -> art = bigBullet_P1 ; else enemyBullet -> art = bigBullet_P2 ; } else if ( enemy -> type == 4 ) { enemyBullet -> art = peaBullet ; enemyBullet -> bullet_type = 4 ; enemyBullet -> base_timer = 40 ; } else if ( enemy -> type == 5 ) { if ( enemyBullet -> left == 0 && enemyBullet -> right == 0 ) { enemyBullet -> art = normalBullet ; } else if ( enemyBullet -> left == 1 ) { if ( enemy -> id == 1 ) enemyBullet -> art = leftBullet ; else if ( enemy -> id == 2 ) enemyBullet -> art = rightBullet ; } else if ( enemyBullet -> right == 1 ) { if ( enemy -> id == 1 ) enemyBullet -> art = rightBullet ; else if ( enemy -> id == 2 ) enemyBullet -> art = leftBullet ; } enemyBullet -> bullet_type = 5 ; } else if ( enemy -> type == 6 ) { enemyBullet -> art = torpedoBullet ; enemyBullet -> bullet_type = 6 ; enemyBullet -> base_timer = -50 ; enemyBullet -> torp_track_timer = 0 ; } }
Initialises enemy bullet based on the enemy that will fire
Initialises enemy bullet based on the enemy that will fire
/* Shooter */ /* BigShot */ /* Pea */ /* Pea's bullets move slightly faster */ /* Arc */ /* Different art for bullets moving left or rightwarwd */ /* Torpedo */ /* Torpedo's bullets move slower */