I can't see anything which could create an error at this code, however if I reset the game it just crashes with no error log message or anything usefull for solving the problem.
Codes in which the error could be:
public class Background extends World
{
private int imageCount = 0;
private GreenfootImage bgImage = new GreenfootImage("Background.png");
public int dif = MMPlayer.diff;
public int height = 0;
public void act() {
imageCount += 4;
drawBackgroundImage();
height++;
showText("Height:" + height + " / 3000",100,50);
if(height >= 2980)
{
showText ("Level Completed",500,375);
}
switch (dif)
{
case 1:
PlanetspawnerE();
case 2:
PlanetspawnerM();
case 3:
PlanetspawnerH();
}
}
... unnecessary
public class MMPlayer extends Actor
{
public static int diff;
public MMPlayer()
{
this.getImage().scale(50, 100);
setLocation(500,700);
}
public void act()
{
setImage("MMRocket.png");
this.getImage().scale(50, 100);
if(Greenfoot.isKeyDown("right"))
{
setImage("Rocket+30.png");
this.getImage().scale(70, 82);
move(4);
}
if(Greenfoot.isKeyDown("left"))
{
setImage("Rocket-30.png");
this.getImage().scale(70, 82);
move(-4);
}
if(Greenfoot.isKeyDown("up"))
{
setLocation(getX(), (getY()-4));
}
if(Greenfoot.isKeyDown("down"))
{
setLocation(getX(), (getY()+4));
}
Actor Easy = getOneIntersectingObject(MMEasy.class);
Actor Medium = getOneIntersectingObject(MMMedium.class);
Actor Hard = getOneIntersectingObject(MMHard.class);
Actor Hitbox = getOneIntersectingObject(TryAgain.class);
if(Easy !=null)
{
setImage("Explosion.png");
diff = 1;
Greenfoot.setWorld(new Background());
}
if(Medium !=null)
{
setImage("Explosion.png");
diff = 2;
Greenfoot.setWorld(new Background());
}
if(Hard !=null)
{
setImage("Explosion.png");
diff = 3;
Greenfoot.setWorld(new Background());
}
if (Hitbox != null)
{
setImage("Explosion.png");
Greenfoot.setWorld(new Background());
}
}
}

