To include the time in the win display, change the image text:
// from "Du hast: " +(AnzahlGrapes) // to "Du hast: "+AnzahlGrapes+"\nTime: "+(timer/60)
// from "Du hast: " +(AnzahlGrapes) // to "Du hast: "+AnzahlGrapes+"\nTime: "+(timer/60)
if(getObjects(Grape.class).isEmpty())
{
setBackground(iimmaage);
windisplay.move(20);
}
winDisplay.setLocation(<< wherever >>);
if(getObjects(Grape.class).isEmpty() && winDisplay == null)
{
setBackground(iimmaage);
winDisplay = new SimpleActor();
String text = "Du hast: "+AnzahlGrapes+"\nTime: "+(timer/60);
winDisplay.setImage(new GreenfootImage(text, 96, Color.RED, new Color(0, 0, 0, 0)));
addObject(winDisplay, << wherever >>);
}