Do I have my method call in the wrong place or something. Put this in the Lobster class so that when the Lobster touches the Crab, the game ends. But it doesn't end.
public void act()
{
turnAtEdge();
if(Greenfoot.getRandomNumber(20)< 10)
{
turn(7);
}
move(7);
endgame();
lookForCrab();
}
public void lookForCrab()
{
if( isTouching(Crab.class) )
{
removeTouching(Crab.class);
}
}
public void turnAtEdge()
{
if( isAtEdge() )
{
turn(17);
}
}
public void endGame()
{
if ( isTouching(Crab.class) )
{
Greenfoot.stop();
return;
}
}
}
