private void drawHUD(Graphics2D graphics) {
        graphics.setFont(smallFont);
        graphics.setColor(Color.WHITE);
        graphics.drawString(String.format("Score: %s",
                            new DecimalFormat("#,###").format(score)), 50, 50);
        graphics.drawString(String.format("Level %d, Wave %d/%d", levelNo,
                            waveNo, level.numWaves()), 50, 75);

        if (player.getNumUpgrades() > 0) {
            graphics.drawString("Upgrades:", 50, 125);
            int upgradeyoffset = 150;
            for (String upgrade : player.getGunUpgrades()) {
                graphics.drawString(upgrade, 100, upgradeyoffset);
                upgradeyoffset += 25;
            }
        }

        String text = "x" + lives;
        int yOffset = (int) (smallFont.getLineMetrics(text, graphics.getFontRenderContext()).getAscent() / 2);
        graphics.drawString(text, 60 + lifeSprite.getWidth(), screen.getHeight() - 50 + yOffset);
        graphics.setPaint(lifeSprite.getPaint(lifeRect));
        graphics.fill(lifeRect);

        if (Preferences.getValue("devMode") == 1)
            drawDevUI(graphics);
        if (paused)
            drawPaused(graphics);
        if (quitRequested)
            drawQuitConfirmation(graphics);
        if (lives == 0 || (spawnedInWave == wave.getNumEnemies() && remaining == 0))
            drawLevelProgress(graphics);
    }