Ah thanks, thanks to everyone who's helped yet again much appreciated.
if(getX() == 17 && getY()==15) { ((background)getWorld()).board(); Greenfoot.stop(); } else if(getX() == 18 && getY()==15) { ((background)getWorld()).board(); Greenfoot.stop(); }
public void board() { Font font = getBackground().getFont(); font = font.deriveFont(FONT_SIZE); getBackground().setFont(font); getBackground().setColor(Color.red); getBackground().drawString("You win!",getWidth()/2,getHeight()/2); }
public void board() { GreenfootImage youwin = new GreenfootImage("You win!", FONT_SIZE, Color.red. new Color(0, 0, 0, 0)); getBackground().drawImage(youwin, (getWidth() - youwin.getWidth()) / 2, (getHeight() - youwin.getHeight()) / 2); }