How to stop the game when the spider eat the chicken
import greenfoot.*;
public class Spider extends Actor
{
// GLOBAL DECLARATIONS
// ===================
// var declarations may go here
// CONSTRUCTOR SUBPROGRAM
// ======================
public Spider()
{
// code here runs one time only
} // end constructor
// ACT METHOD
// ========================
public void act()
{
eat();
turn(2);
move(3);
} // end act
public void eat()
{
Actor chicken;
chicken= getOneIntersectingObject(Chicken.class);
if(chicken !=null)
{
getWorld().removeObject(chicken) ;
}//end if
}//end of eat
} // end of class

