public boolean setDirections(JSONArray directionArray, int levelArg){
	// TODO: check you can't specify longer directions than
	// your droid level permits. The loop won't do too many
	// steps anyway, but we should send back a message.
	directions = new String[directionArray.length()];
	try {
	    for(int i = 0; i < directionArray.length(); i++){
		String direction = directionArray.getString(i);
		if(!(direction.equals("up") || direction.equals("down")
		     || direction.equals("left-up") || direction.equals("left-down")
		     || direction.equals("right-up") || direction.equals("right-down"))){
		    return false;
		}
		directions[i] = directionArray.getString(i);
	    }
	}
	catch(JSONException e){
	    return false;
	}
	level = levelArg;
	return true;
    }