i want to turn of my music but is in actor and i can't take my music to another actor pls help
public class enemy extends Actor
{
/// přidává svět do actora
MyWorld můjsvět;
public GreenfootSound mojesongy = new GreenfootSound("Undertale.mp3");
public static final int nahoru = 270;
public static final int doleva = 180;
public static final int dolů = 90;
public static final int doprava = 0;
/**
* Act - do whatever the enemy wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// random pohyb po herní ploše
if(getWallInFront()==false)
{
move (2);
}else
{
int random = Greenfoot.getRandomNumber(3);
if(random == 0 )
{
turn(nahoru);
}else if(random == 1)
{
turn(dolů);
}else if(random == 2)
{
turn(doprava);
}else if(random == 3)
{
turn(doleva);
}
}
// oddělaní hráče z herní plochy po doteku z nepřítelem
Actor hráč = getOneIntersectingObject(hráč.class);
if(hráč!=null)
{
World můjsvět = getWorld();
konec Konec = new konec();
restart Restart = new restart();
můjsvět.addObject(Konec,můjsvět.getWidth()/2,můjsvět.getHeight()/2);
můjsvět.removeObject(hráč);
můjsvět.addObject(Restart,400,150);
mojesongy.stop();
}
}
// funkce zjištůjící doteku zdi z nepřítelem
private boolean getWallInFront()
{
GreenfootImage myImage = getImage();
int distanceToFront = myImage.getWidth()/2;
int xoffset = (int)Math.ceil(distanceToFront*Math.cos(Math.toRadians(getRotation())));
int yoffset = (int)Math.ceil(distanceToFront*Math.sin(Math.toRadians(getRotation())));
Actor wall = getOneObjectAtOffset(xoffset,yoffset, rock.class);
return (wall!=null);
}
public void přehrátzvuk()
{
}
}