2324252627282930313233
public AbstractSheepWorld(final int width, final int height) { super(width, height); Atmosphere atmosphere = createAtmosphere(this); Fence fence = createFence(this); Ground ground = createGround(this); ground.setSize(fence); addObject(atmosphere);
90919293949596979899100
World world = getWorld(); int fw = world.getWidth(); int fh = world.getHeight(); Fence fence = world.findFirstObject(Fence.class); int w = fence.getWidth(); int h = fence.getHeight(); return -1 * (getY() - fh) * w / h + (fw - w) / 2; }