diff --git a/public/RECOVER_鸟妈妈回家_HTML5 Canvas.fla b/public/RECOVER_鸟妈妈回家_HTML5 Canvas.fla
deleted file mode 100644
index 25740cd..0000000
Binary files a/public/RECOVER_鸟妈妈回家_HTML5 Canvas.fla and /dev/null differ
diff --git a/public/bird.js b/public/bird.js
index 09cba9c..7adee75 100644
--- a/public/bird.js
+++ b/public/bird.js
@@ -76,7 +76,13 @@ p.nominalBounds = new cjs.Rectangle(0,0,449,161);
(lib.stopDemo = function() {
this.initialize(img.stopDemo);
}).prototype = p = new cjs.Bitmap();
-p.nominalBounds = new cjs.Rectangle(0,0,161,57);
+p.nominalBounds = new cjs.Rectangle(0,0,107,42);
+
+
+(lib.suspend = function() {
+ this.initialize(img.suspend);
+}).prototype = p = new cjs.Bitmap();
+p.nominalBounds = new cjs.Rectangle(0,0,107,43);
(lib.任务完成 = function() {
@@ -156,6 +162,28 @@ if (reversed == null) { reversed = false; }
}).prototype = getMCSymbolPrototype(lib.timeBg, new cjs.Rectangle(-60,-49,120,98.9), null);
+(lib.Suspend = function(mode,startPosition,loop,reversed) {
+if (loop == null) { loop = true; }
+if (reversed == null) { reversed = false; }
+ var props = new Object();
+ props.mode = mode;
+ props.startPosition = startPosition;
+ props.labels = {};
+ props.loop = loop;
+ props.reversed = reversed;
+ cjs.MovieClip.apply(this,[props]);
+
+ // 图层_1
+ this.instance = new lib.suspend();
+ this.instance.setTransform(37,-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);
+
+
(lib.stopDemo_1 = function(mode,startPosition,loop,reversed) {
if (loop == null) { loop = true; }
if (reversed == null) { reversed = false; }
@@ -169,13 +197,13 @@ if (reversed == null) { reversed = false; }
// 图层_1
this.instance = new lib.stopDemo();
- this.instance.setTransform(-79,-28);
+ this.instance.setTransform(129,-20);
this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
this._renderFirstFrame();
-}).prototype = getMCSymbolPrototype(lib.stopDemo_1, new cjs.Rectangle(-79,-28,161,57), null);
+}).prototype = getMCSymbolPrototype(lib.stopDemo_1, new cjs.Rectangle(129,-20,107,42), null);
(lib.前景 = function(mode,startPosition,loop,reversed) {
@@ -2142,19 +2170,16 @@ if (reversed == null) { reversed = false; }
this.frame_621 = function() {
this.stop()
}
- this.frame_643 = function() {
- this.stop()
- }
// actions tween:
- this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(16).call(this.frame_16).wait(38).call(this.frame_54).wait(54).call(this.frame_108).wait(26).call(this.frame_134).wait(25).call(this.frame_159).wait(34).call(this.frame_193).wait(54).call(this.frame_247).wait(25).call(this.frame_272).wait(24).call(this.frame_296).wait(25).call(this.frame_321).wait(25).call(this.frame_346).wait(27).call(this.frame_373).wait(63).call(this.frame_436).wait(23).call(this.frame_459).wait(27).call(this.frame_486).wait(26).call(this.frame_512).wait(25).call(this.frame_537).wait(24).call(this.frame_561).wait(24).call(this.frame_585).wait(36).call(this.frame_621).wait(22).call(this.frame_643).wait(861));
+ this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(16).call(this.frame_16).wait(38).call(this.frame_54).wait(54).call(this.frame_108).wait(26).call(this.frame_134).wait(25).call(this.frame_159).wait(34).call(this.frame_193).wait(54).call(this.frame_247).wait(25).call(this.frame_272).wait(24).call(this.frame_296).wait(25).call(this.frame_321).wait(25).call(this.frame_346).wait(27).call(this.frame_373).wait(63).call(this.frame_436).wait(23).call(this.frame_459).wait(27).call(this.frame_486).wait(26).call(this.frame_512).wait(25).call(this.frame_537).wait(24).call(this.frame_561).wait(24).call(this.frame_585).wait(36).call(this.frame_621).wait(883));
// mask
this.shape = new cjs.Shape();
this.shape.graphics.f("#000000").s().p("EjxyDCfMAAAmE9MHjlAAAMAAAGE9gEh1CBEhMDH/AAAMAAAhwfMh1rAAAIABAAMg5XAAAIAAAAI4+AAg");
this.shape.setTransform(749.1,281.525);
- this.timeline.addTween(cjs.Tween.get(this.shape).to({_off:true},1500).wait(4));
+ this.timeline.addTween(cjs.Tween.get(this.shape).wait(713).to({_off:true},787).wait(4));
// score
this.instance = new lib._218d7f87fgfh("single",20);
@@ -2267,6 +2292,7 @@ lib.properties = {
{src:"images/Bitmap5.png", id:"Bitmap5"},
{src:"images/level.png", id:"level"},
{src:"images/stopDemo.png", id:"stopDemo"},
+ {src:"images/suspend.png", id:"suspend"},
{src:"images/任务完成_.png", id:"任务完成"},
{src:"images/再来一次_.png", id:"再来一次"},
{src:"images/计时_.png", id:"计时"},
diff --git a/public/images/stopDemo.png b/public/images/stopDemo.png
index 6e84c94..01308de 100644
Binary files a/public/images/stopDemo.png and b/public/images/stopDemo.png differ
diff --git a/public/images/suspend.png b/public/images/suspend.png
new file mode 100644
index 0000000..1de635b
Binary files /dev/null and b/public/images/suspend.png differ
diff --git a/public/恢复_鸟妈妈回家_HTML5 Canvas.fla b/public/恢复_鸟妈妈回家_HTML5 Canvas.fla
deleted file mode 100644
index 31e2366..0000000
Binary files a/public/恢复_鸟妈妈回家_HTML5 Canvas.fla and /dev/null differ
diff --git a/public/鸟妈妈回家_HTML5 Canvas.fla b/public/鸟妈妈回家_HTML5 Canvas.fla
index 25740cd..02b0aed 100644
Binary files a/public/鸟妈妈回家_HTML5 Canvas.fla and b/public/鸟妈妈回家_HTML5 Canvas.fla differ
diff --git a/src/classes/demo.js b/src/classes/demo.js
index 52191fa..9873908 100644
--- a/src/classes/demo.js
+++ b/src/classes/demo.js
@@ -34,6 +34,7 @@ Demo.prototype.showStopDemo = function () {
stage.removeChild(stopDemo);
location.hash = '';
location.reload();
+ isDemo = false;
},
false,
);
diff --git a/src/classes/suspend.js b/src/classes/suspend.js
new file mode 100644
index 0000000..1ba344c
--- /dev/null
+++ b/src/classes/suspend.js
@@ -0,0 +1,40 @@
+/**
+ * 暂停游戏类(暂停继续游戏)
+ * @property {object} lib 库对象
+ * @property {object} suspend 面板元素对象
+ */
+function Suspend() {
+ this.lib = library;
+
+ this.suspend = null;
+}
+
+Suspend.of = function () {
+ const instance = new Suspend();
+ instance.init();
+ return instance;
+};
+
+// 初始化
+Suspend.prototype.init = function () {
+ this.suspendGame();
+};
+
+// 暂停游戏按钮
+Suspend.prototype.suspendGame = function () {
+ const lib = this.lib;
+ const suspend = new lib.suspend();
+ suspend.x = 180;
+ suspend.y = lib.properties.height - 100;
+ this.suspend = suspend;
+ // 关闭演示模式
+ this.suspend.addEventListener(
+ 'click',
+ function () {
+ console.log('暂停游戏');
+ stage.removeChild(stopDemo);
+ },
+ false,
+ );
+ stage.addChild(suspend);
+};
diff --git a/src/custom.js b/src/custom.js
index cd3b737..b684a6e 100644
--- a/src/custom.js
+++ b/src/custom.js
@@ -8,6 +8,7 @@ const config = {
let library = null;
let state = 0; // 游戏状态 0->未开始 1->进行中 2->结束
+let isDemo = false; // 是不是演示模式
function initStage(lib) {
library = lib;
diff --git a/src/test.js b/src/test.js
index 76c51c1..54e07f0 100644
--- a/src/test.js
+++ b/src/test.js
@@ -1,6 +1,7 @@
// 判断是否在演示模式 能否直接开始游戏
function isHash() {
- if (location.hash && location.hash === 'p') {
+ if (location.hash && location.hash === '#p') {
+ isDemo = true;
Demo.of();
Count.of(countOver);
} else {
@@ -13,6 +14,7 @@ function startGame() {
var count = 0,
timer;
document.onclick = function () {
+ if (isDemo) return;
if (count < 6) {
if (timer) {
clearTimeout(timer);
@@ -30,6 +32,7 @@ function startGame() {
}
function sevenClick() {
+ isDemo = true;
Count.of(countOver);
addHash();
}
@@ -41,7 +44,7 @@ function countOver() {
// 添加hash值
function addHash() {
- location.hash = 'p';
+ location.hash = '#p';
Demo.of();
}