Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexatunes authored May 24, 2024
1 parent 0223e5a commit 68feb3d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 10 additions & 2 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function switchTeambuilder(){
setTimeout(actuallySwitchTeambuilder, 1000)
}

const songs = ["Harrisville.mp3", "Springdale.mp3", "Blossom.mp3"]
const songs = ["Harrisville.mp3", "Springdale.mp3", "Blossom.mp3", "SoAlone.mp3", "Uptown.mp3", "SanFantastico.mp3", "OldHarrisville.mp3", "Sakura.mp3"]

function startGame(){
document.getElementById("startMenu").style.display = "none";
Expand Down Expand Up @@ -75,4 +75,12 @@ function loadMusic(){
function hidePad(){
document.getElementById("padTrans").style.animation = "fadeOut 1s";
setTimeout(intoFinished, 1000)
}
}

document.getElementById("bgm").addEventListener("ended", function(){
document.getElementById("bgm").currentTime = 0;
const randomSong = Math.floor(Math.random() * songs.length);
const path = "./audios/music/" + songs[randomSong];
document.getElementById("bgm").src = path;
document.getElementById("bgm").play()
});
10 changes: 9 additions & 1 deletion scripts/teambuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function toggleMusic(){
}
}

const songs = ["Harrisville.mp3", "Springdale.mp3", "Blossom.mp3"]
const songs = ["Harrisville.mp3", "Springdale.mp3", "Blossom.mp3", "SoAlone.mp3", "Uptown.mp3", "SanFantastico.mp3", "OldHarrisville.mp3", "Sakura.mp3"]

function setUp(){
const randomSong = Math.floor(Math.random() * songs.length);
Expand Down Expand Up @@ -69,3 +69,11 @@ function setUp(){
document.getElementById("padTrans").style.animation = "fadeOut 1s";
setTimeout(intoFinished, 1000)
}

document.getElementById("bgm").addEventListener("ended", function(){
document.getElementById("bgm").currentTime = 0;
const randomSong = Math.floor(Math.random() * songs.length);
const path = "./audios/music/" + songs[randomSong];
document.getElementById("bgm").src = path;
document.getElementById("bgm").play()
});

0 comments on commit 68feb3d

Please sign in to comment.