whats boolean
public boolean hasStarted = false;
public void act() { if (!hasStarted && Greenfoot.mouseClicked(null)) { hasStarted = true; // code for some action(s) } if (!hasStarted) return; // other code within act() }
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class house here. * * @author (your name) * @version (a version number or a date) */ public class house extends World { /** * Constructor for objects of class house. * */ public house() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(400, 600, 1); soilier gunman = new soilier (); addObject(gunman,200,550); zombie zombie = new zombie (); addObject(zombie,200,60); public boolean hasStarted = false; public void act() { if (!hasStarted && Greenfoot.mouseClicked(null)) { hasStarted = true; // code for some action(s) } if (!hasStarted) return; // other code within act() } } }
zombie Zombie = new zombie();
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class house here. * * @author (your name) * @version (a version number or a date) */ public class house extends World { /** * Constructor for objects of class house. * */ public house() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(400, 600, 1); soilier gunman = new soilier (); addObject(gunman,200,550); zombie Zombie = new zombie (); addObject(Zombie,200,60);}} public boolean hasStarted = false; public void act() { if (!hasStarted && Greenfoot.mouseClicked(null)) { hasStarted = true; viod removeObject(instuction) } if (!hasStarted) return; // other code within act() } } }