public void addAthids(int a) { for(int athid=0; athid<a; athid++) { int x = Greenfoot.getRandomNumber(getWidth()); int y = Greenfoot.getRandomNumber(getHeight()); addObject( new Athid(), x, y); } athidSpawn++; if (athidSpawn==50){ int x = Greenfoot.getRandomNumber(getWidth()); int y = Greenfoot.getRandomNumber(getHeight()); addObject( new Athid(), x, y); athidSpawn=0; } }