protected void updateDir(float speed) {
		switch(dir) {
		default:
		case 0:
			ax = 0;
			ay = -speed;
			break;
		case 1:
			ax = 0;
			ay = speed;
			break;
		case 2:
			ax = speed;
			ay = 0;
			break;
		case 3:
			ax = -speed;
			ay = 0;
		}
	}