Commit 0be9638b authored by 18손재민's avatar 18손재민

Merge remote-tracking branch 'origin/sound'

parents f5e3d5b6 b0dea69e
......@@ -207,14 +207,7 @@ socket.on('defeat', function(msg) // object player
let nicknameText = RoomData.findPlayer(msg.id).nicknameText;
let earnedStrongHopae = RoomData.findPlayer(msg.id).earnedStrongHopae;
if(WordSpace.CurrentPhase == 1)
Audio.killSound(ScenesData.gameScene, 'Phase1');
if(WordSpace.CurrentPhase == 2)
Audio.killSound(ScenesData.gameScene, 'Phase2');
if(WordSpace.CurrentPhase == 3)
Audio.killSound(ScenesData.gameScene, 'Phase3');
Audio.playSound(ScenesData.gameScene, 'defeat');
RoomData.players[msg.index] = msg;
RoomData.players[msg.index].playerImage = playerImage;
RoomData.players[msg.index].position = position;
......
......@@ -20,7 +20,6 @@ var menuScene = new Phaser.Class(
ResourceLoader.loadImage(this);
CSVParsing.loadText(this);
Audio.loadSound(this);
this.load.scenePlugin({
key: 'rexuiplugin',
url: 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/plugins/dist/rexuiplugin.min.js',
......@@ -37,7 +36,7 @@ var menuScene = new Phaser.Class(
{
ResourceLoader.loadAnimation(this);
BackGround.drawMenu(this);
Audio.playSound(this, 'login');
Audio.loopSound(this, 'login');
ScenesData.menuScene.tutorialFrame = 0;
ScenesData.menuScene.tutorialImage = UIObject.createButton(this, UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 11,
'tutorialImage', 1, 'center'), -2, -2, -2,
......@@ -662,6 +661,8 @@ var gameScene = new Phaser.Class(
ScenesData.changeScene = function(sceneKey)
{
Audio.killSound(ScenesData.menuScene, 'login');
Audio.killSound(ScenesData.gameScene, 'victory');
Audio.killSound(ScenesData.gameScene, 'defeat');
ScenesData.currentScene.scene.start(sceneKey);
Input.input = [];
Input.converted = '';
......
......@@ -218,6 +218,15 @@ function gameOver()
{
WordSpace.pauseCycle(true);
if(WordSpace.CurrentPhase == 1)
Audio.killSound(ScenesData.gameScene, 'Phase1');
if(WordSpace.CurrentPhase == 2)
Audio.killSound(ScenesData.gameScene, 'Phase2');
if(WordSpace.CurrentPhase == 3)
Audio.killSound(ScenesData.gameScene, 'Phase3');
Audio.playSound(ScenesData.gameScene, 'defeat');
socket.emit('defeated');
console.log('defeat');
}
......
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