public Client() {
	//gm = new GameMechanics(); //You throw a NullPointerException
	mapgen = new MapGenerator();
	mapren = new MapRenderer();
	Client.instance = this;
	frame = new JFrame(TITLE);
	frame.setSize(1280, 720);
	frame.setMinimumSize(new Dimension(800, 600));
	frame.setPreferredSize(frame.getSize());
	frame.setLocationRelativeTo(null);
	canvas = new GameCanvas();
	frame.add(canvas);
	frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
	frame.setVisible(true);
	frame.addWindowListener(this);
    }