private void paintMap(final Graphics2D g2) {
		// For the scrolling we need to draw an additional row on the top of the window.
        int k = 0;
		if (mainGame.getLevel().getTopIndex() > 0)
            k = 1;

		for (int i = mainGame.getLevel().getTopIndex() - k; i <= mainGame
				.getLevel().getBottomIndex(); i++) {
            int yMath = mainGame.getLevel().getTileHeight() // Calculate Y coordinate for the map.
                    * (i - mainGame.getLevel().getTopIndex())
                    + mainGame.getLevel().getInnerTile();
			for (int j = 0; j < mainGame.getLevel().getLevelWidth(); j++) {
				int xMath = mainGame.getLevel().getTileWidth() * j; // Calculate X coordinate for the map.
				if (mainGame.getLevel().getMap()[i][j] != null) {
					if (mainGame.getLevel().getMap()[i][j].getTexture() != null)
						g2.drawImage(mainGame.getLevel().getMap()[i][j] // Draw the texture for the specific gameObject
								.getTexture(), xMath, yMath, mainGame
								.getLevel().getTileWidth(), mainGame.getLevel()
								.getTileHeight(), null);
				}
			}
		}
	}