Files
SMIMS_2026_1/fighter/EndWorld.java
T
2026-09-16 17:10:54 +02:00

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());
}
}
}