I'm trying to get a random coordinates for my worms, but I can't seem to get it right.
import greenfoot.*; // (Actor, World, Greenfoot, GreenfootImage)
/**
* This class defines the crab world.
*/
public class CrabWorld extends World
{
/**
* Crab world constructor (the beach).
* Note: Our world has a size of 560x560 cells, where every cell is just 1 pixel.
*/
public CrabWorld()
{
super(560, 560, 1);
addObject( new Crab(), 150, 100 );
addObject( new Worm(10), Greenfoot.getRandomNumber(580, 580) );
addObject( new Lobster(), 20, 480 );
addObject( new Lobster(), 480, 10 );
addObject( new Lobster(), 290, 290 );
addObject( new Person(), 290, 480 );
prepare();
}
/**
* Prepare the world for the start of the program. That is: create the initial
* objects and add them to the world.
*/
private void prepare()
{
}
}

