Hey,
in my game i made a menu with a button. When the button was clicked with the mouse it should Change the World and start the game, but nothing happens.... What have i done wrong??
This is the world class of the menu (home):
Thank you very much.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public Home() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super ( 600 , 400 , 1 ); prepare(); } private void prepare() { Button button = new Button(); addObject(button, 420 , 300 ); return ; } public void act() { if (Greenfoot.mouseClicked(Button. class )) { Greenfoot.setWorld( new Map()); } } |