diff --git a/public/bird.js b/public/bird.js index e69af22..79f05fd 100644 --- a/public/bird.js +++ b/public/bird.js @@ -175,13 +175,13 @@ if (reversed == null) { reversed = false; } // 图层_1 this.instance = new lib.suspend(); - this.instance.setTransform(37,-21); + this.instance.setTransform(138,-21); this.timeline.addTween(cjs.Tween.get(this.instance).wait(1)); this._renderFirstFrame(); -}).prototype = getMCSymbolPrototype(lib.Suspend, new cjs.Rectangle(37,-21,107,43), null); +}).prototype = getMCSymbolPrototype(lib.Suspend, new cjs.Rectangle(138,-21,107,43), null); (lib.stopDemo_1 = function(mode,startPosition,loop,reversed) { diff --git a/public/images/suspend.png b/public/images/suspend.png index 1de635b..d6b0207 100644 Binary files a/public/images/suspend.png and b/public/images/suspend.png differ diff --git a/public/sounds/bgmMusic.mp3 b/public/sounds/bgmMusic.mp3 index 0204957..9fcef76 100644 Binary files a/public/sounds/bgmMusic.mp3 and b/public/sounds/bgmMusic.mp3 differ diff --git a/public/鸟妈妈回家_HTML5 Canvas.fla b/public/鸟妈妈回家_HTML5 Canvas.fla index 2a0ddc6..0bc61cb 100644 Binary files a/public/鸟妈妈回家_HTML5 Canvas.fla and b/public/鸟妈妈回家_HTML5 Canvas.fla differ diff --git a/src/classes/sound.js b/src/classes/sound.js index e078bdf..6ecd3e9 100644 --- a/src/classes/sound.js +++ b/src/classes/sound.js @@ -14,10 +14,10 @@ Sound.of = function () { Sound.prototype.init = function () { createjs.Sound.alternateExtensions = ['mp3']; const sounds = [ - { src: 'sounds/bgmMusic.mp3', id: 'bgm' }, - { src: 'sounds/excitationMusic.mp3', id: 'excitation' }, - { src: 'sounds/amazing.mp3', id: 'amazing' }, - { src: 'sounds/unbelievable.mp3', id: 'unbelievable' }, + { src: 'public/sounds/bgmMusic.mp3', id: 'bgm' }, + { src: 'public/sounds/excitationMusic.mp3', id: 'excitation' }, + { src: 'public/sounds/amazing.mp3', id: 'amazing' }, + { src: 'public/sounds/unbelievable.mp3', id: 'unbelievable' }, ]; createjs.Sound.addEventListener('fileload', function (event) { this.music[event.id] = createjs.Sound.createInstance(event.id); diff --git a/src/custom.js b/src/custom.js index f91982c..bafd2dc 100644 --- a/src/custom.js +++ b/src/custom.js @@ -19,7 +19,7 @@ function initStage(lib) { window.main = Main.of(gameOver); // 初始化鸟等 window.timeInstance = Time.of(gameOver); // 初始化游戏时间 - // window.soundInstance = Sound.of(); // 初始化音频 + Sound.of(); // 初始化音频 Level.of(2); // 游戏难度级别 Back.of(); // 返回按钮 isHash(); @@ -31,7 +31,7 @@ function gameOver() { const times = main.times; const score = parseInt((config.total / config.times) * times); setTimeout(() => { - End.of(score); + End.of(score || 0); finishMessage(score, times); }, 2000); } diff --git a/src/message.js b/src/message.js index f548fe5..c6df1df 100644 --- a/src/message.js +++ b/src/message.js @@ -21,6 +21,10 @@ window.addEventListener( } function startGame(data) { + if (state === 2) { + location.reload(); + return; + } const { count, game, status, param } = data; config.count = count.duration; config.duration = game.duration; @@ -28,7 +32,6 @@ window.addEventListener( config.times = game.totalTimes; config.level = game.level; config.config = game.config; - state = status; window.timeInstance.setDuration(game.duration); // 开始倒计时 @@ -36,10 +39,11 @@ window.addEventListener( } function playGame(data) { + if (state !== 1) return; const { score, times, status, param } = data; - state = status; config.currentScore = score; config.currentTimes = times; + state = status; if (config.config.directions[times - 1] === param.direction) { main.play(); } else { @@ -48,12 +52,14 @@ window.addEventListener( } function pauseGame(data) { + if (state !== 1) return; state = data.status; Suspend.of(); window.timeInstance.pause(); } function continueGame(data) { + if (state !== 3) return; state = data.status; window.timeInstance.start(); } @@ -63,6 +69,8 @@ window.addEventListener( state = status; config.total = score; config.times = times; + End.of(score || 0); + window.timeInstance.setDuration(0); } }, false,