public void updatePosition(Vec2 maximumMovement){
        boolean isNearLeftEdge = xOnMap <= StatePanel.PWIDTH / 2;
        boolean isNearRightEdge = xOnMap >= mapWidth - StatePanel.PWIDTH / 2;        
        if(left){
            if (isNearLeftEdge) {
                xOnMap = (xOnMap + maximumMovement.getX() >= 0) ? xOnMap + maximumMovement.getX() : 0;
            } else if (isNearRightEdge) {
                xOnMap += maximumMovement.getX();
            }else{
                xOnMap += maximumMovement.getX();
            }            
        }else if(right){
            if (isNearLeftEdge) {
                xOnMap += maximumMovement.getX();
            }else if(isNearRightEdge) {
                xOnMap = (xOnMap + maximumMovement.getX() >= mapWidth)? mapWidth : xOnMap + maximumMovement.getX();
            } else {
                xOnMap += maximumMovement.getX();
            }            
        }
            yOnMap += maximumMovement.getY();
            //update center and AABB coordinates
            center.setXY(xOnMap + xHalfExtent, yOnMap + yHalfExtent);
            aabb.setCenter(center);        
    }