我想将 gridworld 中的网格从默认的 10x10 调整为我想要的任何大小。我一直在用 15x15 对其进行测试,看看它是否有效。但我似乎无法弄清楚这一点,互联网上的其他消息来源说我正在做的事情应该有效。
即使我尝试设置rowSize
& colSize
,网格仍保持在 10x10,我该如何解决这个问题,以便将网格打开到 15x15 屏幕?
这个类是我调整网格大小的地方
import info.gridworld.actor.*;
import info.gridworld.grid.BoundedGrid;
public class pokeGrid extends ActorWorld{
private static final int rowSize = 15;
private static final int colSize = 15;
public pokeGrid(){
super(new BoundedGrid<Actor>(rowSize, colSize));
}
}
这个类是actor的runner
public class BeecherBugRunner extends pokeGrid {
private static pokeGrid world = new pokeGrid();
public static void main(String[] args)
{
ActorWorld world = new ActorWorld();
BeecherBug beecher = new BeecherBug(4);
world.add(new Location(7, 8), beecher);
world.show();
}
}