@Override
	public void run() {
		requestFocus();
		Image image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_ARGB);
		while(isRunning)
		{
			Graphics g = image.getGraphics();
			g.drawImage(Images.background,0,0,null);
			level.render(g);
			g.dispose();
            level.tick(input);
			try
			{
				g = getGraphics();
				g.drawImage(image,0,0,WINDOWX,WINDOWY,0,0,400,300,null);
				g.dispose();
			}
			catch (Throwable e)
			{
			    e.printStackTrace();
			}
		}
		
	}