2021/12/3
int x = Greenfoot.getRandomNumber(getWidth()/2); // or getWorld().getWidth() if in Actor subclass)
int x = getWidth()/2+Greenfoot.getRandomNumber(getWidth()/2); // same note (but for both getWidth()s)
X