Browse Source

Merge branch 'master' of dd.tall.wiki:ccsens_fe/bird-go-home

master
wally 4 years ago
parent
commit
3e5cde11a8
  1. 158
      README.md
  2. BIN
      public/RECOVER_鸟妈妈回家_HTML5 Canvas.fla
  3. 42
      public/bird.js
  4. BIN
      public/images/stopDemo.png
  5. BIN
      public/images/suspend.png
  6. BIN
      public/恢复_鸟妈妈回家_HTML5 Canvas.fla
  7. BIN
      public/鸟妈妈回家_HTML5 Canvas.fla
  8. 1
      src/classes/demo.js
  9. 40
      src/classes/suspend.js
  10. 1
      src/custom.js
  11. 7
      src/test.js

158
README.md

@ -2,7 +2,7 @@
# 运行步骤
1. git clone https://dd.tall.wiki/gitea/ccsens_fe/bird-go-home.git
2. 全局安装gulp npm i gulp -g
2. 全局安装gulp npm i gulp -g
3. npm i 或者 yarn
4. 运行gulp
5. 运行vscode的live server
@ -43,72 +43,96 @@ tree -I "node_modules|package-lock.json|yarn.lock"
```bash
.
├── README.md
├── dist
│   ├── bird.js
│   ├── images
│   │   ├── Bitmap1.png
│   │   ├── Bitmap2.png
│   │   ├── Bitmap3.png
│   │   ├── Bitmap4.png
│   │   ├── Bitmap5.png
│   │   ├── _preloader.gif
│   │   ├── level.png
│   │   ├── 任务完成_.png
│   │   ├── 倒计时_.png
│   │   ├── 树林前景_.png
│   │   ├── 计时_.png
│   │   └── 返回按钮_.png
│   ├── index.html
│   ├── libs
│   │   └── 1.0.0
│   │   └── createjs.min.js
│   ├── main.js
│   └── sounds
│   ├── amazing.mp3
│   ├── bgmMusic.mp3
│   ├── excitationMusic.mp3
│   └── unbelievable.mp3
├── gulpfile.js
├── package.json
├── public
│   ├── bird.html
│   ├── bird.js
│   ├── images
│   │   ├── Bitmap1.png
│   │   ├── Bitmap2.png
│   │   ├── Bitmap3.png
│   │   ├── Bitmap4.png
│   │   ├── Bitmap5.png
│   │   ├── _preloader.gif
│   │   ├── level.png
│   │   ├── 任务完成_.png
│   │   ├── 倒计时_.png
│   │   ├── 树林前景_.png
│   │   ├── 计时_.png
│   │   └── 返回按钮_.png
│   ├── index.html
│   ├── libs
│   │   └── 1.0.0
│   │   └── createjs.min.js
│   ├── sounds
│   │   ├── amazing.mp3
│   │   ├── bgmMusic.mp3
│   │   ├── excitationMusic.mp3
│   │   └── unbelievable.mp3
│   └── 鸟妈妈回家_HTML5 Canvas.fla
└── src
├── classes
│   ├── back.js
│   ├── count.js
│   ├── end.js
│   ├── level.js
│   ├── main.js
│   ├── sound.js
│   └── time.js
├── custom.js
└── index.js
│ .gitignore
│ .prettierrc
│ .svrxrc.js
│ dist.zip
│ gulpfile.js
│ package-lock.json
│ package.json
│ README.md
├─dist
│ │ bird.js
│ │ index.html
│ │ main.js
│ │
│ ├─images
│ │ Bitmap1.png
│ │ Bitmap2.png
│ │ Bitmap3.png
│ │ Bitmap4.png
│ │ Bitmap5.png
│ │ level.png
│ │ stopDemo.png
│ │ suspend.png
│ │ _preloader.gif
│ │ 任务完成_.png
│ │ 倒计时_.png
│ │ 再来一次_.png
│ │ 树林前景_.png
│ │ 计时_.png
│ │ 返回按钮_.png
│ │
│ ├─libs
│ │ └─1.0.0
│ │ createjs.min.js
│ │
│ └─sounds
│ amazing.mp3
│ bgmMusic.mp3
│ excitationMusic.mp3
│ unbelievable.mp3
├─public
│ │ bird.html
│ │ bird.js
│ │ index.html
│ │ 鸟妈妈回家_HTML5 Canvas.fla
│ │
│ ├─images
│ │ Bitmap1.png
│ │ Bitmap2.png
│ │ Bitmap3.png
│ │ Bitmap4.png
│ │ Bitmap5.png
│ │ level.png
│ │ stopDemo.png
│ │ suspend.png
│ │ _preloader.gif
│ │ 任务完成_.png
│ │ 倒计时_.png
│ │ 再来一次_.png
│ │ 树林前景_.png
│ │ 计时_.png
│ │ 返回按钮_.png
│ │
│ ├─libs
│ │ └─1.0.0
│ │ createjs.min.js
│ │
│ └─sounds
│ amazing.mp3
│ bgmMusic.mp3
│ excitationMusic.mp3
│ unbelievable.mp3
└─src
│ custom.js
│ index.js
│ test.js
└─classes
again.js
back.js
count.js
demo.js
end.js
level.js
main.js
sound.js
suspend.js
time.js
```
| 文件 | 说明 | 备注 |

BIN
public/RECOVER_鸟妈妈回家_HTML5 Canvas.fla

Binary file not shown.

42
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:"计时"},

BIN
public/images/stopDemo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/images/suspend.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/恢复_鸟妈妈回家_HTML5 Canvas.fla

Binary file not shown.

BIN
public/鸟妈妈回家_HTML5 Canvas.fla

Binary file not shown.

1
src/classes/demo.js

@ -34,6 +34,7 @@ Demo.prototype.showStopDemo = function () {
stage.removeChild(stopDemo);
location.hash = '';
location.reload();
isDemo = false;
},
false,
);

40
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);
};

1
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;

7
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();
}

Loading…
Cancel
Save