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 :(
![Twitter](/assets/twitter-4e19209ef84344ee0c433f4c7bad8d49.png)
![Twitter.hover](/assets/twitter.hover-1fb19a5bafc50deace8f88eaec867845.png)