private void clientLoop(){
		boolean breakLoop = false;
		MenuRender mainMenu = new MenuRender();
		while(true){
			//menuRender is the next state, and returns which thing is clicked on
			int nextState = mainMenu.menu(sm, errorCode);
			switch (nextState){
			case 1 ://new game
				startGame();
				break;
			case 2 ://exit
				breakLoop = true;
				break;
			case 5 ://join game
				joinGame(mainMenu);
			default :
				break;
			}
			
			if(breakLoop){
				break;
			}
		}

		sm.restoreScreen();
	}