more audio updates

This commit is contained in:
Bui 2018-08-06 11:13:01 +01:00
parent 5eac1c3f14
commit 90e461b587
6 changed files with 27 additions and 3 deletions

View File

@ -37,7 +37,15 @@ var assets = {
'combo-500.wav',
'combo-600.wav',
'combo-700.wav',
'song-select.wav'
'song-select.wav',
'title.ogg',
'pause.wav',
'cancel.wav',
'results.wav',
'bgm_songsel.mp3',
'bgm_results.ogg'
),
songs: new Array(),

View File

@ -249,12 +249,14 @@ function Game(controller, selectedSong, songData){
this.togglePause = function(){
if(!_paused){
assets.sounds["pause"].play();
_paused=true;
_latestDate = new Date();
_this.toggleMainMusic();
}
else{
assets.sounds["cancel"].play();
_paused=false;
var currentDate = new Date();
_ellapsedTimeSincePause = _ellapsedTimeSincePause + Math.abs(currentDate.getTime() - _latestDate.getTime());

View File

@ -10,6 +10,9 @@ function loadSong(selectedSong){
this.run = function(){
assets.sounds["bgm_songsel"].pause();
assets.sounds["bgm_songsel"].currentTime = 0;
assets.sounds["start"].play();
$("#assets").append("<img id='music-bg' src='/songs/"+_selectedSong.folder+"/bg.png' />");

View File

@ -71,15 +71,23 @@ function Scoresheet(controller, score){
}
this.run = function(){
assets.sounds["results"].play();
assets.sounds["bgm_results"].volume = 1;
assets.sounds["bgm_results"].play();
_this.positionning();
_this.setResults();
$("#song-select").click(function(){
assets.sounds["bgm_results"].pause();
assets.sounds["bgm_songsel"].currentTime = 0;
controller.songSelection();
});
$("#replay").click(function(){
assets.sounds["bgm_results"].pause();
assets.sounds["bgm_songsel"].currentTime = 0;
controller.restartSong();
});

View File

@ -50,7 +50,8 @@ function SongSelect(){
}
this.createCode = function(){
assets.sounds["bgm_songsel"].play();
assets.sounds["song-select"].play();
for(var i=0; i<assets.songs.length; i++){

View File

@ -32,6 +32,8 @@ function Titlescreen(){
$("#screen").find("#title-screen").show();
$(window).resize(_this.positionning);
assets.sounds["title"].play();
}
this.goNext = function(){