public void render()
	{
		//storing the next rendered screen
		bs = getBufferStrategy();
		if(bs == null)//so we don't create BufferStrategy every time we render
		{
			//buffers the next 3 renders 
			createBufferStrategy(3);
			return;
		}

		screen.clear();//clears the previous pixels
		double xScroll = player.getPositionX()-screen.getWidth() / 2;
		double yScroll = player.getPositionY()-screen.getHeight() / 2;
		level.render((int)xScroll, (int)yScroll);


		menu.render(screen);

		for(int i = 0; i < pixels.length; i ++)
		{	//sets the rendered screen pixel array to the game pixels array
			pixels[i] = screen.getPixels()[i];
		}

		if (debug.turnOffGraphics()) {
			for(int i = 0; i < pixels.length; i ++)
			{	//sets the rendered screen pixel array to the game pixels array
				pixels[i] = 0xFF000000;
			}
		}

		g = bs.getDrawGraphics();//creates a way to draw what is in the Buffer to the screen

		g.drawImage(image, 0, 0, getWidth(), getHeight(), null);

		if (debug.turnOffGraphics())
			level.getCollisionManager().drawHitBoxes(g,screen);
		
		
		if(player.getStats().isDead())
		{
			g.setColor(new Color(0, 0, 0, 150 ));
			g.fillRect(0,250,1024, 150);
			g.setColor(Color.red);
			g.setFont(new Font("OptimusPrinceps", Font.PLAIN,100)); 
			g.drawString("YOU DIED", 240, 350);
			
			deathCounter--;
			if(deathCounter == 0)
			{
				player.reset();
				deathCounter=deathLength;
			}
		}
		g.setFont(new Font("OptimusPrinceps", Font.PLAIN,12)); 
		g.setColor(Color.black);
		

		// Will turn off the display health if the debug mode is on.
		if (!debug.turnOffGraphics())
			displayHealth(menu);
		if(debug.turnOffGraphics()){
			level.drawStates(g);
		}
		//level.drawPaths(g, screen);
		//g.fillRect(Mouse.getX() - 32, Mouse.getY() - 32, 64, 64);
		//g.drawString("Button : " + Mouse.getButton(),Mouse.getX() - 32, Mouse.getY() - 32);
		g.dispose();//removes the graphics after you remove them
		bs.show();
	}