Fix some sounds

This commit is contained in:
LoveEevee 2018-09-11 17:50:10 +03:00
parent 3dc40e72d3
commit 2a6a6d0524
6 changed files with 18 additions and 18 deletions

View File

@ -88,7 +88,7 @@ function Controller(selectedSong, songData, autoPlayEnabled){
if (score.fail == 0) {
vp = 'fullcombo';
_this.playSoundMeka('fullcombo', 1350);
_this.playSoundMeka('fullcombo', 1.350);
} else if (score.hp >= 50) {
vp = 'clear';
} else {

View File

@ -199,11 +199,14 @@ function Game(controller, selectedSong, songData){
if(_fadeOutStarted){
if(_musicFadeOut==0){
snd.musicGain.fadeOut(1.6)
_mainAsset.stop(1.6)
snd.musicGain.fadeIn(0, 1.7)
}
if(_ellapsedTime.ms>=_fadeOutStarted+1600){
controller.fadeOutOver()
_mainAsset.stop()
setTimeout(() => {
snd.musicGain.fadeIn()
snd.musicGain.unmute()
}, 1000)
}
_musicFadeOut++;
}
@ -224,7 +227,7 @@ function Game(controller, selectedSong, songData){
this.toggleMainMusic = function(){
if(_mainMusicPlaying){
_mainAsset.pause();
_mainAsset.stop();
_mainMusicPlaying=false;
}
else{
@ -237,10 +240,6 @@ function Game(controller, selectedSong, songData){
_fadeOutStarted=false;
}
this.pauseSound = function(soundID, stop){
_soundSystem.pauseSound(soundID, stop);
}
this.getHitcircleSpeed = function(){
return _hitcircleSpeed;
}

View File

@ -97,7 +97,7 @@ function Scoresheet(controller, score){
}
assets.sounds["results"].play()
assets.sounds["bgm_result"].playLoop(0, false, 0, 0.846625)
assets.sounds["bgm_result"].playLoop(0.1, false, 0, 0.847, 17.689)
$("#screen").load("/src/views/scoresheet.html", _this.run);

View File

@ -4,7 +4,6 @@ function SongSelect(){
var _selectedSong = {title:'', folder:'', difficulty:''};
var _preview;
var _preview_ended
var _preview_startLoad
var _diffNames={
easy:"かんたん",
normal:"ふつう",
@ -14,7 +13,7 @@ function SongSelect(){
this.startPreview = function(id, prvtime, first_open=true) {
_this.endPreview();
_preview_startLoad = +new Date
var startLoad = +new Date
_preview_ended = false
if(first_open){
snd.musicGain.fadeOut(0.4)
@ -28,21 +27,23 @@ function SongSelect(){
if(songObj.sound){
_preview = songObj.sound
_preview.gain = snd.previewGain
this.previewLoaded(prvtime)
this.previewLoaded(startLoad, prvtime, first_open)
}else{
snd.previewGain.load("/songs/" + id + "/main.mp3").then(sound => {
if(!_preview_ended){
songObj.sound = sound
_preview = sound
this.previewLoaded(prvtime)
this.previewLoaded(startLoad, prvtime, first_open)
}
})
}
};
this.previewLoaded = function(prvtime){
this.previewLoaded = function(startLoad, prvtime, first_open){
var endLoad = +new Date
var delay = Math.max(1000 - Math.min(1000, endLoad - _preview_startLoad), 300)
var difference = endLoad - startLoad
var minDelay = first_open ? 1000 : 300
var delay = minDelay - Math.min(minDelay, difference)
_preview.playLoop(delay / 1000, false, prvtime / 1000)
}
@ -142,7 +143,7 @@ function SongSelect(){
}
this.createCode = function(){
assets.sounds["bgm_songsel"].playLoop(0, false, 0, 1.4423958333333333)
assets.sounds["bgm_songsel"].playLoop(0.1, false, 0, 1.442, 3.506)
assets.sounds["song-select"].play(0.2);
var songElements = [0]

View File

@ -124,7 +124,7 @@ class Sound{
playLoop(time, absolute, seek1, seek2, until){
time = this.convertTime(time, absolute)
seek1 = seek1 || 0
seek2 = seek2 || seek1
seek2 = seek2 || 0
until = until || this.duration
this.loop = {
started: time + until - seek1,

View File

@ -2,7 +2,7 @@ function Tutorial() {
var _this = this;
this.run = function() {
assets.sounds["bgm_setsume"].playLoop(0, false, 0, 1.0540416666666668)
assets.sounds["bgm_setsume"].playLoop(0.1, false, 0, 1.054, 16.054)
$('#tutorial-end-button').click(function(){
assets.sounds["bgm_setsume"].stop();