My game is programmed to end when my enemy touches the beehive. For some reason, it only ends sometimes. Other times my enemies touch the beehive and go to the spot where the beehive was. Help?
My game is programmed to end when my enemy touches the beehive. For some reason, it only ends sometimes. Other times my enemies touch the beehive and go to the spot where the beehive was. Help?
My game is programmed to end when my enemy touches the beehive. For some reason, it only ends sometimes. Other times my enemies touch the beehive and go to the spot where the beehive was. Help?
Cannot fix invisible code.
private void lookForBeehive()
{
if (isTouching(Beehive.class))
{
Greenfoot.playSound("munch.mp3");
removeTouching(Beehive.class);
Greenfoot.setWorld(new GameOverScreen());
Greenfoot.stop();
}
}
It only works sometimes when it touches the beehive it ends the game. Other times it does not.