how do you create a page that comes up when you press run that tells you how to play the game and then have a button to start the game


Greenfoot.setWorld(new InfoPage(this));
import greenfoot.*; public class InfoPage extends World { World main = null; public InfoPage(World world) { main = world; createImage(); // do not use if you have a default image for this world } public void act() { if (Greenfoot.mouseClicked(this)) Greenfoot.setWorld(main); } // if creating the image programatically private void createImage() { // code creating the image // say somewhere: "Click anywhere to continue" } }
// field to flag if first start or not boolean hasStarted = false; // method to show 'InfoPage' if first start public void started() { if (hasStarted) return; Greenfoot.setWorld(new InfoPage(this)); hasStarted = true; }