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

함수 구조 변경, 한번 / 반복 재생 나눔

parent 9344bdc9
......@@ -6,34 +6,34 @@ Audio.loadSound = function(scene)
scene.load.audio('startGame', 'assets/sound/startGame.ogg');
}
Audio.playLogin = function(scene)
Audio.playSound = function(scene, title) // 한 번만 재생할 때 사용
{
var bgm = scene.sound.add('login');
bgm.setLoop(true);
var bgm = scene.sound.add(title);
bgm.play();
}
Audio.playStart = function(scene)
Audio.loopSound = function(scene, title) // 반복재생할 때 사용
{
var bgm = scene.sound.add('startGame');
var bgm = scene.sound.add(title);
bgm.setLoop(true);
bgm.play();
}
Audio.pauseSound = function(scene)
Audio.pauseSound = function(scene, title)
{
var bgm = scene.sound.add('BGM');
var bgm = scene.sound.add(title);
bgm.pause();
}
Audio.resumeSound = function(scene)
Audio.resumeSound = function(scene, title)
{
var bgm = scene.sound.add('BGM');
var bgm = scene.sound.add(title);
bgm = scene.sound.resume();
}
Audio.stopSound = function(scene)
Audio.stopSound = function(scene, title)
{
var bgm = scene.sound.add('login');
var bgm = scene.sound.add(title);
bgm.setLoop(false);
bgm.stop();
}
......
......@@ -18,7 +18,7 @@ var menuScene = new Phaser.Class(
create: function()
{
Audio.playLogin(this);
Audio.loopSound(this, 'login');
Input.inputField.generate(this, Input.menuSceneEnterReaction);
BackGround.drawMenu(this);
}
......@@ -48,7 +48,7 @@ var gameScene = new Phaser.Class(
{
CSVParsing.CSVParse(this);
BackGround.drawBrain(this);
Audio.playStart(this);
Audio.playSound(this, 'startGame');
WordSpace.wordPhysicsGroup = this.physics.add.group();
Input.inputField.generate(this, Input.gameSceneEnterReaction);
......
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