I am hoping someone could help me find the problem. I need to write and construct a constructor for randomDogs(int population) which introduces three Dog objects at random locations in the DogWorld. The code compiles without any problems, but I do not see any random dogs in the world. I am still learning but this is what I have so far:
public class DogWorld extends World
{
/**
* Constructor for objects of class DogWorld.
*
*/
public DogWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
drawDog();
randomDogs();
}
/**
* Add Dog to world.
*/
public void drawDog()
{
addObject( new Dog(), 300, 200 );
}
/**
* Adds dogs to world at random locations.
*/
public void randomDogs()
{
if ( Greenfoot.getRandomNumber(10)== 3 )
{
addObject( new Dog(), 69, 125);
}
}
}

