public boolean detectEdge(int direction){ // detects if it is at the edge
		if (xMonstCor>=370 && direction == 1){
			xMonstCor = 370;
			return true;
		}
		if (xMonstCor<=10 && direction == 2){
			xMonstCor = 10;
			return true;
		}
		if (yMonstCor<=10 && direction == 3){
			yMonstCor = 10;
			return true;
		}
		if (yMonstCor>=570 && direction == 4){
			yMonstCor = 570;
			return true;
		}
		return false;
	}