diff --git a/src/js/assets.js b/src/js/assets.js index 5dd98b5..10ff3ff 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -43,6 +43,8 @@ var assets = { 'cancel.wav', 'results.wav', + 'note_don.ogg', + 'note_ka.ogg', 'bgm_songsel.mp3', 'bgm_results.ogg' diff --git a/src/js/controller.js b/src/js/controller.js index 6d81c6f..c859487 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -22,11 +22,16 @@ function Controller(selectedSong, songData){ this.loadUIEvents = function(){ $("#song-selection-butt").click(function(){ + assets.sounds["don"].play(); _this.songSelection(); }); $("#restart-butt").click(function(){ + assets.sounds["don"].play(); _this.restartSong(); }); + $("#continue-butt").click(function(){ + _this.togglePauseMenu(); + }); } this.startMainLoop = function(){ @@ -40,6 +45,7 @@ function Controller(selectedSong, songData){ _view.refresh(); } else if(ms>=0 && !started){ //when music shall starts + assets.sounds["main-music"].volume = 0.7; assets.sounds["main-music"].play(); started=true; } diff --git a/src/js/keyboard.js b/src/js/keyboard.js index 398f6b9..cac5bc5 100644 --- a/src/js/keyboard.js +++ b/src/js/keyboard.js @@ -24,20 +24,20 @@ function Keyboard(controller){ this.checkGameKeys = function(){ if(_keys[86] && !_this.isWaitingForKeyup(86, "sound")){//if press v, play 'don' sound - controller.playSound('don'); + controller.playSound('note_don'); _this.waitForKeyup(86, "sound"); } if(_keys[66] && !_this.isWaitingForKeyup(66, "sound")){//if press b, play 'don' sound - controller.playSound('don'); + controller.playSound('note_don'); _this.waitForKeyup(66, "sound"); } if(_keys[67] && !_this.isWaitingForKeyup(67, "sound")){//if press c, play 'ka' sound - controller.playSound('ka'); + controller.playSound('note_ka'); _this.waitForKeyup(67, "sound"); } if(_keys[78] && !_this.isWaitingForKeyup(78, "sound")){//if press n, play 'ka' sound - controller.playSound('ka'); + controller.playSound('note_ka'); _this.waitForKeyup(78, "sound"); } @@ -50,8 +50,8 @@ function Keyboard(controller){ controller.pauseSound("main-music", true); controller.songSelection(); } - if(_keys[27] && !_this.isWaitingForKeyup(27, "menu")){//if press escape key, pause the game - _this.waitForKeyup(27, "menu"); + if(_keys[81] && !_this.isWaitingForKeyup(81, "menu")){//if press p key, pause the game + _this.waitForKeyup(81, "menu"); controller.togglePauseMenu(); } diff --git a/src/js/scoresheet.js b/src/js/scoresheet.js index c2ebcda..c6712e6 100644 --- a/src/js/scoresheet.js +++ b/src/js/scoresheet.js @@ -71,6 +71,7 @@ function Scoresheet(controller, score){ } this.run = function(){ + assets.sounds["results"].volume = 0.6; assets.sounds["results"].play(); assets.sounds["bgm_results"].volume = 1; @@ -80,12 +81,14 @@ function Scoresheet(controller, score){ _this.setResults(); $("#song-select").click(function(){ + assets.sounds["don"].play(); assets.sounds["bgm_results"].pause(); assets.sounds["bgm_songsel"].currentTime = 0; controller.songSelection(); }); $("#replay").click(function(){ + assets.sounds["don"].play(); assets.sounds["bgm_results"].pause(); assets.sounds["bgm_songsel"].currentTime = 0; controller.restartSong(); diff --git a/src/js/songselect.js b/src/js/songselect.js index 36d1475..9420656 100644 --- a/src/js/songselect.js +++ b/src/js/songselect.js @@ -15,7 +15,8 @@ function SongSelect(){ $("#song-container").show(); $(".difficulty").click(function(e){ - + assets.sounds["don"].play(); + clearInterval(menuLoop); var difficultyElement = (e.target.className=="stars" || e.target.className=="diffname") ? e.target.parentElement : e.target; _selectedSong.difficulty = difficultyElement.classList[1]+'.osu'; @@ -37,8 +38,11 @@ function SongSelect(){ $(this).css("background", "rgba(255, 220, 47, 0.90)"); }); - $(".song:not(.opened)").click(function(){ - assets.sounds["ka"].play(); + $(".song:not(.opened)").click(function(e){ + if (!$(e.target).parents('.difficulties').length) { + assets.sounds["ka"].play(); + }; + $(".difficulty").hide(); $(".opened").removeClass("opened", 300); $(this).addClass("opened", 300, "linear", function(){ diff --git a/src/views/game.html b/src/views/game.html index e749402..5667a36 100644 --- a/src/views/game.html +++ b/src/views/game.html @@ -4,6 +4,7 @@