I have a code where I spawn my Boss when my player has collected 25 coins, but there is a glitch when the Boss appears in the game? I'm not really sure what went wrong! Can someone check if there is anything wrong with my code?
public void spawnEnemy()
{
if(Player.coinsCollected_ == 25)
{
Enemy boss = new Enemy();
addObject(boss, 1000, 340);
bossMusic.playLoop(); //starts the new music
Music.stop(); //stops the original music to play bossfight music
}
}