32 lines
849 B
Java
32 lines
849 B
Java
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, 70);
|
|
showText("the winner is " + pSieger, 300, 220);
|
|
showText("Drücke R für einen Neustart", 300, 340);
|
|
setBackground(new GreenfootImage("GameOverSreen.png"));
|
|
}
|
|
public void act(){
|
|
if (Greenfoot.isKeyDown("r")){
|
|
Greenfoot.setWorld(new MenuWorld());
|
|
}
|
|
}
|
|
}
|