whenever i try to run my project this message comes up on the terminal window and i don't know how to solve it!
public class Background extends World
{
GreenfootSound backgroundMusic = new GreenfootSound("Background.wav");
private static final String bgImageName = "space1.jpg";
private static final double scrollSpeed = 2.5;
private static final int picWidth = (new GreenfootImage(bgImageName)).getWidth();
private GreenfootImage bgImage, bgBase;
private int scrollPosition = 0;
public Background()
{
super(5000, 400, 1);
backgroundMusic.playLoop();
setBackground(bgImageName);
bgImage = new GreenfootImage(getBackground());
bgBase = new GreenfootImage(picWidth, getHeight());
bgBase.drawImage(bgImage, 0, 0);
prepare();
}
public void act()
{
scrollPosition -= scrollSpeed;
while(scrollSpeed > 0 && scrollPosition < -picWidth) scrollPosition += picWidth;
while(scrollSpeed < 0 && scrollPosition > 0) scrollPosition -= picWidth;
paint(scrollPosition);
}
private void paint(int position)
{
GreenfootImage bg = getBackground();
bg.drawImage(bgBase, position, 0);
bg.drawImage(bgImage, position + picWidth, 0);
}
private void prepare()
{
Airplane airplane = new Airplane();
addObject(airplane,75,203);
Bomb bomb = new Bomb ();
addObject(bomb,5000,75);
Robot robot = new Robot();
addObject(robot,3000,60);
Robot robot2 = new Robot();
addObject(robot2,846,186);
Robot robot3 = new Robot();
addObject(robot3,579,258);
Robot robot4 = new Robot();
addObject(robot4,495,87);
Robot robot5 = new Robot();
addObject(robot5,396,313);
Robot robot6 = new Robot();
addObject(robot6,352,194);
Robot robot7 = new Robot();
addObject(robot7,161,66);
Bomb bomb2 = new Bomb();
addObject(bomb2,1246,73);
Bomb bomb3 = new Bomb();
addObject(bomb3,1024,277);
Bomb bomb4 = new Bomb();
addObject(bomb4,1742,102);
Bomb bomb5 = new Bomb();
addObject(bomb5,1397,364);
Bomb bomb6 = new Bomb();
addObject(bomb6,2907,302);
Bomb bomb7 = new Bomb();
addObject(bomb7,2763,118);
Bomb bomb8 = new Bomb();
addObject(bomb8,3345,289);
Bomb bomb9 = new Bomb();
addObject(bomb9,3294,69);
Bomb bomb10 = new Bomb();
addObject(bomb10,2670,333);
Bomb bomb11 = new Bomb();
addObject(bomb11,161,257);
bomb11.setLocation(621,82);
Bomb bomb12 = new Bomb();
addObject(bomb12,624,321);
Ok ok = new Ok();
addObject(ok,20,31);
Ok ok2 = new Ok();
addObject(ok2,26,61);
Ok ok3 = new Ok();
addObject(ok3,26,61);
Ok ok4 = new Ok();
addObject(ok4,26,61);
Ok ok5 = new Ok();
addObject(ok5,26,61);
Ok ok6 = new Ok();
addObject(ok6,26,61);
Ok ok7 = new Ok();
addObject(ok7,26,61);
Ok ok8 = new Ok();
addObject(ok8,26,61);
Ok ok9 = new Ok();
addObject(ok9,26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(26,61);
ok9.setLocation(19,360);
ok8.setLocation(20,313);
ok7.setLocation(19,266);
ok6.setLocation(20,219);
ok6.setLocation(19,219);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(26,61);
ok5.setLocation(20,174);
ok4.setLocation(23,126);
ok4.setLocation(21,126);
ok3.setLocation(24,80);
ok2.setLocation(159,16);
ok.setLocation(21,32);
ok3.setLocation(21,80);
ok5.setLocation(21,171);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(159,16);
ok2.setLocation(191,310);
removeObject(ok2);
ok.setLocation(17,23);
ok3.setLocation(17,73);
ok4.setLocation(18,122);
ok5.setLocation(18,169);
ok6.setLocation(18,217);
ok7.setLocation(20,265);
bomb11.setLocation(843,58);
removeObject(bomb3);
bomb5.setLocation(1431,360);
bomb10.setLocation(2131,194);
bomb6.setLocation(3017,290);
bomb6.setLocation(3017,334);
bomb8.setLocation(3502,284);
bomb9.setLocation(3870,24);
airplane.setLocation(132,202);
bomb10.setLocation(2152,300);
Robot robot8 = new Robot();
addObject(robot8,1598,153);
Robot robot9 = new Robot();
addObject(robot9,1201,214);
Robot robot10 = new Robot();
addObject(robot10,1212,337);
Robot robot11 = new Robot();
addObject(robot11,1477,57);
Robot robot12 = new Robot();
addObject(robot12,1047,105);
Robot robot13 = new Robot();
addObject(robot13,2642,237);
Robot robot14 = new Robot();
addObject(robot14,2383,195);
Robot robot15 = new Robot();
addObject(robot15,2314,266);
Robot robot16 = new Robot();
addObject(robot16,2512,86);
Robot robot17 = new Robot();
addObject(robot17,2927,155);
OKTHEN okthen = new OKTHEN();
addObject(okthen,661,96);
OKTHEN okthen2 = new OKTHEN();
addObject(okthen2,834,288);
OKTHEN okthen3 = new OKTHEN();
addObject(okthen3,475,177);
OKTHEN okthen4 = new OKTHEN();
addObject(okthen4,900,279);
OKTHEN okthen5 = new OKTHEN();
addObject(okthen5,1031,47);
OKTHEN okthen6 = new OKTHEN();
addObject(okthen6,884,124);
OKTHEN okthen7 = new OKTHEN();
addObject(okthen7,554,183);
OKTHEN okthen8 = new OKTHEN();
addObject(okthen8,597,282);
OKTHEN okthen9 = new OKTHEN();
addObject(okthen9,422,326);
OKTHEN okthen10 = new OKTHEN();
addObject(okthen10,369,307);
OKTHEN okthen11 = new OKTHEN();
addObject(okthen11,268,196);
OKTHEN okthen12 = new OKTHEN();
addObject(okthen12,252,112);
OKTHEN okthen13 = new OKTHEN();
addObject(okthen13,390,72);
OKTHEN okthen14 = new OKTHEN();
addObject(okthen14,733,237);
OKTHEN okthen15 = new OKTHEN();
addObject(okthen15,1045,312);
OKTHEN okthen16 = new OKTHEN();
addObject(okthen16,986,226);
OKTHEN okthen17 = new OKTHEN();
addObject(okthen17,1070,177);
OKTHEN okthen18 = new OKTHEN();
addObject(okthen18,1009,136);
OKTHEN okthen19 = new OKTHEN();
addObject(okthen19,921,105);
OKTHEN okthen20 = new OKTHEN();
addObject(okthen20,784,60);
OKTHEN okthen21 = new OKTHEN();
addObject(okthen21,743,58);
OKTHEN okthen22 = new OKTHEN();
addObject(okthen22,594,29);
OKTHEN okthen23 = new OKTHEN();
addObject(okthen23,503,9);
OKTHEN okthen24 = new OKTHEN();
addObject(okthen24,449,56);
OKTHEN okthen25 = new OKTHEN();
addObject(okthen25,401,156);
}
}