Can someone plz tell me how to create a game over screen for when both of my players die. Also, can someone put in step by step I'm kinda new with this


1 2 3 4 | public void started() { if ( ! getObjects(GameOver. class ).isEmpty() ) Greenfoot.stop(); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import greenfoot.*; /** * Write a description of class GameOverScreen here. * * @author (your name) * @version (a version number or a date) */ public class GameOverScreen extends World { /** * Constructor for objects of class GameOverScreen. * */ public GameOverScreen() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super ( 600 , 400 , 1 ); prepare(); } /** * Prepare the world for the start of the program. That is: create the initial * objects and add them to the world. */ private void prepare() { Back_button back_button2 = new Back_button(); addObject(back_button2, 294 , 333 ); GameOverText gameovertext = new GameOverText(); addObject(gameovertext, 309 , 175 ); gameovertext.setLocation( 300 , 176 ); } } |
1 2 3 4 | public void started() { if ( ! getObjects(GameOver. class ).isEmpty() ) Greenfoot.stop(); } |