Commit f8e16ff0 authored by 18김재민's avatar 18김재민

함수명 명확하게 수정, 대기방 들어가면 장구소리 종료됨

parent 24fd8ba4
var Audio = Audio || {} var Audio = Audio || {}
var bgm;
Audio.loadSound = function(scene) Audio.loadSound = function(scene)
{ {
scene.load.audio('login', 'assets/sound/login.ogg'); scene.load.audio('login', 'assets/sound/login.ogg');
...@@ -8,33 +9,31 @@ Audio.loadSound = function(scene) ...@@ -8,33 +9,31 @@ Audio.loadSound = function(scene)
Audio.playSound = function(scene, title) // 한 번만 재생할 때 사용 Audio.playSound = function(scene, title) // 한 번만 재생할 때 사용
{ {
var bgm = scene.sound.add(title); bgm = scene.sound.add(title);
bgm.play(); bgm.play();
} }
Audio.loopSound = function(scene, title) // 반복재생할 때 사용 Audio.loopSound = function(scene, title) // 반복재생할 때 사용
{ {
var bgm = scene.sound.add(title); bgm = scene.sound.add(title);
bgm.setLoop(true); bgm.setLoop(true);
bgm.play(); bgm.play();
} }
Audio.pauseSound = function(scene, title) Audio.pauseSound = function(scene, title)
{ {
var bgm = scene.sound.add(title);
bgm.pause(); bgm.pause();
} }
Audio.resumeSound = function(scene, title) Audio.resumeSound = function(scene, title)
{ {
var bgm = scene.sound.add(title);
bgm = scene.sound.resume(); bgm = scene.sound.resume();
} }
Audio.stopSound = function(scene, title) Audio.killSound = function(scene, title)
{ {
var bgm = scene.sound.add(title);
bgm.setLoop(false); bgm.setLoop(false);
bgm.stop(); bgm.stop();
console.log('killSound');
} }
...@@ -18,6 +18,7 @@ socket.on('setId', function(msg) // {str, num playerNum} ...@@ -18,6 +18,7 @@ socket.on('setId', function(msg) // {str, num playerNum}
}); });
socket.on('enterRoom', function() socket.on('enterRoom', function()
{ {
Audio.killSound(ScenesData.menuScene, 'login');
game.scene.remove('menuScene'); game.scene.remove('menuScene');
game.scene.start('roomScene'); game.scene.start('roomScene');
}); });
......
...@@ -24,6 +24,7 @@ var menuScene = new Phaser.Class( ...@@ -24,6 +24,7 @@ var menuScene = new Phaser.Class(
Audio.loopSound(this, 'login'); Audio.loopSound(this, 'login');
Input.inputField.generate(this, Input.menuSceneEnterReaction); Input.inputField.generate(this, Input.menuSceneEnterReaction);
BackGround.drawMenu(this); BackGround.drawMenu(this);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment