In the code addObject it keeps saying that method addObject in class Greenfoot.world cannot be applied to the given types
public class MyWorld extends World
{
/**
* Constructor for objects of class MyWorld.
*
*/
Player bluePlayer = new Player(0,255);
Player whitePlayer = new Player(255,0);
Counter blueCounter = new Counter();
Counter whiteCounter = new Counter();
int count=0;
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
getBackground().setColor(Color.BLACK);
getBackground().fill();
addObject(bluePlayer, 450, 300);
addObject(whitePlayer, 450,100);
addObject(blueCounter, 550,50);
addObject(whiteCounter, 50, 50);
}
public void act()
{
count++;
if(count >100)
addObject(new Food(255,0, 0));
Greenfoot.getRandomNumber(getWidth() -1);
Greenfoot.getRandomNumber(getHeight() -1);
}
}

