public void update(GameContainer container, StateBasedGame game, int delta)
			throws SlickException {
		
		PC = (PistolCaveGame) game;
    	
		//socket connecting to client
        Socket s = null;
        
        
        //connect to client
        if(renderWait != 0 && connections.size() < 2){
			try {
				s = ss.accept();
				System.out.println("Connecting to client.");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			//add new connection to connection array and start a new thread for the client.
	        Connection con = new Connection(s, PC);
	        Thread thread = new Thread(con);
	        thread.start();
	        System.out.println("Started new thread.");
	        connections.add(con);
        }
        renderWait = 1;
	}