diff --git a/public/index.html b/public/index.html
index 9d8b916..40dbfa7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -18,6 +18,7 @@
+
diff --git a/public/script/controller.js b/public/script/controller.js
index 2fe6153..f0be055 100644
--- a/public/script/controller.js
+++ b/public/script/controller.js
@@ -8,6 +8,9 @@ function initGame() {
initOrChangeDropInterval(game.speed);
+ music.currentTime = 0; // (optionnel) Remet au début
+ music.play();
+
// On rafraichit le plateau toutes les 16ms (environ 60 FPS)
refreshInterval = setInterval(() => {
diff --git a/public/script/element.js b/public/script/element.js
index c626eb9..9f52310 100644
--- a/public/script/element.js
+++ b/public/script/element.js
@@ -26,4 +26,6 @@ const highScoresList = document.getElementById('high-scores-list');
const resumeButton = document.getElementById('resume-button');
const mainMenuButton = document.getElementById('main-menu-button');
-const mainMenuButtonBis = document.getElementById('main-menu-button2');
\ No newline at end of file
+const mainMenuButtonBis = document.getElementById('main-menu-button2');
+
+const music = document.getElementById('background-music');
\ No newline at end of file
diff --git a/public/script/gameFunction.js b/public/script/gameFunction.js
index 9863f72..68ccf2c 100644
--- a/public/script/gameFunction.js
+++ b/public/script/gameFunction.js
@@ -302,6 +302,9 @@ async function finishGame(sendScore = true, gameOver = true) {
displayMainMenu();
}
+ music.pause();
+ music.currentTime = 0; // Remet au début
+
if (sendScore) {
const playerName = prompt('Enter your name:');
diff --git a/public/sounds/The Pixel Anthem.mp3 b/public/sounds/The Pixel Anthem.mp3
new file mode 100644
index 0000000..6c321da
Binary files /dev/null and b/public/sounds/The Pixel Anthem.mp3 differ