Would it be better to put the game ender inside the collectBomb method?
Is this better or worse? I think its worse, but at lest funcional.
private int collectBomb(int numOfBombs)
{
Actor bomb;
bomb = getOneObjectAtOffset(0, 0, Bomb.class);
if (bomb != null)
{
getWorld().removeObject(bomb);
numOfBombs = numOfBombs + 1;
}
if (numOfBombs == 100)
{
Greenfoot.setWorld(new MyWorld());
}
return numOfBombs;
}
