Endscreen erstellt

This commit is contained in:
2026-09-15 19:27:12 +02:00
parent 6b842a7b75
commit cce1abcc81
6 changed files with 92 additions and 15 deletions
+30
View File
@@ -0,0 +1,30 @@
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class GameOverWorld here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class EndWorld extends World
{
/**
* Constructor for objects of class GameOverWorld.
*
*/
public EndWorld(String pSieger)
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
showText("GAME OVER", 300, 60);
showText("the winner is " + pSieger, 300, 200);
showText("Drücke R für einen Neustart", 300, 220);
}
public void act(){
if (Greenfoot.isKeyDown("r")){
Greenfoot.setWorld(new StartWorld());
}
}
}