can somebody please tell me what's wrong here? it displays an error saying sound is an "undeclared variable"
import greenfoot.*;
public class MyWorld extends World
{
public MyWorld()
{
super(600, 400, 1);
GreenfootImage bg = new GreenfootImage("ocean_background.jpg");
bg.scale(getWidth(), getHeight());
setBackground(bg);
for (int i = 0; i < 20; i++)
{
Fish temp = new Fish("red");
int x = Greenfoot.getRandomNumber(getWidth());
int y = Greenfoot.getRandomNumber(getHeight());
addObject(temp, x, y);
sound = new GreenfootSound("aquarium.wav");
sound.playLoop();
}
}
}