I have everything else correct, but for some reason this is giving me problems. I want to implement a method called populate(). i want to be called in the constructor. I want it to the method to create a random number of objects of each type of object. This is my code. my error is "*strong text*constructor yellowish in class yellowish cannot be a apllied to given types. required: int found: not argument reason: actual and form argument list differ in length.
public class FishWorld extends World
{
/**
* Constructor for objects of class FishWorld.
*
*/
public FishWorld()
{
super(600, 400, 1);
populate();
populate2();
populate3();
}
public void populate()
{
int randX;
int randY;
for(int i = 0; i < 5; i++)
{
YellowFish yf = new YellowFish();
randX = Greenfoot.getRandomNumber ( getWidth() );
randY = Greenfoot.getRandomNumber( getHeight() );
addObject(yf, randX, randY);
}
}
public void populate2()
{
int randX;
int randY;
for(int i = 0; i < 5; i++)
{
GreenFish gf = new GreenFish();
randX = Greenfoot.getRandomNumber ( getWidth() );
randY = Greenfoot.getRandomNumber( getHeight() );
addObject(yf, randX, randY);
}
}
public void populate3()
{
int randX;
int randY;
for(int i = 0; i < 5; i++)
{
StripeFish sf = new StripeFish();
randX = Greenfoot.getRandomNumber ( getWidth() );
randY = Greenfoot.getRandomNumber( getHeight() );
addObject(yf, randX, randY);
}
}
}