My game is a sea turtle trying to get to the sea. I have trash set up at random places all across the board using this code in World Class:
addObject(new Trash(), Greenfoot.getRandomNumber(800), Greenfoot.getRandomNumber(560));
The problem is that if I start a new game and the trash is already touching the turtle the game ends right away.
I was wondering if there is a way to keep the trash in the vicinity starting at x coordinate 147 and y coordinate of 560. This way the trash starts a little farther out in the board.
Thank you for your help