@Override
    public void componentResized(ComponentEvent e) {
        int lim = Math.min(getWidth(), getHeight());
        if (game.getMapSize() != 0) {
            int size = lim / game.getMapSize();
            game.setPixelSize(size);
        }
    }