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 spawnBoss()
{
if(Mario.coinsCollected_ == 20)
{
addObject(bar, 552, 127);
Boss boss = new Boss();
addObject(boss, 1000, 340);
bossMusic.playLoop(); //starts the new music
Music.stop(); //stops the original music to play bossfight music
}
}
