@Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);

        int bx = (camera.getX() < 0) ? 0 : (int) camera.getX();
        int by = (camera.getY() < 0) ? 0 : (int) camera.getY();
        int ox = -1 * (bx - (int) camera.getX());
        int oy = -1 * (by - (int) camera.getY());

        drawMap(g);
        drawGameObjects(g);
        for (Player p : players) {
            p.draw(g);
        }
        g.clipRect(0, 0, getWidth(), getHeight());
        g.drawImage(uiHealth, 0, 0, 221, 81, null);
        g.drawImage(healthBar, 83, 17, 26 * player.getHealth(), 12, null);
        if (!isAlive) {
            timer.stop();
            g.setColor(Color.red);
            g.setFont(new Font("Sherif", 1, 50));
            g.drawString("YOU DIED!", getWidth() / 2 - 50, getHeight() / 2);
            g.drawString("Time survived : " + time, getWidth() / 2 - 46, getHeight() / 2 + 50);
        }

    }