So in my game when the world starts it plays music, but when the world ends it doesn't stop playing music, help please!
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Space here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Space extends World
{
//private Score score;
/**
* Constructor for objects of Space
*
*/
public Space()
{
// Create a new world with 20x20 cells with a cell size of 10x10 pixels.
super(850, 550, 1,false);
addObject(new Aligator(),0,250);
addObject(new Camel(),625,283);
//addObject(new Score(),50,50);
int count =0;
{
Greenfoot.playSound("Sound.wav");
}
while(count<=30)
{
addObject(new Frog(),Greenfoot.getRandomNumber(800), Greenfoot.getRandomNumber(500));
count = count+1;
}
}
// public void addPoints()
//{
//score.addPoints();
// }
// public void addLittlePoints()
// {
// score.addLittlePoints();
// }
// public void subtractPoints()
//{
// score.subtractPoints();
// }
}
