Hi so far I have got this code and I would like to make RedWorms appear at random locations after the counter value is 10. How can I do that? because now, after the counter value becomes 10, only 1 RedWorm appears. What is wrong with my code?
public void lookForWorm()
{
if (canSee(Worm.class))
{
eat(Worm.class);
counter .add(1);
if (counter.getValue() == 10)
{
getWorld().addObject(new RedWorm(), Greenfoot.getRandomNumber(950),
Greenfoot.getRandomNumber(550));

