private int keepSpriteOnMapX(Sprite sprite,int sx){
  sx=Math.max(sx,0);
  if (ww != 0) {
    sx=Math.min(sx,Math.max(getWidth() + svx,convertWorldXToScaledScreen(ww)) - sprite.getWidth());
  }
  return sx;
}

private int keepSpriteOnMapX ( Sprite sprite , int sx ) { sx = Math . max ( sx , 0 ) ; if ( ww != 0 ) { sx = Math . min ( sx , Math . max ( getWidth ( ) + svx , convertWorldXToScaledScreen ( ww ) ) - sprite . getWidth ( ) ) ; } return sx ; }
try to keep a sprite on the map . adjust the x coordinate .
