I'm programming a game where the stars in the game move to the right side of the world when it reaches the left side; this is the code I have for it
if(getX()<3){
setLocation(1000, Greenfoot.getRandomNumber(getY()));
}
After running the game for a few seconds, I get a terminal window that says java.lang.IllegalArgumentException: n must be positive. I haven't defined n anywhere and I've double checked which line of code it's referring to. Help please :(