I want to get the limits of an image and I don't know if I did well.
up=this.getY()-this.getImage().getHeight()/2;
down=this.getY()+this.getImage().getHeight()/2;
left=this.getX()-this.getImage().getWidth()/2;
right=this.getX()+this.getImage().getWidth()/2;