This contains a number of useful methods
mouseDragEnded()
mouseDragged()
mouseMoved()
mousePressed()
getMouseInfo
Use new scenario
To get a single random number in the range 0-9:
int x = Greenfoot.getRandomNumber (10);
To generate the x and y values for a random location inside the screen area of the world:
int x = Greenfoot.getRandomNumber (getWorld().getWidth())
int y = Greenfoot.getRandomNumber (getWorld().getHeight())