public void detectEdge(){
		if (xPacCor>=370 && direction == 1){
			xPacCor = 370;
			moveX = 0;
		}
		if (xPacCor<=10 && direction == 2){
			xPacCor = 10;
			moveX = 0;
		}
		if (yPacCor<=10 && direction == 3){
			yPacCor = 10;
			moveY = 0;
		}
		if (yPacCor>=570 && direction == 4){
			yPacCor = 570;
			moveY = 0;
		}
	}