Hello! What code must I use to only start the background music when run is pressed? My music has been playing even if my program hasn't started. Here is my code:
public class bg extends World
{
GreenfootSound backgroundMusic = new GreenfootSound("music.mp3");
public bg()
{//this sets the background
super(600, 400, 1);
setBackground("Final ICT BG.png");
backgroundMusic.playLoop();
GreenfootImage bg = new GreenfootImage("Final ICT BG.png");
bg.scale(getWidth() +35, getHeight() +30);
setBackground(bg);
prepare();
