have you an idea? or not?
import greenfoot.*; public class Menu extends Actor { private String menuItem = ""; private boolean menuDone = false; public void act() { if (!menuDone && !"".equals(menuItem)) { removeObjects(getObjects(Menu.class)); // set up background for game // add objects for game menuDone = true; } // rest of act (for game play) } public void setMenuItem(String muItem) { menuItem = muItem; } }
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class World2 extends World { public boolean Start; public World2() { super(600, 400, 1); } private String menuItem = ""; private boolean menuDone = false; public void act() { if (!menuDone && !"".equals(menuItem)) { removeObjects(getObjects(Menu.class)); menuDone = true; } } public void setMenuItem(String muItem) { menuItem = muItem; } }