public void paintBackground() {
//        Graphics g = MainPanel.getInstance().getGraphics();
        g.clearRect(0,0,MainPanel.getInstance().getWidth(),MainPanel.getInstance().getHeight());
        g.setColor(Color.white);
        int pointX = 0;
        int pointY = 0;
        try {
            InputStream pathToFile = this.getClass().getResourceAsStream("/dotaMap.jpg");
            Image image = ImageIO.read(pathToFile);
            g.drawImage(image, pointX, pointY, MainPanel.getInstance().getWidth(),MainPanel.getInstance().getHeight(), (img, infoflags, x, y, width, height1) -> false);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        for (int i = 0; i < 21; i++) {
            for (int j = 0; j < 7; j++) {
                Point pointZ = new Point(pointX + (j * side * 3), pointY + (i * height));
                g.drawPolygon(generatePolygon(pointZ));
            }
            if(i%2==0){
                pointX += (side*1.5);

            }
            else {
                pointX -= (side*1.5);
            }

        }

    }