ok so here is the problem i was trying to get my mouse to be able to click "TRY AGAIN" and then to restart the game but it didnt work so im using keys instead now but what would be a good restart code? like when you press "x" it would just restart the game heres what my section looks like i put in a lil spot for it if u know what to put.
public void getEaten() { // Code for sound (if you want) // Code to remove crab (if you want) CrabWorld gw = (CrabWorld) getWorld(); ScoreBoard scoreboard = new ScoreBoard(counter.getValue()); gw.addObject(scoreboard, 273, 302); gw.repaint(); while(!Greenfoot.isKeyDown("right")){} //insert program restart here Greenfoot.stop(); }