import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Music here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Music extends Actor
{
GreenfootSound inf = new GreenfootSound("bm.mp3");
GreenfootSound boss = new GreenfootSound("");
GreenfootSound start = new GreenfootSound("");
GreenfootSound end = new GreenfootSound("");
boolean firstTurn = true;
private int music = 0;
/**
* Act - do whatever the Music wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (getWorld() instanceof Minionsworld)
{
if (music == 1)
{
inf.playLoop();
}
if(Greenfoot.mouseClicked(this))
{
if (inf.isPlaying())
{
inf.pause();
setImage("play.png");
}
else
{
inf.playLoop();
setImage("pause.png");
}
}
}
if (music < 2)
{
music++;
}
}
}

