No idea why the Scoreboard doesnt come up.
import greenfoot.*; // (Actor, World, Greenfoot, GreenfootImage) public class FruitWorld extends World { private Counter scoreCounter; /** * Create the fruit world. Our world has a size * of 560x560 cells, where every cell is just 1 pixel. */ public FruitWorld() { super(700, 700, 1); scoreCounter = new Counter(); addObject( new Counter(), 650, 40 ); addObject( new Player1(), 150, 100 ); addObject( new Player2(), 550, 600 ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); addObject( new Fruit(), Greenfoot.getRandomNumber(700), Greenfoot.getRandomNumber(700) ); } private void endOfGame() { int player1Eaten = ((Player2) getObjects(Player2.class).get(0)).getPlayer1Eaten(); if (player1Eaten == 1) { gameOver ("Game Over"); } } public void gameOver(String message) { int value = ((Counter) getObjects(Counter.class).get(0)).getValue(); addObject (new ScoreBoard ("Game Over", value), 320, getHeight()/2); Greenfoot.stop(); } }