public static int numpadToX(char num){	//returns the x direction of each keypad input. default is zero because a non-directional key doesn't allow movement.
		switch(num){
		case('1'):
			return -1;
		case('2'):
			return 0;
		case('3'):
			return 1;
		case('4'):
			return -1;
		case('6'):
			return 1;
		case('7'):
			return -1;
		case('8'):
			return 0;
		case('9'):
			return 1;
		default:
			return 0;
		}
	}