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; }