We can extend the bounded environment from our program by constructing the Grid with sizes. This way are actors can be randomly dispersed throughout the Grid. the following BoundedEnvironment has 40 rows and 60 columns
import info.gridworld.actor.ActorWorld; import info.gridworld.actor.Bug; import info.gridworld.actor.Rock; import info.gridworld.actor.Critter; import info.gridworld.grid.BoundedGrid; import info.gridworld.actor.Actor; public class BugRunner { public static void main(String[] args) { BoundedGridg = new BoundedGrid (40,60); ActorWorld world = new ActorWorld(g); for (int x=1; x <= 10; x++) world.add(new Critter()); for (int x=1; x <= 10; x++) world.add(new Shooter(10)); for (int x=1; x <= 10; x++) world.add(new Bug()); world.show(); } }