public void Loading(){
	   ServerUp=true;
	   isPainted=false;
	   while(ServerUp){
		   repaint();
		   try{Thread.sleep(OPTIMAL_TIME/1000000);}catch (Exception e) {}
		   if(isServer&&sendMap){
			   server.sendData(("2 "+Main.mapaS+" ").getBytes());
		   }
		   if(!isServer) client.sendData("1 ".getBytes());
		   if(polaczono){
			   sendMap=false;
			   gameLoop();
			   break;
		   }
	   }
   }