Hey everyone! I needed some help with this code. The return error is "cannot find symbol - method setImage(greenfoot.GreenfootImage)
Here is the world's code:
import greenfoot.*;
/**
* Write a description of class GameOver here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class GameOver extends World
{
public int img;
public int age;
/**
* Constructor for objects of class GameOver.
*
*/
public GameOver()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
imgset();
}
public void imgset()
{
age++;
if (age == (1))
{
img = (Greenfoot.getRandomNumber(2));
GreenfootImage backImage = null;
if (img == (0))
{
backImage = new GreenfootImage("gameover1.png");
}
if (img == (1))
{
backImage = new GreenfootImage("gameover2.png");
}
if (img == (2))
{
backImage = new GreenfootImage("gameover3.png");
}
if (backImage != null) setImage(backImage);
}
}
}

