protected static void pausegame()
	{
		if(paused)
		{
			paused = false;
			timer.start();
		}
		else
		{
			paused = true;
			timer.stop();
			BufferedImage controls = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
			try{controls = ImageIO.read(new File("Controls.png"));}
			catch (IOException e){e.printStackTrace();}
			pane = (Graphics2D) buffer.getDrawGraphics();
			pane.drawImage(controls, null, 0, 0);
			pane.dispose();
			buffer.show();
		}
	}