public void setCamera(Point cam, Point worldBound) {
        //clamp the camera in the world boundaries (offset by panelsize/2 to center it)

        //the x is clamped with one screen's width allowed to overhang on either side of the map
        int x = clamp(cam.x - worldBound.x/2,  - worldBound.x, world.getWidth() * world.GRID_SIZE);
        //the y is clamped inside the map
        int y = clamp(cam.y - worldBound.y/2, 0, world.getHeight() * world.GRID_SIZE - worldBound.y);


        //if the screen overhangs more than 3/4s on the left or right of the map, move it "around the
        //world" so that it's back inside
        if(x > world.getWidth() * world.GRID_SIZE -(worldBound.x/4)){
            x -= world.getWidth() * world.GRID_SIZE;
        }
        if(x < (-3*worldBound.x)/4){
            x += world.getWidth() * world.GRID_SIZE;
        }

        Point n = new Point(x,y);
        playerList.getCurrentPlayer().setCamera(n);
    }