This student is trying to get bullet2 and bullet3 to follow the enemy and enemy2 after the enemy has been shot by the jet. We do not know what else to try.
Thanks for the help and support!
you were not resetting the bullets x position leading to the y being set correctly but it being on the incorrect x coordinate
if (Bullet2.y >= 500) {
Bullet2.x = Enemy.x;
Bullet2.y = Enemy.y;
}
Bullet3.velocityY = 9;
if (Bullet3.y >= 500) {
Bullet3.x = Enemy2.x;
Bullet3.y = Enemy2.y;
}
also i would recommend removing this line from this segment
if (Bullet.isTouching(Enemy)) {
Enemy.x = 200;
Enemy.y = -5;
Enemy.x = randomNumber(400, -5);
// Bullet2.y = Enemy.y;
score = score + 1;
Enemy.setAnimation("Boom");
}
if this does get executed the bullet will jump incorrectly and you’ll still have issues