function saveScore(score) {
    // Kirim score ke server
    fetch('Score.php', {
        method: 'POST', // Method POST
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded' // Data dikirim dalam format form data
        },
        body: 'score=' + encodeURIComponent(score) // Data score yang dikirim
    })
    .then(response => response.json()) // Ubah response ke JSON
    .then(data => {
        // Cek status dari server
        if (data.status === "success") {
            console.log("Score saved successfully");
        } else {
            console.log("Failed to save score:", data.message);
        }
    })
    .catch(error => console.error("Error API:", error));
}