public void update(Point p) {
		
		if (Collide.AABB_point(box, p)) {
			if (direction) {
				int temp = Math.abs(y - p.y);
				int maxTemp = temp * max / sizeMax;
				maxTemp = max - maxTemp;
				
				if (maxTemp > 0) {
					pos = Math.abs(y - p.y);
					box.setLocation(x, pos + y - 5);
					valeur = pos * max / sizeMax;
					valeur = max - valeur;
				}
			}
			else {
				int temp = Math.abs(x - p.x);
				int maxTemp = temp * max / sizeMax;
				maxTemp = max - maxTemp;
				
				if (maxTemp > 0) {
					pos = Math.abs(x - p.x);
					box.setLocation(pos + x - 5, y);
					valeur = pos * max / widthMax;
				}
			}
		}
	}