In the game I check how many bugs have past a certain line on the world and delete them. In the code below, at the very end, I check the counter for the bugs and if 35 have past the line, the game ends, but it doesn't end it continues normally. Can someone help me out or know why this happens?
public class LadybugCounter extends Actor
{
private int BugtotalCount = 0;
Color colorW = Color.WHITE;
Color colorB = Color.BLACK;
Color colorR = Color.RED;
public LadybugCounter()
{
setImage(new GreenfootImage("LadybugsPastYou 0", 20, colorR, colorW));
}
public void bumpCount(int amount)
{
BugtotalCount += amount;
setImage(new GreenfootImage("LadybugsPastYou " + BugtotalCount, 20, colorR,colorW));
}
public void Greenfoot()
{
if (BugtotalCount == 35) {
Greenfoot.stop();
}
}
}
