In my game you cannot win, it is always a draw, according to the program. The code seems perfectly fine. Anyone here that can spot what I am doing wrong?
I checked and the winner argument is correctly called.
private void gameOver(int winner) { switch (winner) { case 1 : Menu menu1 = new Menu(); menu1.setImage("Crosses wins.png"); getWorld().addObject(menu1,1,1); case -1 : Menu menu2 = new Menu(); menu2.setImage("Noughts wins.png"); getWorld().addObject(menu2,1,1); case 0 : Menu menu3 = new Menu(); menu3.setImage("Draw.png"); getWorld().addObject(menu3,1,1); } while(!Greenfoot.isKeyDown("enter")) wait(5); Greenfoot.setWorld(new MyWorld()); wait(20); }