Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
b9593434
Commit
b9593434
authored
Apr 03, 2020
by
王梦佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
娃娃机
parent
140f0a58
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
2181 additions
and
8 deletions
+2181
-8
doll-machine.json
dist/customs/doll-machine.json
+235
-0
food-fell.json
dist/customs/food-fell.json
+1
-1
app.js
src/custom/doll-machine/debug/app.js
+73
-0
index.html
src/custom/doll-machine/debug/index.html
+45
-0
load-assets.js
src/custom/doll-machine/debug/load-assets.js
+52
-0
main.js
src/custom/doll-machine/debug/main.js
+579
-0
main.js.map
src/custom/doll-machine/debug/main.js.map
+1
-0
props.js
src/custom/doll-machine/debug/props.js
+7
-0
meta.json
src/custom/doll-machine/meta.json
+234
-0
GameView.ts
src/custom/doll-machine/src/game/GameView.ts
+422
-0
GameWrapper.ts
src/custom/doll-machine/src/game/GameWrapper.ts
+65
-0
Goods.ts
src/custom/doll-machine/src/game/Goods.ts
+112
-0
Zhuazi.ts
src/custom/doll-machine/src/game/Zhuazi.ts
+164
-0
backBox.ts
src/custom/doll-machine/src/game/backBox.ts
+53
-0
frontBox.ts
src/custom/doll-machine/src/game/frontBox.ts
+74
-0
object-pool-init.ts
src/custom/doll-machine/src/game/object-pool-init.ts
+14
-0
utils.ts
src/custom/doll-machine/src/game/utils.ts
+20
-0
index.ts
src/custom/doll-machine/src/index.ts
+14
-0
props.ts
src/custom/doll-machine/src/props.ts
+15
-0
main.js
src/custom/food-fell/debug/main.js
+0
-6
main.js.map
src/custom/food-fell/debug/main.js.map
+1
-1
No files found.
dist/customs/doll-machine.json
0 → 100644
View file @
b9593434
{
"name"
:
"口红机"
,
"desc"
:
"口红机模块"
,
"props"
:
{
"frontmargin"
:
{
"alias"
:
"前排娃娃的间距"
,
"type"
:
"number"
,
"default"
:
50
},
"backmargin"
:
{
"alias"
:
"后排娃娃的间距"
,
"type"
:
"number"
,
"default"
:
50
},
"moveSpeed"
:
{
"alias"
:
"娃娃移动的速度"
,
"type"
:
"number"
,
"default"
:
3
},
"bashouMoveDist"
:
{
"alias"
:
"爪子整体左右移动的范围"
,
"type"
:
"number"
,
"default"
:
200
},
"ganMoveEndY"
:
{
"alias"
:
"杆子最后需要移动到的y值位置"
,
"type"
:
"number"
,
"default"
:
700
},
"leftRotation"
:
{
"alias"
:
"左边爪子旋转角度"
,
"type"
:
"number"
,
"default"
:
30
},
"rightRotation"
:
{
"alias"
:
"右边爪子旋转角度"
,
"type"
:
"number"
,
"default"
:
-30
},
"playerPositionY"
:
{
"alias"
:
"玩家Y轴位置"
,
"type"
:
"number"
,
"default"
:
900
},
"rainScore"
:
{
"alias"
:
"接中雨滴获得分数"
,
"type"
:
"number"
,
"default"
:
1
},
"stoneScore"
:
{
"alias"
:
"接中石块获得分数"
,
"type"
:
"number"
,
"default"
:
-1
},
"speed"
:
{
"alias"
:
"道具掉落初始速度"
,
"type"
:
"number"
,
"default"
:
10
},
"maxSpeed"
:
{
"alias"
:
"道具掉落速度上限"
,
"type"
:
"number"
,
"default"
:
3
},
"gameOverCondition"
:
{
"alias"
:
"游戏结束条件(1:接到炸弹死亡,2:分数负数或接到炸弹死亡)"
,
"type"
:
"number"
,
"default"
:
1
}
},
"assets"
:
[
{
"name"
:
"玩家icon"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/50a7212a113175fa18c866b005d98f07c558dc77.png"
,
"uuid"
:
"66f23d13-82a5-4cec-9496-301ec240d087"
,
"ext"
:
".png"
},
{
"name"
:
"雨滴"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/8564c8c9be3aead71b05a0bab8d7d07ac3f778a1.png"
,
"uuid"
:
"264a6192-d7bf-45e8-8f15-6ba2c439a532"
,
"ext"
:
".png"
},
{
"name"
:
"炸弹"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/171e92283cd13c013ee1b76d28d252ff08815d47.png"
,
"uuid"
:
"eb88b42d-e151-4c1b-94b9-7c16f7bfac29"
,
"ext"
:
".png"
},
{
"name"
:
"游戏背景"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/d1f3f60775abfcbd7fdfb3ce525c18977286cd80.png"
,
"uuid"
:
": fe77919b-d5d2-464e-8cbe-d671c82d110c"
,
"ext"
:
".png"
},
{
"name"
:
"草泥马盒"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/cddd0a59964e023ed7c8d77a8f1ad6b90c25d3af.png"
,
"uuid"
:
"34b596f3-9a17-410f-a6b6-c39b91c7b123"
,
"ext"
:
".png"
},
{
"name"
:
"狗盒"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/fd47ea43eb4884ebb8f0bcd095083062871e4f90.png"
,
"uuid"
:
"f78f6bd0-93fd-4965-b18b-32a8e6cd4184"
,
"ext"
:
".png"
},
{
"name"
:
"猫盒"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/596e89d60f5714e311bdc35171b19097efc54fb5.png"
,
"uuid"
:
"8bb254c4-cf2a-47cb-824e-a62ba153518b"
,
"ext"
:
".png"
},
{
"name"
:
"前传输带"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/7bccbc67b3f896176bed7d21c5f4d4307c3919be.png"
,
"uuid"
:
"06bd03a4-43c3-49bb-94c5-6ef365f70291"
,
"ext"
:
".png"
},
{
"name"
:
"后传输带"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/df9b718f80747a1e21349d2b9ac35d5e19a61dad.png"
,
"uuid"
:
"aa0c6ebc-164f-4767-90ca-a79be4316365"
,
"ext"
:
".png"
},
{
"name"
:
"把手杆子"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5a9e4ba7ca6701eae85b6d6dcb0612ecb9a3eff9.png"
,
"uuid"
:
"3ecea516-ca65-4ac2-9b93-08495a52d7d2"
,
"ext"
:
".png"
},
{
"name"
:
"把手"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/71255a6f3cdf9f66d53589e46d72fcd20fef468d.png"
,
"uuid"
:
"d918e46f-c7f8-4ad0-8039-08c9c66b4ca6"
,
"ext"
:
".png"
},
{
"name"
:
"伸缩杆"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/a9cf8b147c52b7d4247e80e90e098f787808bfa9.png"
,
"uuid"
:
"b0146aee-5741-470c-b0fc-bf00a4aca5f6"
,
"ext"
:
".png"
},
{
"name"
:
"左爪"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/1e8634fd94bda455d11956c2847d3823e80701d3.png"
,
"uuid"
:
"d8e399ff-691f-439a-9ce4-4867514e617d"
,
"ext"
:
".png"
},
{
"name"
:
"右爪"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/4bfc510e0d1fa1db77f5effa187294af38b74ff6.png"
,
"uuid"
:
"0df49f61-0281-4647-a55f-437b71b352e6"
,
"ext"
:
".png"
},
{
"name"
:
"连接点"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/39f39234631f739e70e9ab8b713284379f4016fb.png"
,
"uuid"
:
"00ff944e-d038-4974-97fc-1e481af3a949"
,
"ext"
:
".png"
},
{
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga"
,
"uuid"
:
"b521bf94-20e1-44dd-8eca-d24996cbaeae"
,
"ext"
:
".svga"
},
{
"name"
:
"炸弹svga"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga"
,
"uuid"
:
"322edf39-805b-4e84-9d07-5573dfeebc0e"
,
"ext"
:
".svga"
},
{
"name"
:
"玩家"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga"
,
"uuid"
:
"71d8dcbc-3931-471a-b585-b3ae01b25aa6"
,
"ext"
:
".svga"
}
],
"events"
:
{
"in"
:
{
"food-fell-reset"
:
{
"alias"
:
"重置"
,
"data"
:
{
"goodsProbability"
:
"[0.2,0.5,0.3]道具概率(雨滴、石头、炸弹),所有概率相加为1"
,
"countDown"
:
"倒计时(s)"
,
"acceleratedSpeed"
:
"道具掉落加速度(单位:每秒)"
}
},
"food-fell-start"
:
{
"alias"
:
"开始"
},
"food-fell-revive"
:
{
"alias"
:
"复活"
},
"food-fell-pause"
:
{
"alias"
:
"暂停"
},
"food-fell-resume"
:
{
"alias"
:
"恢复"
},
"food-fell-clear"
:
{
"alias"
:
"清空,通过reset事件恢复"
}
},
"out"
:
{
"food-fell-score-update"
:
{
"alias"
:
"分数更新"
,
"data"
:
{
"score"
:
"分数"
}
},
"food-fell-time-update"
:
{
"alias"
:
"倒计时更新"
,
"data"
:
{
"time"
:
"剩余时间"
}
},
"food-fell-game-over"
:
{
"alias"
:
"游戏结束"
,
"data"
:
{
"score"
:
"分数"
,
"reason"
:
"结束原因(1:时间到了,2:玩家死亡)"
}
},
"doll-mac-getprize"
:
{
"alias"
:
"中奖"
,
"data"
:
null
}
}
},
"id"
:
"doll-machine"
,
"code"
:
"(function (global, factory) {
\n\t
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
\n\t
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
\n\t
(global = global || self, global['doll-machine'] = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\n\t
function prepareProps() {
\n\t
var metaProps = getProps();
\n\t
engine.injectProp(props, metaProps);
\n\t
}
\n\t
function injectProps(p) {
\n\t
engine.injectProp(props, p);
\n\t
}
\n\t
//# sourceMappingURL=props.js.map
\n\n\t
function getTexture(uuid) {
\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\n\t
}
\n\t
function getTextureByName(name) {
\n\t
return getTexture(engine.getAssetByName(name).uuid);
\n\t
}
\n\t
//# sourceMappingURL=utils.js.map
\n\n\t
var Goods = (function (_super) {
\n\t
tslib.__extends(Goods, _super);
\n\t
function Goods() {
\n\t
var _this = _super.call(this) || this;
\n\t
var body;
\n\t
body = _this._body = new engine.Rect();
\n\t
var box1 = new engine.Sprite(getTextureByName(
\"
草泥马盒
\"
));
\n\t
box1[
\"
npcType
\"
] =
\"
box1
\"
;
\n\t
var box2 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
box2[
\"
npcType
\"
] =
\"
box2
\"
;
\n\t
var box3 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
box3[
\"
npcType
\"
] =
\"
box3
\"
;
\n\t
box1.visible = false;
\n\t
box2.visible = false;
\n\t
box3.visible = false;
\n\t
body.addChild(box1);
\n\t
body.addChild(box2);
\n\t
body.addChild(box3);
\n\t
_this.addChild(body);
\n\t
body.width = 0.0001;
\n\t
body.height = 0.0001;
\n\t
body.mouseEnabled = false;
\n\t
return _this;
\n\t
}
\n\t
Goods.prototype.getRandomNumberByRange = function (start, end) {
\n\t
return Math.floor(Math.random() * (end - start) + start);
\n\t
};
\n\t
Goods.prototype.reset = function () {
\n\t
this.visible = true;
\n\t
this.y = 200;
\n\t
this.x = 0;
\n\t
this.rotation = 0;
\n\t
var random = Math.random();
\n\t
if (random < 0.3) {
\n\t
this.showNpc(
\"
box1
\"
);
\n\t
}
\n\t
else if (random < 0.6) {
\n\t
this.showNpc(
\"
box2
\"
);
\n\t
}
\n\t
else {
\n\t
this.showNpc(
\"
box3
\"
);
\n\t
}
\n\t
};
\n\t
Goods.prototype.showNpc = function (type) {
\n\t
for (var i = 0; i < this._body.children.length; i++) {
\n\t
this._body.children[i].visible = false;
\n\t
this._body.children[i].mouseEnabled = false;
\n\t
}
\n\t
for (var i = 0; i < this._body.children.length; i++) {
\n\t
if (this._body.children[i][
\"
npcType
\"
] == type) {
\n\t
this[
\"
npcType
\"
] = type;
\n\t
console.log(type);
\n\t
this._body.children[i].visible = true;
\n\t
this._body.children[i].mouseEnabled = false;
\n\t
}
\n\t
}
\n\t
};
\n\t
Object.defineProperty(Goods.prototype,
\"
anchorOffsetY
\"
, {
\n\t
set: function (v) {
\n\t
this._body.y = v;
\n\t
},
\n\t
enumerable: true,
\n\t
configurable: true
\n\t
});
\n\t
return Goods;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=Goods.js.map
\n\n\t
var ObjectPool = engine.ObjectPool;
\n\t
var PoolName = 'goods';
\n\t
ObjectPool.registerPool(PoolName, function () {
\n\t
return new Goods();
\n\t
}, function (item, data) {
\n\t
item.reset();
\n\t
});
\n\t
//# sourceMappingURL=object-pool-init.js.map
\n\n\t
var FrontBoxs = (function (_super) {
\n\t
tslib.__extends(FrontBoxs, _super);
\n\t
function FrontBoxs() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.frontBoxs = [];
\n\t
return _this;
\n\t
}
\n\t
FrontBoxs.prototype.setup = function () {
\n\t
var initX, initY = 0;
\n\t
this.box1 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
this.box1[
\"
npcType
\"
] =
\"
box1
\"
;
\n\t
initX = this.box1.x = 435;
\n\t
initY = this.box1.y = 734;
\n\t
this.box2 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box2[
\"
npcType
\"
] =
\"
box2
\"
;
\n\t
this.box3 = new engine.Sprite(getTextureByName(
\"
草泥马盒
\"
));
\n\t
this.box3[
\"
npcType
\"
] =
\"
box3
\"
;
\n\t
this.box4 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
this.box4[
\"
npcType
\"
] =
\"
box4
\"
;
\n\t
this.box5 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box5[
\"
npcType
\"
] =
\"
box5
\"
;
\n\t
this.frontBoxs = [this.box1, this.box2, this.box3, this.box4];
\n\t
for (var i = 0; i < this.frontBoxs.length; i++) {
\n\t
if (i == 0) {
\n\t
this.frontBoxs[i].x = initX;
\n\t
}
\n\t
else {
\n\t
this.frontBoxs[i].x = this.frontBoxs[i - 1].x - this.box1.width - props.frontmargin;
\n\t
}
\n\t
this.frontBoxs[i].y = initY;
\n\t
this.addChild(this.frontBoxs[i]);
\n\t
}
\n\t
this.addEventListener(engine.Event.ENTER_FRAME, this.frameMove, this);
\n\t
};
\n\t
FrontBoxs.prototype.frameMove = function () {
\n\t
var _this = this;
\n\t
this.frontBoxs.forEach(function (item, index) {
\n\t
item.x += props.moveSpeed;
\n\t
if (item.x <= 0 && !item.visible) {
\n\t
item.visible = true;
\n\t
}
\n\t
if (item.x >= 750) {
\n\t
var lastitem = _this.frontBoxs.shift();
\n\t
lastitem.x = _this.frontBoxs[_this.frontBoxs.length - 1].x - _this.box1.width - props.frontmargin;
\n\t
if (!_this.GameView.getMoveX() && item.x <= 0) {
\n\t
_this.GameView.setMoveX((370 - item.x - 13) / props.moveSpeed, item);
\n\t
_this.hideBox = item;
\n\t
}
\n\t
_this.frontBoxs.push(lastitem);
\n\t
}
\n\t
});
\n\t
};
\n\t
FrontBoxs.prototype.stop = function () {
\n\t
};
\n\t
FrontBoxs.prototype.showHidePrizeBox = function (isshow) {
\n\t
this.hideBox.visible = isshow;
\n\t
};
\n\t
return FrontBoxs;
\n\t
}(engine.Container));
\n\n\t
var BackBoxs = (function (_super) {
\n\t
tslib.__extends(BackBoxs, _super);
\n\t
function BackBoxs() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.backBoxs = [];
\n\t
return _this;
\n\t
}
\n\t
BackBoxs.prototype.setup = function () {
\n\t
var initX, initY = 0;
\n\t
this.box1 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
initX = this.box1.x = 188;
\n\t
initY = this.box1.y = 706;
\n\t
this.box2 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box3 = new engine.Sprite(getTextureByName(
\"
草泥马盒
\"
));
\n\t
this.box4 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
this.box5 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.backBoxs = [this.box1, this.box2, this.box3, this.box4, this.box5];
\n\t
for (var i = 0; i < this.backBoxs.length; i++) {
\n\t
this.backBoxs[i].scaleX = 0.5;
\n\t
this.backBoxs[i].scaleY = 0.5;
\n\t
if (i == 0) {
\n\t
this.backBoxs[i].x = initX;
\n\t
}
\n\t
else {
\n\t
this.backBoxs[i].x = this.backBoxs[i - 1].x + this.backBoxs[i].width + props.backmargin;
\n\t
}
\n\t
this.backBoxs[i].y = initY;
\n\t
this.addChild(this.backBoxs[i]);
\n\t
}
\n\t
this.addEventListener(engine.Event.ENTER_FRAME, this.frameMove, this);
\n\t
};
\n\t
BackBoxs.prototype.frameMove = function () {
\n\t
var _this = this;
\n\t
this.backBoxs.forEach(function (item) {
\n\t
item.x -= props.moveSpeed;
\n\t
if (item.x <= 0) {
\n\t
var lastitem = _this.backBoxs.shift();
\n\t
lastitem.x = _this.backBoxs[_this.backBoxs.length - 1].x + item.width + props.backmargin;
\n\t
_this.backBoxs.push(lastitem);
\n\t
}
\n\t
});
\n\t
};
\n\t
return BackBoxs;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=backBox.js.map
\n\n\t
var Zhuazi = (function (_super) {
\n\t
tslib.__extends(Zhuazi, _super);
\n\t
function Zhuazi() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.moveArr = [];
\n\t
_this.prizeBoxs = [];
\n\t
return _this;
\n\t
}
\n\t
Zhuazi.prototype.setup = function () {
\n\t
this.ganNode = new engine.Container();
\n\t
this.moveNode = new engine.Container();
\n\t
this.ganNode.x = 280;
\n\t
this.ganNode.y = 425;
\n\t
this.bashouGan = new engine.Sprite(getTextureByName(
\"
把手杆子
\"
));
\n\t
this.bashouGan.x = 60;
\n\t
this.bashouGan.y = 342;
\n\t
this.bashou = new engine.Sprite(getTextureByName(
\"
把手
\"
));
\n\t
this.bashou.x = 0;
\n\t
this.bashou.y = 320;
\n\t
this.ganzi = new engine.Sprite(getTextureByName(
\"
伸缩杆
\"
));
\n\t
this.ganzi.x = 97;
\n\t
this.ganzi.y = 382;
\n\t
this.connect = new engine.Sprite(getTextureByName(
\"
连接点
\"
));
\n\t
this.connect.x = 20;
\n\t
this.connect.y = 0;
\n\t
this.left_zhuazi = new engine.Sprite(getTextureByName(
\"
左爪
\"
));
\n\t
this.left_zhuazi.x = 0;
\n\t
this.left_zhuazi.y = 60;
\n\t
this.left_zhuazi.anchorX = this.left_zhuazi.width;
\n\t
this.left_zhuazi.anchorY = 0;
\n\t
this.left_zhuazi.rotation = 30;
\n\t
this.right_zhuazi = new engine.Sprite(getTextureByName(
\"
右爪
\"
));
\n\t
this.right_zhuazi.x = 83;
\n\t
this.right_zhuazi.y = 60;
\n\t
this.right_zhuazi.rotation = -30;
\n\t
this.ganNode.addChild(this.left_zhuazi);
\n\t
this.ganNode.addChild(this.right_zhuazi);
\n\t
this.ganNode.addChild(this.connect);
\n\t
this.ganNode.x = 30;
\n\t
this.zhuaziY = this.ganNode.y;
\n\t
this.moveNode.addChild(this.ganzi);
\n\t
this.moveNode.addChild(this.ganNode);
\n\t
this.moveNode.addChild(this.bashou);
\n\t
this.moveNode.x = 262;
\n\t
this.addChild(this.bashouGan);
\n\t
this.addChild(this.moveNode);
\n\t
this.createPrizeBox();
\n\t
};
\n\t
Zhuazi.prototype.createPrizeBox = function () {
\n\t
var _this = this;
\n\t
this.box1 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
this.box1[
\"
npcType
\"
] =
\"
box1
\"
;
\n\t
this.box2 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box2[
\"
npcType
\"
] =
\"
box2
\"
;
\n\t
this.box3 = new engine.Sprite(getTextureByName(
\"
草泥马盒
\"
));
\n\t
this.box3[
\"
npcType
\"
] =
\"
box3
\"
;
\n\t
this.box4 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
this.box4[
\"
npcType
\"
] =
\"
box4
\"
;
\n\t
this.box5 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box5[
\"
npcType
\"
] =
\"
box5
\"
;
\n\t
this.prizeBoxs = [this.box1, this.box2, this.box3, this.box4, this.box5];
\n\t
this.prizeBoxs.forEach(function (item) {
\n\t
_this.ganNode.addChild(item);
\n\t
item.visible = false;
\n\t
item.x = -15;
\n\t
item.y = 48;
\n\t
});
\n\t
};
\n\t
Zhuazi.prototype.showPrizeBox = function () {
\n\t
var _this = this;
\n\t
this.prizeBoxs.forEach(function (item) {
\n\t
console.log(_this.GameView.getBox()['npcType']);
\n\t
if (item['npcType'] === _this.GameView.getBox()['npcType']) {
\n\t
item.visible = true;
\n\t
_this.itemShow = item;
\n\t
}
\n\t
else {
\n\t
item.visible = false;
\n\t
}
\n\t
});
\n\t
};
\n\t
Zhuazi.prototype.move = function () {
\n\t
var _this = this;
\n\t
var rndist = Math.random();
\n\t
var halfWidth = this.bashou.width / 2;
\n\t
var randomX = rndist * (rndist > 0.5 ? 1 : -1) * props.bashouMoveDist;
\n\t
console.log(randomX);
\n\t
engine.Tween.get(this.moveNode).to({ x: 370 + halfWidth - 71 }, 1000).call(function () {
\n\t
_this.zhangkai();
\n\t
});
\n\t
};
\n\t
Zhuazi.prototype.zhangkai = function () {
\n\t
var _this = this;
\n\t
this.left_zhuazi.anchorX = this.left_zhuazi.width;
\n\t
this.left_zhuazi.anchorY = 0;
\n\t
engine.Tween.get(this.left_zhuazi, { loop: false }).to({ rotation: props.leftRotation }, 1000);
\n\t
engine.Tween.get(this.right_zhuazi, { loop: false }).to({ rotation: props.rightRotation }, 1000);
\n\t
setTimeout(function () {
\n\t
_this.getLong();
\n\t
}, 500);
\n\t
};
\n\t
Zhuazi.prototype.getLong = function () {
\n\t
var _this = this;
\n\t
var droptime = Number((this.GameView.getMoveX() / 60 - 1).toFixed(2)) * 1000;
\n\t
console.log('dr', droptime);
\n\t
var times = (props.ganMoveEndY - this.ganzi.y) / this.ganzi.height;
\n\t
console.log(Number(times.toFixed(2)));
\n\t
engine.Tween.get(this.ganzi).to({ scaleY: Number(times.toFixed(2)) }, droptime).to({ scaleY: 1 }, droptime);
\n\t
console.log('node', this.zhuaziY);
\n\t
engine.Tween.get(this.ganNode).to({ y: props.ganMoveEndY }, droptime).call(function () {
\n\t
_this.GameView.stopMove();
\n\t
_this.showPrizeBox();
\n\t
_this.GameView.setVisible(false);
\n\t
}).to({ y: this.zhuaziY }, droptime).call(function () {
\n\t
engine.globalEvent.dispatchEvent('doll-mac-getprize');
\n\t
_this.getReset();
\n\t
});
\n\t
};
\n\t
Zhuazi.prototype.getReset = function () {
\n\t
this.itemShow.visible = false;
\n\t
this.left_zhuazi.anchorX = this.left_zhuazi.width;
\n\t
this.left_zhuazi.anchorY = 0;
\n\t
engine.Tween.get(this.moveNode, { loop: false }).to({ x: 262 }, 1000);
\n\t
engine.Tween.get(this.left_zhuazi, { loop: false }).to({ rotation: 0 }, 1000);
\n\t
engine.Tween.get(this.right_zhuazi, { loop: false }).to({ rotation: 0 }, 1000);
\n\t
};
\n\t
return Zhuazi;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=Zhuazi.js.map
\n\n\t
var ObjectPool$1 = engine.ObjectPool;
\n\t
var GameView = (function (_super) {
\n\t
tslib.__extends(GameView, _super);
\n\t
function GameView() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.goodsItems = [];
\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\n\t
return _this;
\n\t
}
\n\t
GameView.prototype.setup = function () {
\n\t
if (this._hasSetup) {
\n\t
return;
\n\t
}
\n\t
this._hasSetup = true;
\n\t
var frontBoxs = (this._frontBoxs = new FrontBoxs());
\n\t
this._frontBoxs.GameView = this;
\n\t
var backBoxs = (this._backBoxs = new BackBoxs());
\n\t
this._Zhuazi = new Zhuazi();
\n\t
this._Zhuazi.GameView = this;
\n\t
this.frontTransfer = new engine.Container();
\n\t
this.backTransfer = new engine.Container();
\n\t
this.frontTransfer.width = 0;
\n\t
this.frontTransfer.height = 0;
\n\t
this.frontTransfer.alpha = 1;
\n\t
this.backTransfer.width = 0;
\n\t
this.backTransfer.height = 0;
\n\t
this.backTransfer.alpha = 1;
\n\t
this.rect = new engine.Rect();
\n\t
this.rect.width = 611;
\n\t
this.rect.height = 704;
\n\t
this.rect.x = 65;
\n\t
this.rect.y = 267;
\n\t
this.NpcBg = new engine.Container();
\n\t
this.addChild(this.NpcBg);
\n\t
this.addChild(this.rect);
\n\t
var gameBg = new engine.Sprite(getTextureByName(
\"
游戏背景
\"
));
\n\t
gameBg.x = 65;
\n\t
gameBg.y = 267;
\n\t
this.NpcBg.addChild(gameBg);
\n\t
this.frontDesk = new engine.Sprite(getTextureByName(
\"
前传输带
\"
));
\n\t
this.frontDesk.x = 60;
\n\t
this.frontDesk.y = 904;
\n\t
this.backDesk = new engine.Sprite(getTextureByName(
\"
后传输带
\"
));
\n\t
this.backDesk.x = 60;
\n\t
this.backDesk.y = 810;
\n\t
this.NpcBg.addChild(this.backDesk);
\n\t
this.NpcBg.addChild(this.frontDesk);
\n\t
this.NpcBg.addChild(this.backTransfer);
\n\t
this.NpcBg.addChild(this.frontTransfer);
\n\t
this.NpcBg.addChild(this._Zhuazi);
\n\t
this.NpcBg.mask = this.rect;
\n\t
this._Zhuazi.setup();
\n\t
this.backTransfer.addChild(this._backBoxs);
\n\t
this._backBoxs.setup();
\n\t
this.frontTransfer.addChild(this._frontBoxs);
\n\t
this._frontBoxs.setup();
\n\t
};
\n\t
GameView.prototype.stopMove = function () {
\n\t
this._frontBoxs.stop();
\n\t
};
\n\t
GameView.prototype.setMoveX = function (x, item) {
\n\t
this.moveTime = x;
\n\t
this.prizeBox = item;
\n\t
this._Zhuazi.move();
\n\t
};
\n\t
GameView.prototype.setVisible = function (isshow) {
\n\t
this._frontBoxs.showHidePrizeBox(isshow);
\n\t
};
\n\t
GameView.prototype.getMoveX = function () {
\n\t
console.log(222);
\n\t
return this.moveTime;
\n\t
};
\n\t
GameView.prototype.getBox = function () {
\n\t
return this.prizeBox;
\n\t
};
\n\t
GameView.prototype.reset = function () {
\n\t
this.recycleGoods();
\n\t
this._Zhuazi.getReset();
\n\t
};
\n\t
GameView.prototype.start = function () {
\n\t
var _this = this;
\n\t
this.score = 0;
\n\t
this.speed = 1;
\n\t
this.gameIng = true;
\n\t
this.countdown = props.countDown;
\n\t
this.countdownTimer = setInterval(function () {
\n\t
if (_this.gameIng) {
\n\t
if (_this.countdown > 0) {
\n\t
engine.globalEvent.dispatchEvent(
\"
food-fell-time-update
\"
, {
\n\t
time: _this.countdown
\n\t
});
\n\t
_this.countdown -= 1;
\n\t
}
\n\t
else {
\n\t
engine.globalEvent.dispatchEvent(
\"
food-fell-game-over
\"
, {
\n\t
score: _this.score,
\n\t
reason: 1
\n\t
});
\n\t
_this.died();
\n\t
}
\n\t
}
\n\t
}, 1000);
\n\t
};
\n\t
GameView.prototype.beginNpc = function () {
\n\t
var _this = this;
\n\t
this.timer = setTimeout(function () {
\n\t
if (_this.gameIng) ;
\n\t
}, 2000 / this.speed);
\n\t
};
\n\t
GameView.prototype.pause = function () {
\n\t
this.gameIng = false;
\n\t
};
\n\t
GameView.prototype.revive = function () {
\n\t
this.gameIng = true;
\n\t
};
\n\t
GameView.prototype.resume = function () {
\n\t
this.reset();
\n\t
this.start();
\n\t
};
\n\t
GameView.prototype.initNpc = function () {
\n\t
this.box1 = new engine.Sprite(getTextureByName(
\"
草泥马盒
\"
));
\n\t
this.box2 = new engine.Sprite(getTextureByName(
\"
狗盒
\"
));
\n\t
this.box3 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box4 = new engine.Sprite(getTextureByName(
\"
草泥马盒
\"
));
\n\t
this.box5 = new engine.Sprite(getTextureByName(
\"
猫盒
\"
));
\n\t
this.box1.x = 120;
\n\t
this.box1.y = 434;
\n\t
this.box2.x = 306;
\n\t
this.box2.y = 434;
\n\t
this.box3.x = 487;
\n\t
this.box3.y = 434;
\n\t
this.box4.x = 240;
\n\t
this.box4.scaleX = 0.5;
\n\t
this.box4.scaleY = 0.5;
\n\t
this.box4.y = 390;
\n\t
this.box5.x = 434;
\n\t
this.box5.y = 390;
\n\t
this.box5.scaleX = 0.5;
\n\t
this.box5.scaleY = 0.5;
\n\t
this.backTransfer.addChild(this.box4);
\n\t
this.backTransfer.addChild(this.box5);
\n\t
this.frontTransfer.addChild(this.box1);
\n\t
this.frontTransfer.addChild(this.box2);
\n\t
this.frontTransfer.addChild(this.box3);
\n\t
};
\n\t
GameView.prototype.died = function () {
\n\t
this.score = 0;
\n\t
this.pause();
\n\t
};
\n\t
GameView.prototype.removeNpc = function (goods) {
\n\t
this.NpcBg.removeChild(goods);
\n\t
ObjectPool$1.recycleObject(PoolName, goods);
\n\t
goods.removeEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
], this);
\n\t
var index = this.goodsItems.indexOf(goods);
\n\t
if (index > -1) {
\n\t
this.goodsItems.splice(index, 1);
\n\t
}
\n\t
};
\n\t
GameView.prototype.recycleGoods = function () {
\n\t
clearTimeout(this.timer);
\n\t
clearInterval(this.countdownTimer);
\n\t
for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) {
\n\t
var goods = _a[_i];
\n\t
if (goods) {
\n\t
this.removeChild(goods);
\n\t
ObjectPool$1.recycleObject(PoolName, goods);
\n\t
goods.removeEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
], this);
\n\t
}
\n\t
}
\n\t
this.goodsItems = [];
\n\t
};
\n\t
GameView.prototype.hasHit = function (a, b) {
\n\t
if (Math.abs(a.x + a.width / 2 - (b.x + b.width / 2)) <
\n\t
a.width / 2 + b.width / 2 &&
\n\t
Math.abs(a.y + a.height / 2 - (b.y + b.height / 2)) <
\n\t
a.height / 2 + b.height / 2) {
\n\t
return true;
\n\t
}
\n\t
else {
\n\t
return false;
\n\t
}
\n\t
};
\n\t
return GameView;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=GameView.js.map
\n\n\t
var GameWrapper = (function (_super) {
\n\t
tslib.__extends(GameWrapper, _super);
\n\t
function GameWrapper() {
\n\t
var _this = _super.call(this) || this;
\n\t
engine.globalEvent.addEventListener('doll-machine-reset', _this.reset, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-start', _this.start, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-pause', _this.pause, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-resume', _this.resume, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-revive', _this.revive, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-clear', _this.clear, _this);
\n\t
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
\n\t
var gameView = _this._gameView = new GameView();
\n\t
_this.addChild(gameView);
\n\t
return _this;
\n\t
}
\n\t
GameWrapper.prototype.reset = function (event) {
\n\t
injectProps(event.data);
\n\t
this._gameView.visible = true;
\n\t
this._gameView.reset();
\n\t
};
\n\t
GameWrapper.prototype.start = function (event) {
\n\t
injectProps(event.data);
\n\t
this._status = 1;
\n\t
this._gameView.start();
\n\t
};
\n\t
GameWrapper.prototype.pause = function () {
\n\t
this._gameView.pause();
\n\t
};
\n\t
GameWrapper.prototype.resume = function () {
\n\t
this._gameView.resume();
\n\t
};
\n\t
GameWrapper.prototype.revive = function () {
\n\t
this._gameView.revive();
\n\t
};
\n\t
GameWrapper.prototype.clear = function () {
\n\t
this._gameView.visible = false;
\n\t
};
\n\t
GameWrapper.prototype.onTap = function (event) {
\n\t
};
\n\t
return GameWrapper;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\n\t
prepareProps();
\n\t
injectProps(props);
\n\t
var instance = new GameWrapper();
\n\t
return instance;
\n\t
}
\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})));
\n
"
}
dist/customs/food-fell.json
View file @
b9593434
...
@@ -126,5 +126,5 @@
...
@@ -126,5 +126,5 @@
}
}
},
},
"id"
:
"food-fell"
,
"id"
:
"food-fell"
,
"code"
:
"(function (global, factory) {
\n\t
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
\n\t
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
\n\t
(global = global || self, global['food-fell'] = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\n\t
function prepareProps() {
\n\t
var metaProps = getProps();
\n\t
engine.injectProp(props, metaProps);
\n\t
}
\n\t
function injectProps(p) {
\n\t
engine.injectProp(props, p);
\n\t
}
\n\
t
//# sourceMappingURL=props.js.map
\n\n\t
function getTexture(uuid) {
\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\n\t
}
\n\t
function getTextureByName(name) {
\n\t
return getTexture(engine.getAssetByName(name).uuid);
\n\t
}
\n\t
function createSvga(name, anchorName) {
\n\t
var inst = new svga.Svga();
\n\t
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
\n\t
return inst;
\n\t
}
\n\t
//# sourceMappingURL=utils.js.map
\n\n\t
var Goods = (function (_super) {
\n\t
tslib.__extends(Goods, _super);
\n\t
function Goods() {
\n\t
var _this = _super.call(this) || this;
\n\t
var body;
\n\t
body = _this._body = new engine.Rect();
\n\t
var rain = new engine.Sprite(getTextureByName('雨滴'));
\n\t
rain[
\"
npcType
\"
] =
\"
rain
\"
;
\n\t
var stone = new engine.Sprite(getTextureByName('石块'));
\n\t
stone[
\"
npcType
\"
] =
\"
stone
\"
;
\n\t
var boom = new engine.Sprite(getTextureByName('炸弹'));
\n\t
boom[
\"
npcType
\"
] =
\"
boom
\"
;
\n\t
rain.visible = false;
\n\t
stone.visible = false;
\n\t
boom.visible = false;
\n\t
body.addChild(rain);
\n\t
body.addChild(stone);
\n\t
body.addChild(boom);
\n\t
_this.addChild(body);
\n\t
body.width = .0001;
\n\t
body.height = .0001;
\n\t
body.mouseEnabled = false;
\n\t
return _this;
\n\t
}
\n\t
Goods.prototype.getRandomNumberByRange = function (start, end) {
\n\t
return Math.floor(Math.random() * (end - start) + start);
\n\t
};
\n\t
Goods.prototype.reset = function () {
\n\t
this.visible = true;
\n\t
this.rotation = 0;
\n\t
this.anchorOffsetY = 0;
\n\t
this.y = 0;
\n\t
this.x = (750 - 120) * Math.random() + 30;
\n\t
this.rotation = 0;
\n\t
var random = Math.random();
\n\t
if (random < props.goodsProbability[0]) {
\n\t
this.showNpc(
\"
rain
\"
);
\n\t
}
\n\t
else if (random >= props.goodsProbability[0] && random <= (props.goodsProbability[0] + props.goodsProbability[1])) {
\n\t
this.showNpc(
\"
stone
\"
);
\n\t
}
\n\t
else if (random > (props.goodsProbability[0] + props.goodsProbability[1])) {
\n\t
this.showNpc(
\"
boom
\"
);
\n\t
}
\n\t
};
\n\t
Goods.prototype.showNpc = function (type) {
\n\t
for (var i = 0; i < this._body.children.length; i++) {
\n\t
this._body.children[i].visible = false;
\n\t
this._body.children[i].mouseEnabled = false;
\n\t
}
\n\t
for (var i = 0; i < this._body.children.length; i++) {
\n\t
if (this._body.children[i][
\"
npcType
\"
] == type) {
\n\t
this[
\"
npcType
\"
] = type;
\n\t
this._body.children[i].visible = true;
\n\t
this._body.children[i].mouseEnabled = false;
\n\t
}
\n\t
}
\n\t
};
\n\t
Object.defineProperty(Goods.prototype,
\"
anchorOffsetY
\"
, {
\n\t
set: function (v) {
\n\t
this._body.y = v;
\n\t
},
\n\t
enumerable: true,
\n\t
configurable: true
\n\t
});
\n\t
return Goods;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=Goods.js.map
\n\n\t
var ObjectPool = engine.ObjectPool;
\n\t
var PoolName = 'goods';
\n\t
ObjectPool.registerPool(PoolName, function () {
\n\t
return new Goods();
\n\t
}, function (item, data) {
\n\t
item.reset();
\n\t
});
\n\t
//# sourceMappingURL=object-pool-init.js.map
\n\n\t
var ObjectPool$1 = engine.ObjectPool;
\n\t
var GameView = (function (_super) {
\n\t
tslib.__extends(GameView, _super);
\n\t
function GameView() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.goodsItems = [];
\n\t
_this.moveCatchX = 0;
\n\t
_this.playerCatchX = 0;
\n\t
_this.onDownStage = function (e) {
\n\t
_this.moveCatchX = e.localX;
\n\t
_this.playerCatchX = _this.player.x;
\n\t
};
\n\t
_this.onMoveStage = function (e) {
\n\t
if (_this.gameIng) {
\n\t
_this.player.x = _this.playerCatchX + (e.localX - _this.moveCatchX);
\n\t
}
\n\t
};
\n\t
_this.onOutStage = function (e) {
\n\t
_this.moveCatchX = 0;
\n\t
};
\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\n\t
return _this;
\n\t
}
\n\t
GameView.prototype.setup = function () {
\n\t
var _this = this;
\n\t
if (this._hasSetup) {
\n\t
return;
\n\t
}
\n\t
this._hasSetup = true;
\n\t
this.NpcBg = new engine.Container();
\n\t
this.NpcBg.alpha = 1;
\n\t
this.NpcBg.width = 0;
\n\t
this.NpcBg.height = 0;
\n\t
this.addChild(this.NpcBg);
\n\t
this.player = new engine.Container();
\n\t
this.player.mouseEnabled = false;
\n\t
this.addChild(this.player);
\n\t
this.waterSvga = createSvga(
\"
水花
\"
);
\n\t
this.playerSvga = createSvga(
\"
玩家
\"
);
\n\t
this.boomSvga = createSvga(
\"
炸弹svga
\"
);
\n\t
this.player.addChild(this.playerSvga);
\n\t
this.player.addChild(this.waterSvga);
\n\t
this.player.addChild(this.boomSvga);
\n\t
this.playerSvga.gotoAndPlay(1);
\n\t
this.visible = false;
\n\t
setTimeout(function () {
\n\t
_this.visible = true;
\n\t
_this.player.anchorY = _this.player.height / 2;
\n\t
_this.player.anchorX = _this.player.width / 2;
\n\t
console.log(_this.player.width);
\n\t
console.log(_this.playerSvga.width);
\n\t
_this.player.x = 375 - _this.player.width / 2;
\n\t
_this.player.y = props.playerPositionY;
\n\t
}, 300);
\n\t
this.rectBg = new engine.Rect();
\n\t
this.rectBg.alpha = 0;
\n\t
this.rectBg.width = 750;
\n\t
this.rectBg.height = 1624;
\n\t
this.addChild(this.rectBg);
\n\t
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);
\n\t
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);
\n\t
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);
\n\t
};
\n\t
GameView.prototype.reset = function () {
\n\t
this.recycleGoods();
\n\t
};
\n\t
GameView.prototype.start = function () {
\n\t
var _this = this;
\n\t
this.score = 0;
\n\t
this.speed = 1;
\n\t
this.gameIng = true;
\n\t
this.creatNpc();
\n\t
this.beginNpc();
\n\t
this.countdown = props.countDown;
\n\t
this.countdownTimer = setInterval(function () {
\n\t
if (_this.gameIng) {
\n\t
if (_this.countdown > 0) {
\n\t
engine.globalEvent.dispatchEvent('food-fell-time-update', {
\n\t
time: _this.countdown,
\n\t
});
\n\t
_this.countdown -= 1;
\n\t
}
\n\t
else {
\n\t
engine.globalEvent.dispatchEvent('food-fell-game-over', {
\n\t
score: _this.score,
\n\t
reason: 1
\n\t
});
\n\t
_this.died();
\n\t
}
\n\t
}
\n\t
}, 1000);
\n\t
};
\n\t
GameView.prototype.beginNpc = function () {
\n\t
var _this = this;
\n\t
this.timer = setTimeout(function () {
\n\t
if (_this.gameIng) {
\n\t
_this.speed += props.acceleratedSpeed;
\n\t
_this.creatNpc();
\n\t
}
\n\t
_this.beginNpc();
\n\t
}, 2000 / this.speed);
\n\t
};
\n\t
GameView.prototype.pause = function () {
\n\t
this.gameIng = false;
\n\t
};
\n\t
GameView.prototype.revive = function () {
\n\t
this.gameIng = true;
\n\t
};
\n\t
GameView.prototype.resume = function () {
\n\t
this.reset();
\n\t
this.start();
\n\t
};
\n\t
GameView.prototype.creatNpc = function () {
\n\t
var _this = this;
\n\t
var goods = this._goods = ObjectPool$1.getObject(PoolName);
\n\t
this.goodsItems.push(goods);
\n\t
this.NpcBg.addChild(goods);
\n\t
goods.addEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
] = function () {
\n\t
if (goods.y > 1624) {
\n\t
_this.removeNpc(goods);
\n\t
}
\n\t
else {
\n\t
if (_this.gameIng) {
\n\t
goods.y += (4 * _this.speed);
\n\t
if (_this.hasHit(_this.player, goods)) {
\n\t
if (goods[
\"
npcType
\"
] ==
\"
rain
\"
) {
\n\t
console.log(
\"
碰到雨滴
\"
);
\n\t
_this.score += props.rainScore;
\n\t
_this.waterSvga.visible = true;
\n\t
_this.waterSvga.play(false, false);
\n\t
_this.waterSvga.once(engine.Event.END_FRAME, function () {
\n\t
_this.waterSvga.visible = false;
\n\t
}, _this);
\n\t
}
\n\t
else if (goods[
\"
npcType
\"
] ==
\"
stone
\"
) {
\n\t
console.log(
\"
碰到石头
\"
);
\n\t
_this.score += props.stoneScore;
\n\t
}
\n\t
else if (goods[
\"
npcType
\"
] ==
\"
boom
\"
) {
\n\t
console.log(
\"
碰到炸弹
\"
);
\n\t
_this.boomSvga.visible = true;
\n\t
_this.boomSvga.play(false, false);
\n\t
_this.boomSvga.once(engine.Event.END_FRAME, function () {
\n\t
_this.boomSvga.visible = false;
\n\t
}, _this);
\n\t
engine.globalEvent.dispatchEvent('food-fell-game-over', {
\n\t
score: _this.score,
\n\t
reason: 2
\n\t
});
\n\t
_this.died();
\n\t
}
\n\t
engine.globalEvent.dispatchEvent('food-fell-score-update', {
\n\t
score: _this.score,
\n\t
});
\n\t
_this.removeNpc(goods);
\n\t
}
\n\t
}
\n\t
}
\n\t
}, this);
\n\t
};
\n\t
GameView.prototype.died = function () {
\n\t
this.score = 0;
\n\t
this.pause();
\n\t
};
\n\t
GameView.prototype.removeNpc = function (goods) {
\n\t
this.NpcBg.removeChild(goods);
\n\t
ObjectPool$1.recycleObject(PoolName, goods);
\n\t
goods.removeEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
], this);
\n\t
var index = this.goodsItems.indexOf(goods);
\n\t
if (index > -1) {
\n\t
this.goodsItems.splice(index, 1);
\n\t
}
\n\t
};
\n\t
GameView.prototype.recycleGoods = function () {
\n\t
clearTimeout(this.timer);
\n\t
clearInterval(this.countdownTimer);
\n\t
for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) {
\n\t
var goods = _a[_i];
\n\t
if (goods) {
\n\t
this.removeChild(goods);
\n\t
ObjectPool$1.recycleObject(PoolName, goods);
\n\t
goods.removeEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
], this);
\n\t
}
\n\t
}
\n\t
this.goodsItems = [];
\n\t
};
\n\t
GameView.prototype.hasHit = function (a, b) {
\n\t
if (Math.abs((a.x + a.width / 2) - (b.x + b.width / 2)) < a.width / 2 + b.width / 2
\n\t
&&
\n\t
Math.abs((a.y + a.height / 2) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2) {
\n\t
return true;
\n\t
}
\n\t
else {
\n\t
return false;
\n\t
}
\n\t
};
\n\t
return GameView;
\n\t
}(engine.Container));
\n\n\t
var GameWrapper = (function (_super) {
\n\t
tslib.__extends(GameWrapper, _super);
\n\t
function GameWrapper() {
\n\t
var _this = _super.call(this) || this;
\n\t
engine.globalEvent.addEventListener('food-fell-reset', _this.reset, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-start', _this.start, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-pause', _this.pause, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-resume', _this.resume, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-revive', _this.revive, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-clear', _this.clear, _this);
\n\t
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
\n\t
var gameView = _this._gameView = new GameView();
\n\t
_this.addChild(gameView);
\n\t
return _this;
\n\t
}
\n\t
GameWrapper.prototype.reset = function (event) {
\n\t
injectProps(event.data);
\n\t
this._gameView.visible = true;
\n\t
this._gameView.reset();
\n\t
};
\n\t
GameWrapper.prototype.start = function (event) {
\n\t
injectProps(event.data);
\n\t
this._status = 1;
\n\t
this._gameView.start();
\n\t
};
\n\t
GameWrapper.prototype.pause = function () {
\n\t
this._gameView.pause();
\n\t
};
\n\t
GameWrapper.prototype.resume = function () {
\n\t
this._gameView.resume();
\n\t
};
\n\t
GameWrapper.prototype.revive = function () {
\n\t
this._gameView.revive();
\n\t
};
\n\t
GameWrapper.prototype.clear = function () {
\n\t
this._gameView.visible = false;
\n\t
};
\n\t
GameWrapper.prototype.onTap = function (event) {
\n\t
};
\n\t
return GameWrapper;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\n\t
prepareProps();
\n\t
injectProps(props);
\n\t
var instance = new GameWrapper();
\n\t
return instance;
\n\t
}
\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})));
\n
"
"code"
:
"(function (global, factory) {
\n\t
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
\n\t
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
\n\t
(global = global || self, global['food-fell'] = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\n\t
function prepareProps() {
\n\t
var metaProps = getProps();
\n\t
engine.injectProp(props, metaProps);
\n\t
}
\n\t
function injectProps(p) {
\n\t
engine.injectProp(props, p);
\n\t
}
\n\
n\t
function getTexture(uuid) {
\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\n\t
}
\n\t
function getTextureByName(name) {
\n\t
return getTexture(engine.getAssetByName(name).uuid);
\n\t
}
\n\t
function createSvga(name, anchorName) {
\n\t
var inst = new svga.Svga();
\n\t
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
\n\t
return inst;
\n\t
}
\n\n\t
var Goods = (function (_super) {
\n\t
tslib.__extends(Goods, _super);
\n\t
function Goods() {
\n\t
var _this = _super.call(this) || this;
\n\t
var body;
\n\t
body = _this._body = new engine.Rect();
\n\t
var rain = new engine.Sprite(getTextureByName('雨滴'));
\n\t
rain[
\"
npcType
\"
] =
\"
rain
\"
;
\n\t
var stone = new engine.Sprite(getTextureByName('石块'));
\n\t
stone[
\"
npcType
\"
] =
\"
stone
\"
;
\n\t
var boom = new engine.Sprite(getTextureByName('炸弹'));
\n\t
boom[
\"
npcType
\"
] =
\"
boom
\"
;
\n\t
rain.visible = false;
\n\t
stone.visible = false;
\n\t
boom.visible = false;
\n\t
body.addChild(rain);
\n\t
body.addChild(stone);
\n\t
body.addChild(boom);
\n\t
_this.addChild(body);
\n\t
body.width = .0001;
\n\t
body.height = .0001;
\n\t
body.mouseEnabled = false;
\n\t
return _this;
\n\t
}
\n\t
Goods.prototype.getRandomNumberByRange = function (start, end) {
\n\t
return Math.floor(Math.random() * (end - start) + start);
\n\t
};
\n\t
Goods.prototype.reset = function () {
\n\t
this.visible = true;
\n\t
this.rotation = 0;
\n\t
this.anchorOffsetY = 0;
\n\t
this.y = 0;
\n\t
this.x = (750 - 120) * Math.random() + 30;
\n\t
this.rotation = 0;
\n\t
var random = Math.random();
\n\t
if (random < props.goodsProbability[0]) {
\n\t
this.showNpc(
\"
rain
\"
);
\n\t
}
\n\t
else if (random >= props.goodsProbability[0] && random <= (props.goodsProbability[0] + props.goodsProbability[1])) {
\n\t
this.showNpc(
\"
stone
\"
);
\n\t
}
\n\t
else if (random > (props.goodsProbability[0] + props.goodsProbability[1])) {
\n\t
this.showNpc(
\"
boom
\"
);
\n\t
}
\n\t
};
\n\t
Goods.prototype.showNpc = function (type) {
\n\t
for (var i = 0; i < this._body.children.length; i++) {
\n\t
this._body.children[i].visible = false;
\n\t
this._body.children[i].mouseEnabled = false;
\n\t
}
\n\t
for (var i = 0; i < this._body.children.length; i++) {
\n\t
if (this._body.children[i][
\"
npcType
\"
] == type) {
\n\t
this[
\"
npcType
\"
] = type;
\n\t
this._body.children[i].visible = true;
\n\t
this._body.children[i].mouseEnabled = false;
\n\t
}
\n\t
}
\n\t
};
\n\t
Object.defineProperty(Goods.prototype,
\"
anchorOffsetY
\"
, {
\n\t
set: function (v) {
\n\t
this._body.y = v;
\n\t
},
\n\t
enumerable: true,
\n\t
configurable: true
\n\t
});
\n\t
return Goods;
\n\t
}(engine.Container));
\n\n\t
var ObjectPool = engine.ObjectPool;
\n\t
var PoolName = 'goods';
\n\t
ObjectPool.registerPool(PoolName, function () {
\n\t
return new Goods();
\n\t
}, function (item, data) {
\n\t
item.reset();
\n\t
});
\n\n\t
var ObjectPool$1 = engine.ObjectPool;
\n\t
var GameView = (function (_super) {
\n\t
tslib.__extends(GameView, _super);
\n\t
function GameView() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.goodsItems = [];
\n\t
_this.moveCatchX = 0;
\n\t
_this.playerCatchX = 0;
\n\t
_this.onDownStage = function (e) {
\n\t
_this.moveCatchX = e.localX;
\n\t
_this.playerCatchX = _this.player.x;
\n\t
};
\n\t
_this.onMoveStage = function (e) {
\n\t
if (_this.gameIng) {
\n\t
_this.player.x = _this.playerCatchX + (e.localX - _this.moveCatchX);
\n\t
}
\n\t
};
\n\t
_this.onOutStage = function (e) {
\n\t
_this.moveCatchX = 0;
\n\t
};
\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\n\t
return _this;
\n\t
}
\n\t
GameView.prototype.setup = function () {
\n\t
var _this = this;
\n\t
if (this._hasSetup) {
\n\t
return;
\n\t
}
\n\t
this._hasSetup = true;
\n\t
this.NpcBg = new engine.Container();
\n\t
this.NpcBg.alpha = 1;
\n\t
this.NpcBg.width = 0;
\n\t
this.NpcBg.height = 0;
\n\t
this.addChild(this.NpcBg);
\n\t
this.player = new engine.Container();
\n\t
this.player.mouseEnabled = false;
\n\t
this.addChild(this.player);
\n\t
this.waterSvga = createSvga(
\"
水花
\"
);
\n\t
this.playerSvga = createSvga(
\"
玩家
\"
);
\n\t
this.boomSvga = createSvga(
\"
炸弹svga
\"
);
\n\t
this.player.addChild(this.playerSvga);
\n\t
this.player.addChild(this.waterSvga);
\n\t
this.player.addChild(this.boomSvga);
\n\t
this.playerSvga.gotoAndPlay(1);
\n\t
this.visible = false;
\n\t
setTimeout(function () {
\n\t
_this.visible = true;
\n\t
_this.player.anchorY = _this.player.height / 2;
\n\t
_this.player.anchorX = _this.player.width / 2;
\n\t
console.log(_this.player.width);
\n\t
console.log(_this.playerSvga.width);
\n\t
_this.player.x = 375 - _this.player.width / 2;
\n\t
_this.player.y = props.playerPositionY;
\n\t
}, 300);
\n\t
this.rectBg = new engine.Rect();
\n\t
this.rectBg.alpha = 0;
\n\t
this.rectBg.width = 750;
\n\t
this.rectBg.height = 1624;
\n\t
this.addChild(this.rectBg);
\n\t
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);
\n\t
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);
\n\t
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);
\n\t
};
\n\t
GameView.prototype.reset = function () {
\n\t
this.recycleGoods();
\n\t
};
\n\t
GameView.prototype.start = function () {
\n\t
var _this = this;
\n\t
this.score = 0;
\n\t
this.speed = 1;
\n\t
this.gameIng = true;
\n\t
this.creatNpc();
\n\t
this.beginNpc();
\n\t
this.countdown = props.countDown;
\n\t
this.countdownTimer = setInterval(function () {
\n\t
if (_this.gameIng) {
\n\t
if (_this.countdown > 0) {
\n\t
engine.globalEvent.dispatchEvent('food-fell-time-update', {
\n\t
time: _this.countdown,
\n\t
});
\n\t
_this.countdown -= 1;
\n\t
}
\n\t
else {
\n\t
engine.globalEvent.dispatchEvent('food-fell-game-over', {
\n\t
score: _this.score,
\n\t
reason: 1
\n\t
});
\n\t
_this.died();
\n\t
}
\n\t
}
\n\t
}, 1000);
\n\t
};
\n\t
GameView.prototype.beginNpc = function () {
\n\t
var _this = this;
\n\t
this.timer = setTimeout(function () {
\n\t
if (_this.gameIng) {
\n\t
_this.speed += props.acceleratedSpeed;
\n\t
_this.creatNpc();
\n\t
}
\n\t
_this.beginNpc();
\n\t
}, 2000 / this.speed);
\n\t
};
\n\t
GameView.prototype.pause = function () {
\n\t
this.gameIng = false;
\n\t
};
\n\t
GameView.prototype.revive = function () {
\n\t
this.gameIng = true;
\n\t
};
\n\t
GameView.prototype.resume = function () {
\n\t
this.reset();
\n\t
this.start();
\n\t
};
\n\t
GameView.prototype.creatNpc = function () {
\n\t
var _this = this;
\n\t
var goods = this._goods = ObjectPool$1.getObject(PoolName);
\n\t
this.goodsItems.push(goods);
\n\t
this.NpcBg.addChild(goods);
\n\t
goods.addEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
] = function () {
\n\t
if (goods.y > 1624) {
\n\t
_this.removeNpc(goods);
\n\t
}
\n\t
else {
\n\t
if (_this.gameIng) {
\n\t
goods.y += (4 * _this.speed);
\n\t
if (_this.hasHit(_this.player, goods)) {
\n\t
if (goods[
\"
npcType
\"
] ==
\"
rain
\"
) {
\n\t
console.log(
\"
碰到雨滴
\"
);
\n\t
_this.score += props.rainScore;
\n\t
_this.waterSvga.visible = true;
\n\t
_this.waterSvga.play(false, false);
\n\t
_this.waterSvga.once(engine.Event.END_FRAME, function () {
\n\t
_this.waterSvga.visible = false;
\n\t
}, _this);
\n\t
}
\n\t
else if (goods[
\"
npcType
\"
] ==
\"
stone
\"
) {
\n\t
console.log(
\"
碰到石头
\"
);
\n\t
_this.score += props.stoneScore;
\n\t
}
\n\t
else if (goods[
\"
npcType
\"
] ==
\"
boom
\"
) {
\n\t
console.log(
\"
碰到炸弹
\"
);
\n\t
_this.boomSvga.visible = true;
\n\t
_this.boomSvga.play(false, false);
\n\t
_this.boomSvga.once(engine.Event.END_FRAME, function () {
\n\t
_this.boomSvga.visible = false;
\n\t
}, _this);
\n\t
engine.globalEvent.dispatchEvent('food-fell-game-over', {
\n\t
score: _this.score,
\n\t
reason: 2
\n\t
});
\n\t
_this.died();
\n\t
}
\n\t
engine.globalEvent.dispatchEvent('food-fell-score-update', {
\n\t
score: _this.score,
\n\t
});
\n\t
_this.removeNpc(goods);
\n\t
}
\n\t
}
\n\t
}
\n\t
}, this);
\n\t
};
\n\t
GameView.prototype.died = function () {
\n\t
this.score = 0;
\n\t
this.pause();
\n\t
};
\n\t
GameView.prototype.removeNpc = function (goods) {
\n\t
this.NpcBg.removeChild(goods);
\n\t
ObjectPool$1.recycleObject(PoolName, goods);
\n\t
goods.removeEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
], this);
\n\t
var index = this.goodsItems.indexOf(goods);
\n\t
if (index > -1) {
\n\t
this.goodsItems.splice(index, 1);
\n\t
}
\n\t
};
\n\t
GameView.prototype.recycleGoods = function () {
\n\t
clearTimeout(this.timer);
\n\t
clearInterval(this.countdownTimer);
\n\t
for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) {
\n\t
var goods = _a[_i];
\n\t
if (goods) {
\n\t
this.removeChild(goods);
\n\t
ObjectPool$1.recycleObject(PoolName, goods);
\n\t
goods.removeEventListener(engine.Event.ENTER_FRAME, goods[
\"
onGoodsEnter
\"
], this);
\n\t
}
\n\t
}
\n\t
this.goodsItems = [];
\n\t
};
\n\t
GameView.prototype.hasHit = function (a, b) {
\n\t
if (Math.abs((a.x + a.width / 2) - (b.x + b.width / 2)) < a.width / 2 + b.width / 2
\n\t
&&
\n\t
Math.abs((a.y + a.height / 2) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2) {
\n\t
return true;
\n\t
}
\n\t
else {
\n\t
return false;
\n\t
}
\n\t
};
\n\t
return GameView;
\n\t
}(engine.Container));
\n\n\t
var GameWrapper = (function (_super) {
\n\t
tslib.__extends(GameWrapper, _super);
\n\t
function GameWrapper() {
\n\t
var _this = _super.call(this) || this;
\n\t
engine.globalEvent.addEventListener('food-fell-reset', _this.reset, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-start', _this.start, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-pause', _this.pause, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-resume', _this.resume, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-revive', _this.revive, _this);
\n\t
engine.globalEvent.addEventListener('food-fell-clear', _this.clear, _this);
\n\t
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
\n\t
var gameView = _this._gameView = new GameView();
\n\t
_this.addChild(gameView);
\n\t
return _this;
\n\t
}
\n\t
GameWrapper.prototype.reset = function (event) {
\n\t
injectProps(event.data);
\n\t
this._gameView.visible = true;
\n\t
this._gameView.reset();
\n\t
};
\n\t
GameWrapper.prototype.start = function (event) {
\n\t
injectProps(event.data);
\n\t
this._status = 1;
\n\t
this._gameView.start();
\n\t
};
\n\t
GameWrapper.prototype.pause = function () {
\n\t
this._gameView.pause();
\n\t
};
\n\t
GameWrapper.prototype.resume = function () {
\n\t
this._gameView.resume();
\n\t
};
\n\t
GameWrapper.prototype.revive = function () {
\n\t
this._gameView.revive();
\n\t
};
\n\t
GameWrapper.prototype.clear = function () {
\n\t
this._gameView.visible = false;
\n\t
};
\n\t
GameWrapper.prototype.onTap = function (event) {
\n\t
};
\n\t
return GameWrapper;
\n\t
}(engine.Container));
\n\n\t
function index (props) {
\n\t
prepareProps();
\n\t
injectProps(props);
\n\t
var instance = new GameWrapper();
\n\t
return instance;
\n\t
}
\n\n\t
return index;
\n\n
})));
\n
"
}
}
src/custom/doll-machine/debug/app.js
0 → 100644
View file @
b9593434
/**
* Created by renjianfeng on 2020-03-13.
*/
const
customId
=
"doll-machine"
;
(
async
function
()
{
let
customModule
=
await
fetch
(
`../meta.json`
);
customModule
=
await
customModule
.
json
();
console
.
log
(
customModule
);
await
loadAssets
(
customModule
.
assets
);
launchWithCustomModule
(
customModule
);
})();
function
launchWithCustomModule
(
customModule
)
{
//engine.registerCustomCodeModule(customModule);
engine
.
registerCustomModule
(
customId
,
window
[
customId
]);
const
{
props
:
propsOption
,
assets
}
=
customModule
;
let
props
=
engine
.
computeProps
(
customModuleProps
,
propsOption
);
const
customModuleIns
=
{
id
:
customId
,
props
,
assets
,
};
engine
.
registerCustomModules
([
customModuleIns
]);
engine
.
launchWithConfig
({
options
:
{
entrySceneView
:
'entry'
,
},
assets
:
[],
views
:
[{
name
:
'entry'
,
type
:
'node'
,
properties
:
{
x
:
0
,
y
:
0
,
}
}],
},
null
,
function
()
{
setTimeout
(()
=>
{
engine
.
addCustomModule
(
customId
,
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
));
},
100
);
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'food-fell-reset'
,
{
"goodsProbability"
:
[
0.8
,
0.1
,
0.1
],
"countDown"
:
30
,
"acceleratedSpeed"
:
0.1
});
engine
.
globalEvent
.
dispatchEvent
(
'food-fell-start'
);
},
500
);
});
engine
.
globalEvent
.
addEventListener
(
'food-fell-time-update'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
});
engine
.
globalEvent
.
addEventListener
(
'food-fell-score-update'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
});
engine
.
globalEvent
.
addEventListener
(
'food-fell-game-over'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
});
}
function
getAssetByUUID
(
uuid
)
{
return
engine
.
resolveCustomAsset
(
customId
,
uuid
);
}
function
getProps
()
{
return
engine
.
getProps
(
customId
);
}
src/custom/doll-machine/debug/index.html
0 → 100644
View file @
b9593434
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
美食从天而降
</title>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"x5-fullscreen"
content=
"true"
/>
<meta
name=
"360-fullscreen"
content=
"true"
/>
<style>
html
,
body
{
padding
:
0
;
margin
:
0
;
border
:
0
;
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
position
:
absolute
;
background-color
:
red
;
}
</style>
</head>
<body>
<div
id=
"game-container"
style=
"line-height:0;font-size:0"
></div>
<script
crossorigin=
"anonymous"
src=
"//yun.duiba.com.cn/editor/zeroing/libs/engine.50cdcef6ebe4e8c0fbc624f9d4fbf225102c5750.js"
></script>
<script
crossorigin=
"anonymous"
src=
"//yun.duiba.com.cn/editor/zeroing/libs/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"
></script>
<!-- <script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script> -->
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script
src=
"app.js"
></script>
<script
src=
"props.js"
></script>
<script
src=
"load-assets.js"
></script>
<script
src=
"main.js"
></script>
<script>
</script>
</body>
\ No newline at end of file
src/custom/doll-machine/debug/load-assets.js
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-01-21.
*/
const
assets
=
[
{
"name"
:
"玩家icon"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/50a7212a113175fa18c866b005d98f07c558dc77.png"
,
"uuid"
:
"66f23d13-82a5-4cec-9496-301ec240d087"
,
"ext"
:
".png"
},
{
"name"
:
"雨滴"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/8564c8c9be3aead71b05a0bab8d7d07ac3f778a1.png"
,
"uuid"
:
"264a6192-d7bf-45e8-8f15-6ba2c439a532"
,
"ext"
:
".png"
},
{
"name"
:
"炸弹"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/171e92283cd13c013ee1b76d28d252ff08815d47.png"
,
"uuid"
:
"eb88b42d-e151-4c1b-94b9-7c16f7bfac29"
,
"ext"
:
".png"
},
{
"name"
:
"石块"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/99b0af0c59fe79a415a3f032149cfacc27e3ac2c.png"
,
"uuid"
:
"ab1bdabc-21ba-46bf-9299-6c638f766c88"
,
"ext"
:
".png"
},
{
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga"
,
"uuid"
:
"b521bf94-20e1-44dd-8eca-d24996cbaeae"
,
"ext"
:
".svga"
},
{
"name"
:
"炸弹"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga"
,
"uuid"
:
"322edf39-805b-4e84-9d07-5573dfeebc0e"
,
"ext"
:
".svga"
},
{
"name"
:
"玩家"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga"
,
"uuid"
:
"71d8dcbc-3931-471a-b585-b3ae01b25aa6"
,
"ext"
:
".svga"
}
];
function
loadAssets
(
customModuleAssets
,
onProgress
,
onComplete
){
return
engine
.
loadAssets
(
assets
.
concat
(...
customModuleAssets
),
onProgress
,
onComplete
);
}
src/custom/doll-machine/debug/main.js
0 → 100644
View file @
b9593434
(
function
(
global
,
factory
)
{
typeof
exports
===
'object'
&&
typeof
module
!==
'undefined'
?
module
.
exports
=
factory
(
require
(
'tslib'
))
:
typeof
define
===
'function'
&&
define
.
amd
?
define
([
'tslib'
],
factory
)
:
(
global
=
global
||
self
,
global
[
'doll-machine'
]
=
factory
(
global
.
tslib
));
}(
this
,
(
function
(
tslib
)
{
'use strict'
;
var
props
=
{};
function
prepareProps
()
{
var
metaProps
=
getProps
();
engine
.
injectProp
(
props
,
metaProps
);
}
function
injectProps
(
p
)
{
engine
.
injectProp
(
props
,
p
);
}
//# sourceMappingURL=props.js.map
function
getTexture
(
uuid
)
{
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
}
function
getTextureByName
(
name
)
{
return
getTexture
(
engine
.
getAssetByName
(
name
).
uuid
);
}
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
function
Goods
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
var
body
;
body
=
_this
.
_body
=
new
engine
.
Rect
();
var
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
box1
[
"npcType"
]
=
"box1"
;
var
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
box2
[
"npcType"
]
=
"box2"
;
var
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
box3
[
"npcType"
]
=
"box3"
;
box1
.
visible
=
false
;
box2
.
visible
=
false
;
box3
.
visible
=
false
;
body
.
addChild
(
box1
);
body
.
addChild
(
box2
);
body
.
addChild
(
box3
);
_this
.
addChild
(
body
);
body
.
width
=
0.0001
;
body
.
height
=
0.0001
;
body
.
mouseEnabled
=
false
;
return
_this
;
}
Goods
.
prototype
.
getRandomNumberByRange
=
function
(
start
,
end
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
end
-
start
)
+
start
);
};
Goods
.
prototype
.
reset
=
function
()
{
this
.
visible
=
true
;
this
.
y
=
200
;
this
.
x
=
0
;
this
.
rotation
=
0
;
var
random
=
Math
.
random
();
if
(
random
<
0.3
)
{
this
.
showNpc
(
"box1"
);
}
else
if
(
random
<
0.6
)
{
this
.
showNpc
(
"box2"
);
}
else
{
this
.
showNpc
(
"box3"
);
}
};
Goods
.
prototype
.
showNpc
=
function
(
type
)
{
for
(
var
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
)
{
this
.
_body
.
children
[
i
].
visible
=
false
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
for
(
var
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
)
{
if
(
this
.
_body
.
children
[
i
][
"npcType"
]
==
type
)
{
this
[
"npcType"
]
=
type
;
console
.
log
(
type
);
this
.
_body
.
children
[
i
].
visible
=
true
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
}
};
Object
.
defineProperty
(
Goods
.
prototype
,
"anchorOffsetY"
,
{
set
:
function
(
v
)
{
this
.
_body
.
y
=
v
;
},
enumerable
:
true
,
configurable
:
true
});
return
Goods
;
}(
engine
.
Container
));
//# sourceMappingURL=Goods.js.map
var
ObjectPool
=
engine
.
ObjectPool
;
var
PoolName
=
'goods'
;
ObjectPool
.
registerPool
(
PoolName
,
function
()
{
return
new
Goods
();
},
function
(
item
,
data
)
{
item
.
reset
();
});
//# sourceMappingURL=object-pool-init.js.map
var
FrontBoxs
=
(
function
(
_super
)
{
tslib
.
__extends
(
FrontBoxs
,
_super
);
function
FrontBoxs
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
frontBoxs
=
[];
return
_this
;
}
FrontBoxs
.
prototype
.
setup
=
function
()
{
var
initX
,
initY
=
0
;
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box1
[
"npcType"
]
=
"box1"
;
initX
=
this
.
box1
.
x
=
435
;
initY
=
this
.
box1
.
y
=
734
;
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box2
[
"npcType"
]
=
"box2"
;
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box3
[
"npcType"
]
=
"box3"
;
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box4
[
"npcType"
]
=
"box4"
;
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box5
[
"npcType"
]
=
"box5"
;
this
.
frontBoxs
=
[
this
.
box1
,
this
.
box2
,
this
.
box3
,
this
.
box4
];
for
(
var
i
=
0
;
i
<
this
.
frontBoxs
.
length
;
i
++
)
{
if
(
i
==
0
)
{
this
.
frontBoxs
[
i
].
x
=
initX
;
}
else
{
this
.
frontBoxs
[
i
].
x
=
this
.
frontBoxs
[
i
-
1
].
x
-
this
.
box1
.
width
-
props
.
frontmargin
;
}
this
.
frontBoxs
[
i
].
y
=
initY
;
this
.
addChild
(
this
.
frontBoxs
[
i
]);
}
this
.
addEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
frameMove
,
this
);
};
FrontBoxs
.
prototype
.
frameMove
=
function
()
{
var
_this
=
this
;
this
.
frontBoxs
.
forEach
(
function
(
item
,
index
)
{
item
.
x
+=
props
.
moveSpeed
;
if
(
item
.
x
<=
0
&&
!
item
.
visible
)
{
item
.
visible
=
true
;
}
if
(
item
.
x
>=
750
)
{
var
lastitem
=
_this
.
frontBoxs
.
shift
();
lastitem
.
x
=
_this
.
frontBoxs
[
_this
.
frontBoxs
.
length
-
1
].
x
-
_this
.
box1
.
width
-
props
.
frontmargin
;
if
(
!
_this
.
GameView
.
getMoveX
()
&&
item
.
x
<=
0
)
{
_this
.
GameView
.
setMoveX
((
370
-
item
.
x
-
13
)
/
props
.
moveSpeed
,
item
);
_this
.
hideBox
=
item
;
}
_this
.
frontBoxs
.
push
(
lastitem
);
}
});
};
FrontBoxs
.
prototype
.
stop
=
function
()
{
};
FrontBoxs
.
prototype
.
showHidePrizeBox
=
function
(
isshow
)
{
this
.
hideBox
.
visible
=
isshow
;
};
return
FrontBoxs
;
}(
engine
.
Container
));
var
BackBoxs
=
(
function
(
_super
)
{
tslib
.
__extends
(
BackBoxs
,
_super
);
function
BackBoxs
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
backBoxs
=
[];
return
_this
;
}
BackBoxs
.
prototype
.
setup
=
function
()
{
var
initX
,
initY
=
0
;
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
initX
=
this
.
box1
.
x
=
188
;
initY
=
this
.
box1
.
y
=
706
;
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
backBoxs
=
[
this
.
box1
,
this
.
box2
,
this
.
box3
,
this
.
box4
,
this
.
box5
];
for
(
var
i
=
0
;
i
<
this
.
backBoxs
.
length
;
i
++
)
{
this
.
backBoxs
[
i
].
scaleX
=
0.5
;
this
.
backBoxs
[
i
].
scaleY
=
0.5
;
if
(
i
==
0
)
{
this
.
backBoxs
[
i
].
x
=
initX
;
}
else
{
this
.
backBoxs
[
i
].
x
=
this
.
backBoxs
[
i
-
1
].
x
+
this
.
backBoxs
[
i
].
width
+
props
.
backmargin
;
}
this
.
backBoxs
[
i
].
y
=
initY
;
this
.
addChild
(
this
.
backBoxs
[
i
]);
}
this
.
addEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
frameMove
,
this
);
};
BackBoxs
.
prototype
.
frameMove
=
function
()
{
var
_this
=
this
;
this
.
backBoxs
.
forEach
(
function
(
item
)
{
item
.
x
-=
props
.
moveSpeed
;
if
(
item
.
x
<=
0
)
{
var
lastitem
=
_this
.
backBoxs
.
shift
();
lastitem
.
x
=
_this
.
backBoxs
[
_this
.
backBoxs
.
length
-
1
].
x
+
item
.
width
+
props
.
backmargin
;
_this
.
backBoxs
.
push
(
lastitem
);
}
});
};
return
BackBoxs
;
}(
engine
.
Container
));
//# sourceMappingURL=backBox.js.map
var
Zhuazi
=
(
function
(
_super
)
{
tslib
.
__extends
(
Zhuazi
,
_super
);
function
Zhuazi
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
moveArr
=
[];
_this
.
prizeBoxs
=
[];
return
_this
;
}
Zhuazi
.
prototype
.
setup
=
function
()
{
this
.
ganNode
=
new
engine
.
Container
();
this
.
moveNode
=
new
engine
.
Container
();
this
.
ganNode
.
x
=
280
;
this
.
ganNode
.
y
=
425
;
this
.
bashouGan
=
new
engine
.
Sprite
(
getTextureByName
(
"把手杆子"
));
this
.
bashouGan
.
x
=
60
;
this
.
bashouGan
.
y
=
342
;
this
.
bashou
=
new
engine
.
Sprite
(
getTextureByName
(
"把手"
));
this
.
bashou
.
x
=
0
;
this
.
bashou
.
y
=
320
;
this
.
ganzi
=
new
engine
.
Sprite
(
getTextureByName
(
"伸缩杆"
));
this
.
ganzi
.
x
=
97
;
this
.
ganzi
.
y
=
382
;
this
.
connect
=
new
engine
.
Sprite
(
getTextureByName
(
"连接点"
));
this
.
connect
.
x
=
20
;
this
.
connect
.
y
=
0
;
this
.
left_zhuazi
=
new
engine
.
Sprite
(
getTextureByName
(
"左爪"
));
this
.
left_zhuazi
.
x
=
0
;
this
.
left_zhuazi
.
y
=
60
;
this
.
left_zhuazi
.
anchorX
=
this
.
left_zhuazi
.
width
;
this
.
left_zhuazi
.
anchorY
=
0
;
this
.
left_zhuazi
.
rotation
=
30
;
this
.
right_zhuazi
=
new
engine
.
Sprite
(
getTextureByName
(
"右爪"
));
this
.
right_zhuazi
.
x
=
83
;
this
.
right_zhuazi
.
y
=
60
;
this
.
right_zhuazi
.
rotation
=
-
30
;
this
.
ganNode
.
addChild
(
this
.
left_zhuazi
);
this
.
ganNode
.
addChild
(
this
.
right_zhuazi
);
this
.
ganNode
.
addChild
(
this
.
connect
);
this
.
ganNode
.
x
=
30
;
this
.
zhuaziY
=
this
.
ganNode
.
y
;
this
.
moveNode
.
addChild
(
this
.
ganzi
);
this
.
moveNode
.
addChild
(
this
.
ganNode
);
this
.
moveNode
.
addChild
(
this
.
bashou
);
this
.
moveNode
.
x
=
262
;
this
.
addChild
(
this
.
bashouGan
);
this
.
addChild
(
this
.
moveNode
);
this
.
createPrizeBox
();
};
Zhuazi
.
prototype
.
createPrizeBox
=
function
()
{
var
_this
=
this
;
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box1
[
"npcType"
]
=
"box1"
;
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box2
[
"npcType"
]
=
"box2"
;
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box3
[
"npcType"
]
=
"box3"
;
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box4
[
"npcType"
]
=
"box4"
;
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box5
[
"npcType"
]
=
"box5"
;
this
.
prizeBoxs
=
[
this
.
box1
,
this
.
box2
,
this
.
box3
,
this
.
box4
,
this
.
box5
];
this
.
prizeBoxs
.
forEach
(
function
(
item
)
{
_this
.
ganNode
.
addChild
(
item
);
item
.
visible
=
false
;
item
.
x
=
-
15
;
item
.
y
=
48
;
});
};
Zhuazi
.
prototype
.
showPrizeBox
=
function
()
{
var
_this
=
this
;
this
.
prizeBoxs
.
forEach
(
function
(
item
)
{
console
.
log
(
_this
.
GameView
.
getBox
()[
'npcType'
]);
if
(
item
[
'npcType'
]
===
_this
.
GameView
.
getBox
()[
'npcType'
])
{
item
.
visible
=
true
;
_this
.
itemShow
=
item
;
}
else
{
item
.
visible
=
false
;
}
});
};
Zhuazi
.
prototype
.
move
=
function
()
{
var
_this
=
this
;
var
rndist
=
Math
.
random
();
var
halfWidth
=
this
.
bashou
.
width
/
2
;
var
randomX
=
rndist
*
(
rndist
>
0.5
?
1
:
-
1
)
*
props
.
bashouMoveDist
;
console
.
log
(
randomX
);
engine
.
Tween
.
get
(
this
.
moveNode
).
to
({
x
:
370
+
halfWidth
-
71
},
1000
).
call
(
function
()
{
_this
.
zhangkai
();
});
};
Zhuazi
.
prototype
.
zhangkai
=
function
()
{
var
_this
=
this
;
this
.
left_zhuazi
.
anchorX
=
this
.
left_zhuazi
.
width
;
this
.
left_zhuazi
.
anchorY
=
0
;
engine
.
Tween
.
get
(
this
.
left_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
props
.
leftRotation
},
1000
);
engine
.
Tween
.
get
(
this
.
right_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
props
.
rightRotation
},
1000
);
setTimeout
(
function
()
{
_this
.
getLong
();
},
500
);
};
Zhuazi
.
prototype
.
getLong
=
function
()
{
var
_this
=
this
;
var
droptime
=
Number
((
this
.
GameView
.
getMoveX
()
/
60
-
1
).
toFixed
(
2
))
*
1000
;
console
.
log
(
'dr'
,
droptime
);
var
times
=
(
props
.
ganMoveEndY
-
this
.
ganzi
.
y
)
/
this
.
ganzi
.
height
;
console
.
log
(
Number
(
times
.
toFixed
(
2
)));
engine
.
Tween
.
get
(
this
.
ganzi
).
to
({
scaleY
:
Number
(
times
.
toFixed
(
2
))
},
droptime
).
to
({
scaleY
:
1
},
droptime
);
console
.
log
(
'node'
,
this
.
zhuaziY
);
engine
.
Tween
.
get
(
this
.
ganNode
).
to
({
y
:
props
.
ganMoveEndY
},
droptime
).
call
(
function
()
{
_this
.
GameView
.
stopMove
();
_this
.
showPrizeBox
();
_this
.
GameView
.
setVisible
(
false
);
}).
to
({
y
:
this
.
zhuaziY
},
droptime
).
call
(
function
()
{
engine
.
globalEvent
.
dispatchEvent
(
'doll-mac-getprize'
);
_this
.
getReset
();
});
};
Zhuazi
.
prototype
.
getReset
=
function
()
{
this
.
itemShow
.
visible
=
false
;
this
.
left_zhuazi
.
anchorX
=
this
.
left_zhuazi
.
width
;
this
.
left_zhuazi
.
anchorY
=
0
;
engine
.
Tween
.
get
(
this
.
moveNode
,
{
loop
:
false
}).
to
({
x
:
262
},
1000
);
engine
.
Tween
.
get
(
this
.
left_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
0
},
1000
);
engine
.
Tween
.
get
(
this
.
right_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
0
},
1000
);
};
return
Zhuazi
;
}(
engine
.
Container
));
//# sourceMappingURL=Zhuazi.js.map
var
ObjectPool$1
=
engine
.
ObjectPool
;
var
GameView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameView
,
_super
);
function
GameView
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
goodsItems
=
[];
_this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
_this
.
setup
,
_this
);
return
_this
;
}
GameView
.
prototype
.
setup
=
function
()
{
if
(
this
.
_hasSetup
)
{
return
;
}
this
.
_hasSetup
=
true
;
var
frontBoxs
=
(
this
.
_frontBoxs
=
new
FrontBoxs
());
this
.
_frontBoxs
.
GameView
=
this
;
var
backBoxs
=
(
this
.
_backBoxs
=
new
BackBoxs
());
this
.
_Zhuazi
=
new
Zhuazi
();
this
.
_Zhuazi
.
GameView
=
this
;
this
.
frontTransfer
=
new
engine
.
Container
();
this
.
backTransfer
=
new
engine
.
Container
();
this
.
frontTransfer
.
width
=
0
;
this
.
frontTransfer
.
height
=
0
;
this
.
frontTransfer
.
alpha
=
1
;
this
.
backTransfer
.
width
=
0
;
this
.
backTransfer
.
height
=
0
;
this
.
backTransfer
.
alpha
=
1
;
this
.
rect
=
new
engine
.
Rect
();
this
.
rect
.
width
=
611
;
this
.
rect
.
height
=
704
;
this
.
rect
.
x
=
65
;
this
.
rect
.
y
=
267
;
this
.
NpcBg
=
new
engine
.
Container
();
this
.
addChild
(
this
.
NpcBg
);
this
.
addChild
(
this
.
rect
);
var
gameBg
=
new
engine
.
Sprite
(
getTextureByName
(
"游戏背景"
));
gameBg
.
x
=
65
;
gameBg
.
y
=
267
;
this
.
NpcBg
.
addChild
(
gameBg
);
this
.
frontDesk
=
new
engine
.
Sprite
(
getTextureByName
(
"前传输带"
));
this
.
frontDesk
.
x
=
60
;
this
.
frontDesk
.
y
=
904
;
this
.
backDesk
=
new
engine
.
Sprite
(
getTextureByName
(
"后传输带"
));
this
.
backDesk
.
x
=
60
;
this
.
backDesk
.
y
=
810
;
this
.
NpcBg
.
addChild
(
this
.
backDesk
);
this
.
NpcBg
.
addChild
(
this
.
frontDesk
);
this
.
NpcBg
.
addChild
(
this
.
backTransfer
);
this
.
NpcBg
.
addChild
(
this
.
frontTransfer
);
this
.
NpcBg
.
addChild
(
this
.
_Zhuazi
);
this
.
NpcBg
.
mask
=
this
.
rect
;
this
.
_Zhuazi
.
setup
();
this
.
backTransfer
.
addChild
(
this
.
_backBoxs
);
this
.
_backBoxs
.
setup
();
this
.
frontTransfer
.
addChild
(
this
.
_frontBoxs
);
this
.
_frontBoxs
.
setup
();
};
GameView
.
prototype
.
stopMove
=
function
()
{
this
.
_frontBoxs
.
stop
();
};
GameView
.
prototype
.
setMoveX
=
function
(
x
,
item
)
{
this
.
moveTime
=
x
;
this
.
prizeBox
=
item
;
this
.
_Zhuazi
.
move
();
};
GameView
.
prototype
.
setVisible
=
function
(
isshow
)
{
this
.
_frontBoxs
.
showHidePrizeBox
(
isshow
);
};
GameView
.
prototype
.
getMoveX
=
function
()
{
console
.
log
(
222
);
return
this
.
moveTime
;
};
GameView
.
prototype
.
getBox
=
function
()
{
return
this
.
prizeBox
;
};
GameView
.
prototype
.
reset
=
function
()
{
this
.
recycleGoods
();
this
.
_Zhuazi
.
getReset
();
};
GameView
.
prototype
.
start
=
function
()
{
var
_this
=
this
;
this
.
score
=
0
;
this
.
speed
=
1
;
this
.
gameIng
=
true
;
this
.
countdown
=
props
.
countDown
;
this
.
countdownTimer
=
setInterval
(
function
()
{
if
(
_this
.
gameIng
)
{
if
(
_this
.
countdown
>
0
)
{
engine
.
globalEvent
.
dispatchEvent
(
"food-fell-time-update"
,
{
time
:
_this
.
countdown
});
_this
.
countdown
-=
1
;
}
else
{
engine
.
globalEvent
.
dispatchEvent
(
"food-fell-game-over"
,
{
score
:
_this
.
score
,
reason
:
1
});
_this
.
died
();
}
}
},
1000
);
};
GameView
.
prototype
.
beginNpc
=
function
()
{
var
_this
=
this
;
this
.
timer
=
setTimeout
(
function
()
{
if
(
_this
.
gameIng
)
;
},
2000
/
this
.
speed
);
};
GameView
.
prototype
.
pause
=
function
()
{
this
.
gameIng
=
false
;
};
GameView
.
prototype
.
revive
=
function
()
{
this
.
gameIng
=
true
;
};
GameView
.
prototype
.
resume
=
function
()
{
this
.
reset
();
this
.
start
();
};
GameView
.
prototype
.
initNpc
=
function
()
{
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box1
.
x
=
120
;
this
.
box1
.
y
=
434
;
this
.
box2
.
x
=
306
;
this
.
box2
.
y
=
434
;
this
.
box3
.
x
=
487
;
this
.
box3
.
y
=
434
;
this
.
box4
.
x
=
240
;
this
.
box4
.
scaleX
=
0.5
;
this
.
box4
.
scaleY
=
0.5
;
this
.
box4
.
y
=
390
;
this
.
box5
.
x
=
434
;
this
.
box5
.
y
=
390
;
this
.
box5
.
scaleX
=
0.5
;
this
.
box5
.
scaleY
=
0.5
;
this
.
backTransfer
.
addChild
(
this
.
box4
);
this
.
backTransfer
.
addChild
(
this
.
box5
);
this
.
frontTransfer
.
addChild
(
this
.
box1
);
this
.
frontTransfer
.
addChild
(
this
.
box2
);
this
.
frontTransfer
.
addChild
(
this
.
box3
);
};
GameView
.
prototype
.
died
=
function
()
{
this
.
score
=
0
;
this
.
pause
();
};
GameView
.
prototype
.
removeNpc
=
function
(
goods
)
{
this
.
NpcBg
.
removeChild
(
goods
);
ObjectPool$1
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
var
index
=
this
.
goodsItems
.
indexOf
(
goods
);
if
(
index
>
-
1
)
{
this
.
goodsItems
.
splice
(
index
,
1
);
}
};
GameView
.
prototype
.
recycleGoods
=
function
()
{
clearTimeout
(
this
.
timer
);
clearInterval
(
this
.
countdownTimer
);
for
(
var
_i
=
0
,
_a
=
this
.
goodsItems
;
_i
<
_a
.
length
;
_i
++
)
{
var
goods
=
_a
[
_i
];
if
(
goods
)
{
this
.
removeChild
(
goods
);
ObjectPool$1
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
}
this
.
goodsItems
=
[];
};
GameView
.
prototype
.
hasHit
=
function
(
a
,
b
)
{
if
(
Math
.
abs
(
a
.
x
+
a
.
width
/
2
-
(
b
.
x
+
b
.
width
/
2
))
<
a
.
width
/
2
+
b
.
width
/
2
&&
Math
.
abs
(
a
.
y
+
a
.
height
/
2
-
(
b
.
y
+
b
.
height
/
2
))
<
a
.
height
/
2
+
b
.
height
/
2
)
{
return
true
;
}
else
{
return
false
;
}
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
function
GameWrapper
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
engine
.
globalEvent
.
addEventListener
(
'doll-machine-reset'
,
_this
.
reset
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-start'
,
_this
.
start
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-pause'
,
_this
.
pause
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-resume'
,
_this
.
resume
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-revive'
,
_this
.
revive
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-clear'
,
_this
.
clear
,
_this
);
_this
.
addEventListener
(
engine
.
MouseEvent
.
CLICK
,
_this
.
onTap
,
_this
);
var
gameView
=
_this
.
_gameView
=
new
GameView
();
_this
.
addChild
(
gameView
);
return
_this
;
}
GameWrapper
.
prototype
.
reset
=
function
(
event
)
{
injectProps
(
event
.
data
);
this
.
_gameView
.
visible
=
true
;
this
.
_gameView
.
reset
();
};
GameWrapper
.
prototype
.
start
=
function
(
event
)
{
injectProps
(
event
.
data
);
this
.
_status
=
1
;
this
.
_gameView
.
start
();
};
GameWrapper
.
prototype
.
pause
=
function
()
{
this
.
_gameView
.
pause
();
};
GameWrapper
.
prototype
.
resume
=
function
()
{
this
.
_gameView
.
resume
();
};
GameWrapper
.
prototype
.
revive
=
function
()
{
this
.
_gameView
.
revive
();
};
GameWrapper
.
prototype
.
clear
=
function
()
{
this
.
_gameView
.
visible
=
false
;
};
GameWrapper
.
prototype
.
onTap
=
function
(
event
)
{
};
return
GameWrapper
;
}(
engine
.
Container
));
//# sourceMappingURL=GameWrapper.js.map
function
index
(
props
)
{
prepareProps
();
injectProps
(
props
);
var
instance
=
new
GameWrapper
();
return
instance
;
}
//# sourceMappingURL=index.js.map
return
index
;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
src/custom/doll-machine/debug/main.js.map
0 → 100644
View file @
b9593434
{"version":3,"file":"index.js","sources":["src/custom/doll-machine/src/props.ts","src/custom/doll-machine/src/game/utils.ts","src/custom/doll-machine/src/game/Goods.ts","src/custom/doll-machine/src/game/object-pool-init.ts","src/custom/doll-machine/src/game/frontBox.ts","src/custom/doll-machine/src/game/backBox.ts","src/custom/doll-machine/src/game/Zhuazi.ts","src/custom/doll-machine/src/game/GameView.ts","src/custom/doll-machine/src/game/GameWrapper.ts","src/custom/doll-machine/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport function getTexture(uuid) {\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\n}\n\nexport function getTextureByName(name) {\n\treturn getTexture(engine.getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport { getTextureByName } from \"./utils\";\nimport { props } from \"../props\";\n\nexport class Goods extends engine.Container {\n private _body: engine.Rect;\n private _toY;\n\n constructor() {\n super();\n\n let body;\n body = this._body = new engine.Rect();\n\n // let rain = new engine.Sprite(getTextureByName('雨滴'));\n // rain[\"npcType\"]=\"rain\"\n // let stone = new engine.Sprite(getTextureByName('石块'));\n // stone[\"npcType\"]=\"stone\"\n // let boom = new engine.Sprite(getTextureByName('炸弹'));\n // boom[\"npcType\"]=\"boom\"\n\n let box1 = new engine.Sprite(getTextureByName(\"草泥马盒\"));\n box1[\"npcType\"] = \"box1\";\n let box2 = new engine.Sprite(getTextureByName(\"狗盒\"));\n box2[\"npcType\"] = \"box2\";\n let box3 = new engine.Sprite(getTextureByName(\"猫盒\"));\n box3[\"npcType\"] = \"box3\";\n\n // rain.visible=false;\n // stone.visible=false;\n // boom.visible=false;\n // body.addChild(rain)\n // body.addChild(stone)\n // body.addChild(boom)\n\n box1.visible = false;\n box2.visible = false;\n box3.visible = false;\n body.addChild(box1);\n body.addChild(box2);\n body.addChild(box3);\n\n this.addChild(body);\n body.width = 0.0001;\n body.height = 0.0001;\n body.mouseEnabled = false;\n }\n\n getRandomNumberByRange(start, end) {\n return Math.floor(Math.random() * (end - start) + start);\n }\n\n // reset() {\n // \tthis.visible = true;\n // \tthis.rotation = 0;\n // \tthis.anchorOffsetY = 0;\n // \tthis.y = 0;\n // \tthis.x = (750-120)*Math.random()+30;\n // \tthis.rotation = 0;\n // \tlet random=Math.random()\n\n // \tif(random<props.goodsProbability[0]){\n // \t\tthis.showNpc(\"box1\")\n // \t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n // \t\tthis.showNpc(\"box2\")\n // \t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1])){\n // \t\tthis.showNpc(\"box3\")\n // \t}\n // }\n\n reset() {\n this.visible = true;\n this.y = 200;\n this.x = 0;\n this.rotation = 0;\n let random = Math.random();\n if (random < 0.3) {\n this.showNpc(\"box1\");\n } else if (random < 0.6) {\n this.showNpc(\"box2\");\n } else {\n this.showNpc(\"box3\");\n }\n // this.showNpc(\"box1\");\n // this.showNpc(\"box2\");\n // this.showNpc(\"box3\");\n }\n\n showNpc(type) {\n for (let i = 0; i < this._body.children.length; i++) {\n this._body.children[i].visible = false;\n this._body.children[i].mouseEnabled = false;\n }\n for (let i = 0; i < this._body.children.length; i++) {\n if (this._body.children[i][\"npcType\"] == type) {\n this[\"npcType\"] = type;\n console.log(type);\n\n this._body.children[i].visible = true;\n this._body.children[i].mouseEnabled = false;\n }\n }\n }\n\n set anchorOffsetY(v) {\n this._body.y = v;\n }\n}\n","/**\n * Created by rockyl on 2020-02-03.\n */\n\nimport {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","import { getTextureByName } from \"./utils\";\nimport GameView from './GameView';\nimport { props } from \"../props\";\nexport class FrontBoxs extends engine.Container {\n //盒子1\n private box1: engine.Container;\n //盒子2\n private box2: engine.Container;\n //盒子3\n private box3: engine.Container;\n //盒子4\n private box4: engine.Container;\n //盒子5\n private box5: engine.Container;\n // 需隐藏的盒子\n private hideBox: engine.Container;\n private frontBoxs=[];\n public GameView: GameView;\n constructor() {\n super();\n }\n setup() {\n let initX , initY = 0;\n this.box1 = new engine.Sprite(getTextureByName(\"狗盒\"));\n this.box1[\"npcType\"] = \"box1\";\n initX = this.box1.x = 435;\n initY = this.box1.y = 734;\n\n this.box2 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box2[\"npcType\"] = \"box2\";\n this.box3 = new engine.Sprite(getTextureByName(\"草泥马盒\"));\n this.box3[\"npcType\"] = \"box3\";\n this.box4 = new engine.Sprite(getTextureByName(\"狗盒\"));\n this.box4[\"npcType\"] = \"box4\";\n this.box5 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box5[\"npcType\"] = \"box5\";\n this.frontBoxs = [this.box1, this.box2, this.box3, this.box4];\n for(let i = 0; i < this.frontBoxs.length; i++) {\n if(i == 0) {\n this.frontBoxs[i].x = initX ;\n } else {\n this.frontBoxs[i].x = this.frontBoxs[i - 1].x - this.box1.width - props.frontmargin;\n }\n \n this.frontBoxs[i].y = initY;\n this.addChild(this.frontBoxs[i]);\n }\n this.addEventListener(engine.Event.ENTER_FRAME, this.frameMove, this);\n }\n frameMove() {\n this.frontBoxs.forEach((item, index) => {\n item.x += props.moveSpeed;\n if(item.x <=0 && !item.visible) {\n item.visible = true;\n }\n if(item.x >= 750) {\n let lastitem = this.frontBoxs.shift();\n lastitem.x = this.frontBoxs[this.frontBoxs.length - 1].x - this.box1.width - props.frontmargin;\n \n if(!this.GameView.getMoveX() && item.x <= 0) {\n this.GameView.setMoveX((370 - item.x - 13) / props.moveSpeed, item);\n this.hideBox = item;\n }\n this.frontBoxs.push(lastitem);\n }\n })\n }\n stop() {\n // this.removeEventListener(engine.Event.ENTER_FRAME, this.frameMove, this);\n }\n showHidePrizeBox(isshow) {\n this.hideBox.visible = isshow\n }\n}","import { getTextureByName } from \"./utils\";\nimport { props } from \"../props\";\nexport class BackBoxs extends engine.Container {\n //盒子1\n private box1: engine.Container;\n //盒子2\n private box2: engine.Container;\n //盒子3\n private box3: engine.Container;\n //盒子4\n private box4: engine.Container;\n //盒子5\n private box5: engine.Container;\n private backBoxs=[];\n constructor() {\n super();\n }\n setup() {\n let initX , initY = 0;\n this.box1 = new engine.Sprite(getTextureByName(\"狗盒\"));\n initX = this.box1.x = 188;\n initY = this.box1.y = 706;\n\n this.box2 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box3 = new engine.Sprite(getTextureByName(\"草泥马盒\"));\n this.box4 = new engine.Sprite(getTextureByName(\"狗盒\"));\n this.box5 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.backBoxs = [this.box1, this.box2, this.box3, this.box4, this.box5];\n for (let i = 0; i < this.backBoxs.length; i++) {\n this.backBoxs[i].scaleX = 0.5;\n this.backBoxs[i].scaleY = 0.5;\n if(i == 0) {\n this.backBoxs[i].x = initX;\n } else {\n this.backBoxs[i].x = this.backBoxs[i - 1].x + this.backBoxs[i].width + props.backmargin;\n }\n this.backBoxs[i].y = initY;\n \n this.addChild(this.backBoxs[i]);\n }\n this.addEventListener(engine.Event.ENTER_FRAME, this.frameMove, this);\n }\n frameMove() {\n this.backBoxs.forEach((item) => {\n item.x -= props.moveSpeed;\n if (item.x <= 0) {\n let lastitem = this.backBoxs.shift();\n lastitem.x = this.backBoxs[this.backBoxs.length - 1].x + item.width + props.backmargin;\n this.backBoxs.push(lastitem);\n }\n })\n }\n}","import { getTextureByName } from \"./utils\";\nimport { props } from \"../props\";\nimport GameView from './GameView';\nexport class Zhuazi extends engine.Container {\n private bashouGan: engine.Sprite;\n private bashou: engine.Sprite;\n private ganzi: engine.Sprite;\n private left_zhuazi: engine.Sprite;\n private right_zhuazi: engine.Sprite;\n private connect: engine.Sprite;\n private ganNode: engine.Container;\n private moveNode: engine.Container;\n private moveArr = [];\n private zhuaziY;\n //盒子1\n private box1: engine.Container;\n //盒子2\n private box2: engine.Container;\n //盒子3\n private box3: engine.Container;\n //盒子4\n private box4: engine.Container;\n //盒子5\n private box5: engine.Container;\n private itemShow: engine.Container;\n private prizeBoxs = [];\n public GameView: GameView;\n constructor() {\n super();\n }\n setup() {\n this.ganNode = new engine.Container();\n this.moveNode = new engine.Container();\n this.ganNode.x = 280;\n this.ganNode.y = 425;\n this.bashouGan = new engine.Sprite(getTextureByName(\"把手杆子\"));\n this.bashouGan.x = 60;\n this.bashouGan.y = 342;\n this.bashou = new engine.Sprite(getTextureByName(\"把手\"));\n this.bashou.x = 0;\n this.bashou.y = 320;\n this.ganzi = new engine.Sprite(getTextureByName(\"伸缩杆\"));\n this.ganzi.x = 97;\n this.ganzi.y = 382;\n this.connect = new engine.Sprite(getTextureByName(\"连接点\"));\n this.connect.x = 20;\n this.connect.y = 0;\n this.left_zhuazi = new engine.Sprite(getTextureByName(\"左爪\"));\n this.left_zhuazi.x = 0;\n this.left_zhuazi.y = 60;\n this.left_zhuazi.anchorX = this.left_zhuazi.width;\n this.left_zhuazi.anchorY = 0;\n this.left_zhuazi.rotation = 30;\n this.right_zhuazi = new engine.Sprite(getTextureByName(\"右爪\"));\n this.right_zhuazi.x = 83;\n this.right_zhuazi.y = 60;\n this.right_zhuazi.rotation = -30;\n this.ganNode.addChild(this.left_zhuazi);\n this.ganNode.addChild(this.right_zhuazi);\n this.ganNode.addChild(this.connect);\n this.ganNode.x = 30;\n this.zhuaziY = this.ganNode.y;\n this.moveNode.addChild(this.ganzi);\n this.moveNode.addChild(this.ganNode);\n this.moveNode.addChild(this.bashou);\n this.moveNode.x = 262;\n // this.moveNode.\n // this.moveArr = [this.bashou, this.ganzi, this.ganNode];\n this.addChild(this.bashouGan);\n // this.addChild(this.ganzi);\n // this.addChild(this.bashou);\n // this.addChild(this.ganNode);\n this.addChild(this.moveNode);\n this.createPrizeBox();\n // setTimeout(() => {\n // this.move();\n // }, 2000)\n \n }\n createPrizeBox() {\n this.box1 = new engine.Sprite(getTextureByName(\"狗盒\"));\n this.box1[\"npcType\"] = \"box1\";\n this.box2 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box2[\"npcType\"] = \"box2\";\n this.box3 = new engine.Sprite(getTextureByName(\"草泥马盒\"));\n this.box3[\"npcType\"] = \"box3\";\n this.box4 = new engine.Sprite(getTextureByName(\"狗盒\"));\n this.box4[\"npcType\"] = \"box4\";\n this.box5 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box5[\"npcType\"] = \"box5\";\n this.prizeBoxs = [this.box1, this.box2, this.box3, this.box4, this.box5];\n this.prizeBoxs.forEach(item => {\n this.ganNode.addChild(item);\n item.visible = false;\n item.x = -15;\n item.y = 48;\n })\n }\n showPrizeBox() {\n\n this.prizeBoxs.forEach(item => {\n console.log(this.GameView.getBox()['npcType']);\n if (item['npcType'] === this.GameView.getBox()['npcType']) {\n item.visible = true;\n this.itemShow = item;\n } else {\n item.visible = false;\n }\n })\n \n }\n move() {\n let rndist = Math.random();\n let halfWidth = this.bashou.width / 2;\n let randomX = rndist * (rndist > 0.5 ? 1 : -1) * props.bashouMoveDist;\n console.log(randomX);\n engine.Tween.get(this.moveNode).to({ x: 370 + halfWidth - 71}, 1000).call(() => {\n this.zhangkai();\n });\n // this.moveArr.forEach((item,index) => {\n // engine.Tween.get(item).to({ x: item.x +randomX}, 500).to({x: 370}, 500).call(() => {\n // if (index == this.moveArr.length-1) {\n // this.zhangkai();\n // }\n // });\n // })\n }\n zhangkai() {\n this.left_zhuazi.anchorX = this.left_zhuazi.width;\n this.left_zhuazi.anchorY = 0;\n engine.Tween.get(this.left_zhuazi, { loop: false }).to({ rotation: props.leftRotation}, 1000);\n engine.Tween.get(this.right_zhuazi, { loop: false }).to({ rotation: props.rightRotation }, 1000);\n setTimeout(() => {\n this.getLong();\n }, 500);\n }\n getLong() {\n let droptime = Number((this.GameView.getMoveX() / 60 - 1).toFixed(2)) * 1000;\n console.log('dr', droptime);\n let times = (props.ganMoveEndY - this.ganzi.y ) / this.ganzi.height;\n console.log(Number(times.toFixed(2)) );\n engine.Tween.get(this.ganzi).to({ scaleY: Number(times.toFixed(2)) }, droptime).to({ scaleY: 1 }, droptime)\n console.log('node', this.zhuaziY);\n engine.Tween.get(this.ganNode).to({ y: props.ganMoveEndY }, droptime).call(() => {\n this.GameView.stopMove();\n this.showPrizeBox();\n this.GameView.setVisible(false);\n }).to({ y: this.zhuaziY }, droptime).call(() => {\n engine.globalEvent.dispatchEvent('doll-mac-getprize');\n this.getReset();\n })\n\n // .to({ scaleY: 1 }, droptime)\n // to({ y: this.zhuaziY }, droptime)\n }\n getReset() {\n this.itemShow.visible = false;\n this.left_zhuazi.anchorX = this.left_zhuazi.width;\n this.left_zhuazi.anchorY = 0;\n engine.Tween.get(this.moveNode, {loop: false}).to({x: 262}, 1000);\n engine.Tween.get(this.left_zhuazi, { loop: false }).to({ rotation: 0 }, 1000);\n engine.Tween.get(this.right_zhuazi, { loop: false }).to({ rotation: 0 }, 1000);\n }\n}","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\nimport { FrontBoxs } from \"./frontBox\";\nimport { BackBoxs } from \"./backBox\";\nimport { Zhuazi } from './Zhuazi';\n\nexport default class GameView extends engine.Container {\n private _hasSetup;\n\n //触摸层\n private rectBg: engine.Rect;\n //npc层\n private NpcBg: engine.Container;\n //盒子1\n private box1: engine.Container;\n //盒子2\n private box2: engine.Container;\n //盒子3\n private box3: engine.Container;\n //盒子4\n private box4: engine.Container;\n //盒子5\n private box5: engine.Container;\n //前传输区域\n private frontTransfer: engine.Container;\n //后传输区域\n private backTransfer: engine.Container;\n //前台板\n private frontDesk: engine.Sprite;\n //后台板\n private backDesk: engine.Sprite;\n private _frontBoxs: FrontBoxs;\n\tprivate _backBoxs: BackBoxs;\n\tprivate _Zhuazi: Zhuazi;\n\tprivate prizeBox: engine.Container;\n\tprivate rect;\n //当前分数\n\tprivate score;\n\t\n\t//中奖盒子移动距离\n\tprivate moveTime;\n\n //游戏状态\n private gameIng;\n\n //npc出身计时器\n private timer;\n //倒计时计时器\n private countdownTimer: any;\n //倒计时\n private countdown: number;\n\n //当前速度\n private speed: number;\n\n // 当前场景上面的物品\n private goodsItems = [];\n\n private _goods: Goods;\n\n constructor() {\n super();\n this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n }\n\n // private waterSvga;\n // private boomSvga;\n // private playerSvga;\n\n setup() {\n if (this._hasSetup) {\n return;\n }\n\n this._hasSetup = true;\n\t\tconst frontBoxs = (this._frontBoxs = new FrontBoxs());\n\t\tthis._frontBoxs.GameView = this;\n\t\tconst backBoxs = (this._backBoxs = new BackBoxs());\n\t\tthis._Zhuazi = new Zhuazi();\n\t\tthis._Zhuazi.GameView = this;\n this.frontTransfer = new engine.Container();\n this.backTransfer = new engine.Container();\n this.frontTransfer.width = 0;\n this.frontTransfer.height = 0;\n this.frontTransfer.alpha = 1;\n // this.frontTransfer.x = 0;\n // this.frontTransfer.y = 434;\n\n this.backTransfer.width = 0;\n this.backTransfer.height = 0;\n this.backTransfer.alpha = 1;\n // this.backTransfer.x = 0;\n // this.backTransfer.y = 390;\n\t\tthis.rect = new engine.Rect();\n\t\t// this.rect.width = 608;\n\t\tthis.rect.width = 611;\n\t\tthis.rect.height = 704;\n\t\t// this.rect.x = 71;\n\t\t// this.rect.y = 263;\n\t\tthis.rect.x = 65;\n\t\tthis.rect.y = 267;\n this.NpcBg = new engine.Container();\n // this.NpcBg.alpha = 1;\n // this.NpcBg.width = 0;\n\t\t// this.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg);\n\t\tthis.addChild(this.rect);\n\t\t\n\t\t\n\t\t\n\t\tlet gameBg = new engine.Sprite(getTextureByName(\"游戏背景\"));\n\t\tgameBg.x = 65;\n\t\tgameBg.y = 267;\n\t\tthis.NpcBg.addChild(gameBg);\n\t\t\n this.frontDesk = new engine.Sprite(getTextureByName(\"前传输带\"));\n this.frontDesk.x = 60;\n this.frontDesk.y = 904;\n\n this.backDesk = new engine.Sprite(getTextureByName(\"后传输带\"));\n this.backDesk.x = 60;\n this.backDesk.y = 810;\n\n this.NpcBg.addChild(this.backDesk);\n this.NpcBg.addChild(this.frontDesk);\n this.NpcBg.addChild(this.backTransfer);\n\t\tthis.NpcBg.addChild(this.frontTransfer);\n\t\tthis.NpcBg.addChild(this._Zhuazi);\n\n\t\tthis.NpcBg.mask = this.rect;\n\t\tthis._Zhuazi.setup();\n\t\t\n\t\t// this._Zhuazi.move();\n\t\tthis.backTransfer.addChild(this._backBoxs);\n\t\tthis._backBoxs.setup();\n\t\tthis.frontTransfer.addChild(this._frontBoxs);\n\t\tthis._frontBoxs.setup();\n\n //\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n //console.log(this.player.fillColor)\n\n // this.rectBg = new engine.Rect();\n // this.rectBg.alpha = 0;\n // this.rectBg.width = 750;\n // this.rectBg.height = 1624;\n // this.addChild(this.rectBg);\n\t}\n\t/**\n\t * \n\t * @param 暂停move\n\t */\n\tstopMove() {\n\t\tthis._frontBoxs.stop();\n\t}\n\t/**\n\t * 赋值x距离值\n\t */\n\tsetMoveX(x, item) {\n\t\tthis.moveTime = x;\n\t\tthis.prizeBox = item;\n\t\tthis._Zhuazi.move();\n\t}\n\t/**\n\t * 显示隐藏盒子\n\t */\n\tsetVisible(isshow) {\n\t\tthis._frontBoxs.showHidePrizeBox(isshow);\n\t}\n\t/**\n\t * 获取中奖盒子移动的距离\n\t */\n\tgetMoveX() {\n\t\tconsole.log(222);\n\t\treturn this.moveTime;\n\t}\n\t/**\n\t * 获取中奖盒子\n\t */\n\tgetBox() {\n\t\treturn this.prizeBox;\n\t}\n /**\n * 重置场景\n */\n reset() {\n\t\tthis.recycleGoods();\n\t\tthis._Zhuazi.getReset();\n }\n\n /**\n * 开始\n */\n start() {\n this.score = 0;\n this.speed = 1;\n this.gameIng = true;\n // this.creatNpc()\n // this.beginNpc();\n this.countdown = props.countDown;\n\n this.countdownTimer = setInterval(() => {\n if (this.gameIng) {\n if (this.countdown > 0) {\n engine.globalEvent.dispatchEvent(\"food-fell-time-update\", {\n time: this.countdown\n });\n this.countdown -= 1;\n } else {\n engine.globalEvent.dispatchEvent(\"food-fell-game-over\", {\n score: this.score,\n reason: 1\n });\n this.died();\n }\n }\n }, 1000);\n }\n\n /**\n * npc开始掉落\n */\n beginNpc() {\n this.timer = setTimeout(() => {\n if (this.gameIng) {\n // this.speed += props.acceleratedSpeed;\n // this.creatNpc()\n }\n //递归执行\n // this.beginNpc();\n }, 2000 / this.speed);\n }\n\n /**\n * 暂停\n */\n pause() {\n this.gameIng = false;\n }\n\n /**\n * 恢复\n */\n revive() {\n this.gameIng = true;\n }\n\n /**\n * 重新开始\n */\n resume() {\n this.reset();\n this.start();\n }\n\n /**\n * 初始化盒子位置\n */\n initNpc() {\n this.box1 = new engine.Sprite(getTextureByName(\"草泥马盒\"));\n this.box2 = new engine.Sprite(getTextureByName(\"狗盒\"));\n this.box3 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box4 = new engine.Sprite(getTextureByName(\"草泥马盒\"));\n this.box5 = new engine.Sprite(getTextureByName(\"猫盒\"));\n this.box1.x = 120;\n this.box1.y = 434;\n this.box2.x = 306;\n this.box2.y = 434;\n this.box3.x = 487;\n this.box3.y = 434;\n this.box4.x = 240;\n this.box4.scaleX = 0.5;\n this.box4.scaleY = 0.5;\n this.box4.y = 390;\n this.box5.x = 434;\n this.box5.y = 390;\n this.box5.scaleX = 0.5;\n this.box5.scaleY = 0.5;\n this.backTransfer.addChild(this.box4);\n this.backTransfer.addChild(this.box5);\n this.frontTransfer.addChild(this.box1);\n this.frontTransfer.addChild(this.box2);\n this.frontTransfer.addChild(this.box3);\n }\n\n /**\n * 创建NPC\n */\n // private creatNpc() {\n // // this.initNpc();\n // let goods = (this._goods = <Goods>ObjectPool.getObject(PoolName));\n // console.log(goods);\n // this.goodsItems.push(goods);\n // this.NpcBg.addChild(goods);\n // goods.addEventListener(\n // engine.Event.ENTER_FRAME,\n // (goods[\"onGoodsEnter\"] = () => {\n // if (goods.y > 1624) {\n // this.removeNpc(goods);\n // } else {\n // if (this.gameIng) {\n // //速度叠加\n // // goods.y += (4 * this.speed)\n // goods.x += 2 * this.speed;\n // //如果玩家和物品发生碰撞\n // if (this.hasHit(this.player, goods)) {\n // if (goods[\"npcType\"] == \"rain\") {\n // console.log(\"碰到雨滴\");\n // this.score += props.rainScore;\n // this.waterSvga.visible = true;\n // this.waterSvga.play(false, false);\n // this.waterSvga.once(\n // engine.Event.END_FRAME,\n // () => {\n // this.waterSvga.visible = false;\n // },\n // this\n // );\n // } else if (goods[\"npcType\"] == \"stone\") {\n // console.log(\"碰到石头\");\n // this.score += props.stoneScore;\n // } else if (goods[\"npcType\"] == \"boom\") {\n // console.log(\"碰到炸弹\");\n // this.boomSvga.visible = true;\n // this.boomSvga.play(false, false);\n // this.boomSvga.once(\n // engine.Event.END_FRAME,\n // () => {\n // this.boomSvga.visible = false;\n // },\n // this\n // );\n // engine.globalEvent.dispatchEvent(\"food-fell-game-over\", {\n // score: this.score,\n // reason: 2\n // });\n // this.died();\n // }\n // engine.globalEvent.dispatchEvent(\"food-fell-score-update\", {\n // score: this.score\n // });\n // this.removeNpc(goods);\n // }\n // }\n // }\n // }),\n // this\n // );\n // }\n\n /**\n * 玩家死亡\n */\n private died() {\n this.score = 0;\n this.pause();\n }\n\n /**\n * 回收指定物品\n * @param goods 物品\n */\n private removeNpc(goods) {\n this.NpcBg.removeChild(goods);\n ObjectPool.recycleObject(PoolName, goods);\n goods.removeEventListener(\n engine.Event.ENTER_FRAME,\n goods[\"onGoodsEnter\"],\n this\n );\n let index = this.goodsItems.indexOf(goods);\n if (index > -1) {\n this.goodsItems.splice(index, 1);\n }\n }\n\n /**\n * 回收对象\n */\n private recycleGoods() {\n clearTimeout(this.timer);\n clearInterval(this.countdownTimer);\n for (let goods of this.goodsItems) {\n if (goods) {\n this.removeChild(goods);\n ObjectPool.recycleObject(PoolName, goods);\n goods.removeEventListener(\n engine.Event.ENTER_FRAME,\n goods[\"onGoodsEnter\"],\n this\n );\n }\n }\n this.goodsItems = [];\n }\n\n\n /**\n * 碰撞检测\n * @param a a盒子\n * @param b b盒子\n */\n private hasHit(a, b) {\n if (\n Math.abs(a.x + a.width / 2 - (b.x + b.width / 2)) <\n a.width / 2 + b.width / 2 &&\n Math.abs(a.y + a.height / 2 - (b.y + b.height / 2)) <\n a.height / 2 + b.height / 2\n ) {\n return true;\n } else {\n return false;\n }\n }\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('doll-machine-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('food-fell-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('food-fell-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('food-fell-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('food-fell-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('food-fell-clear', this.clear, this);\n\n\t\tthis.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\t\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tclear() {\n\t\tthis._gameView.visible = false;\n\t}\n\n\tprivate onTap(event) {\n\t//\tthis._gameView.tap(event);\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {GameWrapper} from \"./game/GameWrapper\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance =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AI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;;MAGxB;KAED,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;SAC9B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;SACjB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
src/custom/doll-machine/debug/props.js
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-01-21.
*/
let
customModuleProps
=
{
};
src/custom/doll-machine/meta.json
0 → 100644
View file @
b9593434
{
"name"
:
"口红机"
,
"desc"
:
"口红机模块"
,
"props"
:
{
"frontmargin"
:
{
"alias"
:
"前排娃娃的间距"
,
"type"
:
"number"
,
"default"
:
50
},
"backmargin"
:
{
"alias"
:
"后排娃娃的间距"
,
"type"
:
"number"
,
"default"
:
50
},
"moveSpeed"
:
{
"alias"
:
"娃娃移动的速度"
,
"type"
:
"number"
,
"default"
:
3
},
"bashouMoveDist"
:
{
"alias"
:
"爪子整体左右移动的范围"
,
"type"
:
"number"
,
"default"
:
200
},
"ganMoveEndY"
:
{
"alias"
:
"杆子最后需要移动到的y值位置"
,
"type"
:
"number"
,
"default"
:
700
},
"leftRotation"
:
{
"alias"
:
"左边爪子旋转角度"
,
"type"
:
"number"
,
"default"
:
30
},
"rightRotation"
:
{
"alias"
:
"右边爪子旋转角度"
,
"type"
:
"number"
,
"default"
:
-30
},
"playerPositionY"
:
{
"alias"
:
"玩家Y轴位置"
,
"type"
:
"number"
,
"default"
:
900
},
"rainScore"
:
{
"alias"
:
"接中雨滴获得分数"
,
"type"
:
"number"
,
"default"
:
1
},
"stoneScore"
:
{
"alias"
:
"接中石块获得分数"
,
"type"
:
"number"
,
"default"
:
-1
},
"speed"
:
{
"alias"
:
"道具掉落初始速度"
,
"type"
:
"number"
,
"default"
:
10
},
"maxSpeed"
:
{
"alias"
:
"道具掉落速度上限"
,
"type"
:
"number"
,
"default"
:
3
},
"gameOverCondition"
:
{
"alias"
:
"游戏结束条件(1:接到炸弹死亡,2:分数负数或接到炸弹死亡)"
,
"type"
:
"number"
,
"default"
:
1
}
},
"assets"
:
[
{
"name"
:
"玩家icon"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/50a7212a113175fa18c866b005d98f07c558dc77.png"
,
"uuid"
:
"66f23d13-82a5-4cec-9496-301ec240d087"
,
"ext"
:
".png"
},
{
"name"
:
"雨滴"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/8564c8c9be3aead71b05a0bab8d7d07ac3f778a1.png"
,
"uuid"
:
"264a6192-d7bf-45e8-8f15-6ba2c439a532"
,
"ext"
:
".png"
},
{
"name"
:
"炸弹"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/171e92283cd13c013ee1b76d28d252ff08815d47.png"
,
"uuid"
:
"eb88b42d-e151-4c1b-94b9-7c16f7bfac29"
,
"ext"
:
".png"
},
{
"name"
:
"游戏背景"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/d1f3f60775abfcbd7fdfb3ce525c18977286cd80.png"
,
"uuid"
:
": fe77919b-d5d2-464e-8cbe-d671c82d110c"
,
"ext"
:
".png"
},
{
"name"
:
"草泥马盒"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/cddd0a59964e023ed7c8d77a8f1ad6b90c25d3af.png"
,
"uuid"
:
"34b596f3-9a17-410f-a6b6-c39b91c7b123"
,
"ext"
:
".png"
},
{
"name"
:
"狗盒"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/fd47ea43eb4884ebb8f0bcd095083062871e4f90.png"
,
"uuid"
:
"f78f6bd0-93fd-4965-b18b-32a8e6cd4184"
,
"ext"
:
".png"
},
{
"name"
:
"猫盒"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/596e89d60f5714e311bdc35171b19097efc54fb5.png"
,
"uuid"
:
"8bb254c4-cf2a-47cb-824e-a62ba153518b"
,
"ext"
:
".png"
},
{
"name"
:
"前传输带"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/7bccbc67b3f896176bed7d21c5f4d4307c3919be.png"
,
"uuid"
:
"06bd03a4-43c3-49bb-94c5-6ef365f70291"
,
"ext"
:
".png"
},
{
"name"
:
"后传输带"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/df9b718f80747a1e21349d2b9ac35d5e19a61dad.png"
,
"uuid"
:
"aa0c6ebc-164f-4767-90ca-a79be4316365"
,
"ext"
:
".png"
},
{
"name"
:
"把手杆子"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5a9e4ba7ca6701eae85b6d6dcb0612ecb9a3eff9.png"
,
"uuid"
:
"3ecea516-ca65-4ac2-9b93-08495a52d7d2"
,
"ext"
:
".png"
},
{
"name"
:
"把手"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/71255a6f3cdf9f66d53589e46d72fcd20fef468d.png"
,
"uuid"
:
"d918e46f-c7f8-4ad0-8039-08c9c66b4ca6"
,
"ext"
:
".png"
},
{
"name"
:
"伸缩杆"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/a9cf8b147c52b7d4247e80e90e098f787808bfa9.png"
,
"uuid"
:
"b0146aee-5741-470c-b0fc-bf00a4aca5f6"
,
"ext"
:
".png"
},
{
"name"
:
"左爪"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/1e8634fd94bda455d11956c2847d3823e80701d3.png"
,
"uuid"
:
"d8e399ff-691f-439a-9ce4-4867514e617d"
,
"ext"
:
".png"
},
{
"name"
:
"右爪"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/4bfc510e0d1fa1db77f5effa187294af38b74ff6.png"
,
"uuid"
:
"0df49f61-0281-4647-a55f-437b71b352e6"
,
"ext"
:
".png"
},
{
"name"
:
"连接点"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/39f39234631f739e70e9ab8b713284379f4016fb.png"
,
"uuid"
:
"00ff944e-d038-4974-97fc-1e481af3a949"
,
"ext"
:
".png"
},
{
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga"
,
"uuid"
:
"b521bf94-20e1-44dd-8eca-d24996cbaeae"
,
"ext"
:
".svga"
},
{
"name"
:
"炸弹svga"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga"
,
"uuid"
:
"322edf39-805b-4e84-9d07-5573dfeebc0e"
,
"ext"
:
".svga"
},
{
"name"
:
"玩家"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga"
,
"uuid"
:
"71d8dcbc-3931-471a-b585-b3ae01b25aa6"
,
"ext"
:
".svga"
}
],
"events"
:
{
"in"
:
{
"food-fell-reset"
:
{
"alias"
:
"重置"
,
"data"
:
{
"goodsProbability"
:
"[0.2,0.5,0.3]道具概率(雨滴、石头、炸弹),所有概率相加为1"
,
"countDown"
:
"倒计时(s)"
,
"acceleratedSpeed"
:
"道具掉落加速度(单位:每秒)"
}
},
"food-fell-start"
:
{
"alias"
:
"开始"
},
"food-fell-revive"
:
{
"alias"
:
"复活"
},
"food-fell-pause"
:
{
"alias"
:
"暂停"
},
"food-fell-resume"
:
{
"alias"
:
"恢复"
},
"food-fell-clear"
:
{
"alias"
:
"清空,通过reset事件恢复"
}
},
"out"
:
{
"food-fell-score-update"
:
{
"alias"
:
"分数更新"
,
"data"
:
{
"score"
:
"分数"
}
},
"food-fell-time-update"
:
{
"alias"
:
"倒计时更新"
,
"data"
:
{
"time"
:
"剩余时间"
}
},
"food-fell-game-over"
:
{
"alias"
:
"游戏结束"
,
"data"
:
{
"score"
:
"分数"
,
"reason"
:
"结束原因(1:时间到了,2:玩家死亡)"
}
},
"doll-mac-getprize"
:
{
"alias"
:
"中奖"
,
"data"
:
null
}
}
}
}
\ No newline at end of file
src/custom/doll-machine/src/game/GameView.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2018/8/16.
*/
import
{
props
}
from
"../props"
;
import
{
playSound
,
createSvga
}
from
"./utils"
;
import
ObjectPool
=
engine
.
ObjectPool
;
import
{
getTextureByName
}
from
"./utils"
;
import
{
Goods
}
from
"./Goods"
;
import
{
PoolName
}
from
"./object-pool-init"
;
import
{
FrontBoxs
}
from
"./frontBox"
;
import
{
BackBoxs
}
from
"./backBox"
;
import
{
Zhuazi
}
from
'./Zhuazi'
;
export
default
class
GameView
extends
engine
.
Container
{
private
_hasSetup
;
//触摸层
private
rectBg
:
engine
.
Rect
;
//npc层
private
NpcBg
:
engine
.
Container
;
//盒子1
private
box1
:
engine
.
Container
;
//盒子2
private
box2
:
engine
.
Container
;
//盒子3
private
box3
:
engine
.
Container
;
//盒子4
private
box4
:
engine
.
Container
;
//盒子5
private
box5
:
engine
.
Container
;
//前传输区域
private
frontTransfer
:
engine
.
Container
;
//后传输区域
private
backTransfer
:
engine
.
Container
;
//前台板
private
frontDesk
:
engine
.
Sprite
;
//后台板
private
backDesk
:
engine
.
Sprite
;
private
_frontBoxs
:
FrontBoxs
;
private
_backBoxs
:
BackBoxs
;
private
_Zhuazi
:
Zhuazi
;
private
prizeBox
:
engine
.
Container
;
private
rect
;
//当前分数
private
score
;
//中奖盒子移动距离
private
moveTime
;
//游戏状态
private
gameIng
;
//npc出身计时器
private
timer
;
//倒计时计时器
private
countdownTimer
:
any
;
//倒计时
private
countdown
:
number
;
//当前速度
private
speed
:
number
;
// 当前场景上面的物品
private
goodsItems
=
[];
private
_goods
:
Goods
;
constructor
()
{
super
();
this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
this
.
setup
,
this
);
}
// private waterSvga;
// private boomSvga;
// private playerSvga;
setup
()
{
if
(
this
.
_hasSetup
)
{
return
;
}
this
.
_hasSetup
=
true
;
const
frontBoxs
=
(
this
.
_frontBoxs
=
new
FrontBoxs
());
this
.
_frontBoxs
.
GameView
=
this
;
const
backBoxs
=
(
this
.
_backBoxs
=
new
BackBoxs
());
this
.
_Zhuazi
=
new
Zhuazi
();
this
.
_Zhuazi
.
GameView
=
this
;
this
.
frontTransfer
=
new
engine
.
Container
();
this
.
backTransfer
=
new
engine
.
Container
();
this
.
frontTransfer
.
width
=
0
;
this
.
frontTransfer
.
height
=
0
;
this
.
frontTransfer
.
alpha
=
1
;
// this.frontTransfer.x = 0;
// this.frontTransfer.y = 434;
this
.
backTransfer
.
width
=
0
;
this
.
backTransfer
.
height
=
0
;
this
.
backTransfer
.
alpha
=
1
;
// this.backTransfer.x = 0;
// this.backTransfer.y = 390;
this
.
rect
=
new
engine
.
Rect
();
// this.rect.width = 608;
this
.
rect
.
width
=
611
;
this
.
rect
.
height
=
704
;
// this.rect.x = 71;
// this.rect.y = 263;
this
.
rect
.
x
=
65
;
this
.
rect
.
y
=
267
;
this
.
NpcBg
=
new
engine
.
Container
();
// this.NpcBg.alpha = 1;
// this.NpcBg.width = 0;
// this.NpcBg.height = 0;
this
.
addChild
(
this
.
NpcBg
);
this
.
addChild
(
this
.
rect
);
let
gameBg
=
new
engine
.
Sprite
(
getTextureByName
(
"游戏背景"
));
gameBg
.
x
=
65
;
gameBg
.
y
=
267
;
this
.
NpcBg
.
addChild
(
gameBg
);
this
.
frontDesk
=
new
engine
.
Sprite
(
getTextureByName
(
"前传输带"
));
this
.
frontDesk
.
x
=
60
;
this
.
frontDesk
.
y
=
904
;
this
.
backDesk
=
new
engine
.
Sprite
(
getTextureByName
(
"后传输带"
));
this
.
backDesk
.
x
=
60
;
this
.
backDesk
.
y
=
810
;
this
.
NpcBg
.
addChild
(
this
.
backDesk
);
this
.
NpcBg
.
addChild
(
this
.
frontDesk
);
this
.
NpcBg
.
addChild
(
this
.
backTransfer
);
this
.
NpcBg
.
addChild
(
this
.
frontTransfer
);
this
.
NpcBg
.
addChild
(
this
.
_Zhuazi
);
this
.
NpcBg
.
mask
=
this
.
rect
;
this
.
_Zhuazi
.
setup
();
// this._Zhuazi.move();
this
.
backTransfer
.
addChild
(
this
.
_backBoxs
);
this
.
_backBoxs
.
setup
();
this
.
frontTransfer
.
addChild
(
this
.
_frontBoxs
);
this
.
_frontBoxs
.
setup
();
// this.player.fillColor="rgba(0, 0, 0,1)"
//console.log(this.player.fillColor)
// this.rectBg = new engine.Rect();
// this.rectBg.alpha = 0;
// this.rectBg.width = 750;
// this.rectBg.height = 1624;
// this.addChild(this.rectBg);
}
/**
*
* @param 暂停move
*/
stopMove
()
{
this
.
_frontBoxs
.
stop
();
}
/**
* 赋值x距离值
*/
setMoveX
(
x
,
item
)
{
this
.
moveTime
=
x
;
this
.
prizeBox
=
item
;
this
.
_Zhuazi
.
move
();
}
/**
* 显示隐藏盒子
*/
setVisible
(
isshow
)
{
this
.
_frontBoxs
.
showHidePrizeBox
(
isshow
);
}
/**
* 获取中奖盒子移动的距离
*/
getMoveX
()
{
console
.
log
(
222
);
return
this
.
moveTime
;
}
/**
* 获取中奖盒子
*/
getBox
()
{
return
this
.
prizeBox
;
}
/**
* 重置场景
*/
reset
()
{
this
.
recycleGoods
();
this
.
_Zhuazi
.
getReset
();
}
/**
* 开始
*/
start
()
{
this
.
score
=
0
;
this
.
speed
=
1
;
this
.
gameIng
=
true
;
// this.creatNpc()
// this.beginNpc();
this
.
countdown
=
props
.
countDown
;
this
.
countdownTimer
=
setInterval
(()
=>
{
if
(
this
.
gameIng
)
{
if
(
this
.
countdown
>
0
)
{
engine
.
globalEvent
.
dispatchEvent
(
"food-fell-time-update"
,
{
time
:
this
.
countdown
});
this
.
countdown
-=
1
;
}
else
{
engine
.
globalEvent
.
dispatchEvent
(
"food-fell-game-over"
,
{
score
:
this
.
score
,
reason
:
1
});
this
.
died
();
}
}
},
1000
);
}
/**
* npc开始掉落
*/
beginNpc
()
{
this
.
timer
=
setTimeout
(()
=>
{
if
(
this
.
gameIng
)
{
// this.speed += props.acceleratedSpeed;
// this.creatNpc()
}
//递归执行
// this.beginNpc();
},
2000
/
this
.
speed
);
}
/**
* 暂停
*/
pause
()
{
this
.
gameIng
=
false
;
}
/**
* 恢复
*/
revive
()
{
this
.
gameIng
=
true
;
}
/**
* 重新开始
*/
resume
()
{
this
.
reset
();
this
.
start
();
}
/**
* 初始化盒子位置
*/
initNpc
()
{
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box1
.
x
=
120
;
this
.
box1
.
y
=
434
;
this
.
box2
.
x
=
306
;
this
.
box2
.
y
=
434
;
this
.
box3
.
x
=
487
;
this
.
box3
.
y
=
434
;
this
.
box4
.
x
=
240
;
this
.
box4
.
scaleX
=
0.5
;
this
.
box4
.
scaleY
=
0.5
;
this
.
box4
.
y
=
390
;
this
.
box5
.
x
=
434
;
this
.
box5
.
y
=
390
;
this
.
box5
.
scaleX
=
0.5
;
this
.
box5
.
scaleY
=
0.5
;
this
.
backTransfer
.
addChild
(
this
.
box4
);
this
.
backTransfer
.
addChild
(
this
.
box5
);
this
.
frontTransfer
.
addChild
(
this
.
box1
);
this
.
frontTransfer
.
addChild
(
this
.
box2
);
this
.
frontTransfer
.
addChild
(
this
.
box3
);
}
/**
* 创建NPC
*/
// private creatNpc() {
// // this.initNpc();
// let goods = (this._goods = <Goods>ObjectPool.getObject(PoolName));
// console.log(goods);
// this.goodsItems.push(goods);
// this.NpcBg.addChild(goods);
// goods.addEventListener(
// engine.Event.ENTER_FRAME,
// (goods["onGoodsEnter"] = () => {
// if (goods.y > 1624) {
// this.removeNpc(goods);
// } else {
// if (this.gameIng) {
// //速度叠加
// // goods.y += (4 * this.speed)
// goods.x += 2 * this.speed;
// //如果玩家和物品发生碰撞
// if (this.hasHit(this.player, goods)) {
// if (goods["npcType"] == "rain") {
// console.log("碰到雨滴");
// this.score += props.rainScore;
// this.waterSvga.visible = true;
// this.waterSvga.play(false, false);
// this.waterSvga.once(
// engine.Event.END_FRAME,
// () => {
// this.waterSvga.visible = false;
// },
// this
// );
// } else if (goods["npcType"] == "stone") {
// console.log("碰到石头");
// this.score += props.stoneScore;
// } else if (goods["npcType"] == "boom") {
// console.log("碰到炸弹");
// this.boomSvga.visible = true;
// this.boomSvga.play(false, false);
// this.boomSvga.once(
// engine.Event.END_FRAME,
// () => {
// this.boomSvga.visible = false;
// },
// this
// );
// engine.globalEvent.dispatchEvent("food-fell-game-over", {
// score: this.score,
// reason: 2
// });
// this.died();
// }
// engine.globalEvent.dispatchEvent("food-fell-score-update", {
// score: this.score
// });
// this.removeNpc(goods);
// }
// }
// }
// }),
// this
// );
// }
/**
* 玩家死亡
*/
private
died
()
{
this
.
score
=
0
;
this
.
pause
();
}
/**
* 回收指定物品
* @param goods 物品
*/
private
removeNpc
(
goods
)
{
this
.
NpcBg
.
removeChild
(
goods
);
ObjectPool
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
let
index
=
this
.
goodsItems
.
indexOf
(
goods
);
if
(
index
>
-
1
)
{
this
.
goodsItems
.
splice
(
index
,
1
);
}
}
/**
* 回收对象
*/
private
recycleGoods
()
{
clearTimeout
(
this
.
timer
);
clearInterval
(
this
.
countdownTimer
);
for
(
let
goods
of
this
.
goodsItems
)
{
if
(
goods
)
{
this
.
removeChild
(
goods
);
ObjectPool
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
}
this
.
goodsItems
=
[];
}
/**
* 碰撞检测
* @param a a盒子
* @param b b盒子
*/
private
hasHit
(
a
,
b
)
{
if
(
Math
.
abs
(
a
.
x
+
a
.
width
/
2
-
(
b
.
x
+
b
.
width
/
2
))
<
a
.
width
/
2
+
b
.
width
/
2
&&
Math
.
abs
(
a
.
y
+
a
.
height
/
2
-
(
b
.
y
+
b
.
height
/
2
))
<
a
.
height
/
2
+
b
.
height
/
2
)
{
return
true
;
}
else
{
return
false
;
}
}
}
src/custom/doll-machine/src/game/GameWrapper.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-01-09.
*/
import
GameView
from
"./GameView"
;
import
{
injectProps
}
from
"../props"
;
export
class
GameWrapper
extends
engine
.
Container
{
private
_status
;
private
_gameView
:
GameView
;
constructor
()
{
super
();
engine
.
globalEvent
.
addEventListener
(
'doll-machine-reset'
,
this
.
reset
,
this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-start'
,
this
.
start
,
this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-pause'
,
this
.
pause
,
this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-resume'
,
this
.
resume
,
this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-revive'
,
this
.
revive
,
this
);
engine
.
globalEvent
.
addEventListener
(
'food-fell-clear'
,
this
.
clear
,
this
);
this
.
addEventListener
(
engine
.
MouseEvent
.
CLICK
,
this
.
onTap
,
this
);
let
gameView
=
this
.
_gameView
=
new
GameView
();
this
.
addChild
(
gameView
);
// gameView.reset()
// gameView.start()
}
reset
(
event
:
engine
.
Event
)
{
injectProps
(
event
.
data
);
this
.
_gameView
.
visible
=
true
;
this
.
_gameView
.
reset
();
}
start
(
event
:
engine
.
Event
)
{
injectProps
(
event
.
data
);
this
.
_status
=
1
;
this
.
_gameView
.
start
();
}
pause
()
{
this
.
_gameView
.
pause
();
}
resume
()
{
this
.
_gameView
.
resume
();
}
revive
()
{
this
.
_gameView
.
revive
();
}
clear
()
{
this
.
_gameView
.
visible
=
false
;
}
private
onTap
(
event
)
{
// this._gameView.tap(event);
}
}
src/custom/doll-machine/src/game/Goods.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-02-02.
*
* 掉落物品
*/
import
{
getTextureByName
}
from
"./utils"
;
import
{
props
}
from
"../props"
;
export
class
Goods
extends
engine
.
Container
{
private
_body
:
engine
.
Rect
;
private
_toY
;
constructor
()
{
super
();
let
body
;
body
=
this
.
_body
=
new
engine
.
Rect
();
// let rain = new engine.Sprite(getTextureByName('雨滴'));
// rain["npcType"]="rain"
// let stone = new engine.Sprite(getTextureByName('石块'));
// stone["npcType"]="stone"
// let boom = new engine.Sprite(getTextureByName('炸弹'));
// boom["npcType"]="boom"
let
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
box1
[
"npcType"
]
=
"box1"
;
let
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
box2
[
"npcType"
]
=
"box2"
;
let
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
box3
[
"npcType"
]
=
"box3"
;
// rain.visible=false;
// stone.visible=false;
// boom.visible=false;
// body.addChild(rain)
// body.addChild(stone)
// body.addChild(boom)
box1
.
visible
=
false
;
box2
.
visible
=
false
;
box3
.
visible
=
false
;
body
.
addChild
(
box1
);
body
.
addChild
(
box2
);
body
.
addChild
(
box3
);
this
.
addChild
(
body
);
body
.
width
=
0.0001
;
body
.
height
=
0.0001
;
body
.
mouseEnabled
=
false
;
}
getRandomNumberByRange
(
start
,
end
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
end
-
start
)
+
start
);
}
// reset() {
// this.visible = true;
// this.rotation = 0;
// this.anchorOffsetY = 0;
// this.y = 0;
// this.x = (750-120)*Math.random()+30;
// this.rotation = 0;
// let random=Math.random()
// if(random<props.goodsProbability[0]){
// this.showNpc("box1")
// }else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){
// this.showNpc("box2")
// }else if(random>(props.goodsProbability[0]+props.goodsProbability[1])){
// this.showNpc("box3")
// }
// }
reset
()
{
this
.
visible
=
true
;
this
.
y
=
200
;
this
.
x
=
0
;
this
.
rotation
=
0
;
let
random
=
Math
.
random
();
if
(
random
<
0.3
)
{
this
.
showNpc
(
"box1"
);
}
else
if
(
random
<
0.6
)
{
this
.
showNpc
(
"box2"
);
}
else
{
this
.
showNpc
(
"box3"
);
}
// this.showNpc("box1");
// this.showNpc("box2");
// this.showNpc("box3");
}
showNpc
(
type
)
{
for
(
let
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
)
{
this
.
_body
.
children
[
i
].
visible
=
false
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
for
(
let
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
)
{
if
(
this
.
_body
.
children
[
i
][
"npcType"
]
==
type
)
{
this
[
"npcType"
]
=
type
;
console
.
log
(
type
);
this
.
_body
.
children
[
i
].
visible
=
true
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
}
}
set
anchorOffsetY
(
v
)
{
this
.
_body
.
y
=
v
;
}
}
src/custom/doll-machine/src/game/Zhuazi.ts
0 → 100644
View file @
b9593434
import
{
getTextureByName
}
from
"./utils"
;
import
{
props
}
from
"../props"
;
import
GameView
from
'./GameView'
;
export
class
Zhuazi
extends
engine
.
Container
{
private
bashouGan
:
engine
.
Sprite
;
private
bashou
:
engine
.
Sprite
;
private
ganzi
:
engine
.
Sprite
;
private
left_zhuazi
:
engine
.
Sprite
;
private
right_zhuazi
:
engine
.
Sprite
;
private
connect
:
engine
.
Sprite
;
private
ganNode
:
engine
.
Container
;
private
moveNode
:
engine
.
Container
;
private
moveArr
=
[];
private
zhuaziY
;
//盒子1
private
box1
:
engine
.
Container
;
//盒子2
private
box2
:
engine
.
Container
;
//盒子3
private
box3
:
engine
.
Container
;
//盒子4
private
box4
:
engine
.
Container
;
//盒子5
private
box5
:
engine
.
Container
;
private
itemShow
:
engine
.
Container
;
private
prizeBoxs
=
[];
public
GameView
:
GameView
;
constructor
()
{
super
();
}
setup
()
{
this
.
ganNode
=
new
engine
.
Container
();
this
.
moveNode
=
new
engine
.
Container
();
this
.
ganNode
.
x
=
280
;
this
.
ganNode
.
y
=
425
;
this
.
bashouGan
=
new
engine
.
Sprite
(
getTextureByName
(
"把手杆子"
));
this
.
bashouGan
.
x
=
60
;
this
.
bashouGan
.
y
=
342
;
this
.
bashou
=
new
engine
.
Sprite
(
getTextureByName
(
"把手"
));
this
.
bashou
.
x
=
0
;
this
.
bashou
.
y
=
320
;
this
.
ganzi
=
new
engine
.
Sprite
(
getTextureByName
(
"伸缩杆"
));
this
.
ganzi
.
x
=
97
;
this
.
ganzi
.
y
=
382
;
this
.
connect
=
new
engine
.
Sprite
(
getTextureByName
(
"连接点"
));
this
.
connect
.
x
=
20
;
this
.
connect
.
y
=
0
;
this
.
left_zhuazi
=
new
engine
.
Sprite
(
getTextureByName
(
"左爪"
));
this
.
left_zhuazi
.
x
=
0
;
this
.
left_zhuazi
.
y
=
60
;
this
.
left_zhuazi
.
anchorX
=
this
.
left_zhuazi
.
width
;
this
.
left_zhuazi
.
anchorY
=
0
;
this
.
left_zhuazi
.
rotation
=
30
;
this
.
right_zhuazi
=
new
engine
.
Sprite
(
getTextureByName
(
"右爪"
));
this
.
right_zhuazi
.
x
=
83
;
this
.
right_zhuazi
.
y
=
60
;
this
.
right_zhuazi
.
rotation
=
-
30
;
this
.
ganNode
.
addChild
(
this
.
left_zhuazi
);
this
.
ganNode
.
addChild
(
this
.
right_zhuazi
);
this
.
ganNode
.
addChild
(
this
.
connect
);
this
.
ganNode
.
x
=
30
;
this
.
zhuaziY
=
this
.
ganNode
.
y
;
this
.
moveNode
.
addChild
(
this
.
ganzi
);
this
.
moveNode
.
addChild
(
this
.
ganNode
);
this
.
moveNode
.
addChild
(
this
.
bashou
);
this
.
moveNode
.
x
=
262
;
// this.moveNode.
// this.moveArr = [this.bashou, this.ganzi, this.ganNode];
this
.
addChild
(
this
.
bashouGan
);
// this.addChild(this.ganzi);
// this.addChild(this.bashou);
// this.addChild(this.ganNode);
this
.
addChild
(
this
.
moveNode
);
this
.
createPrizeBox
();
// setTimeout(() => {
// this.move();
// }, 2000)
}
createPrizeBox
()
{
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box1
[
"npcType"
]
=
"box1"
;
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box2
[
"npcType"
]
=
"box2"
;
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box3
[
"npcType"
]
=
"box3"
;
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box4
[
"npcType"
]
=
"box4"
;
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box5
[
"npcType"
]
=
"box5"
;
this
.
prizeBoxs
=
[
this
.
box1
,
this
.
box2
,
this
.
box3
,
this
.
box4
,
this
.
box5
];
this
.
prizeBoxs
.
forEach
(
item
=>
{
this
.
ganNode
.
addChild
(
item
);
item
.
visible
=
false
;
item
.
x
=
-
15
;
item
.
y
=
48
;
})
}
showPrizeBox
()
{
this
.
prizeBoxs
.
forEach
(
item
=>
{
console
.
log
(
this
.
GameView
.
getBox
()[
'npcType'
]);
if
(
item
[
'npcType'
]
===
this
.
GameView
.
getBox
()[
'npcType'
])
{
item
.
visible
=
true
;
this
.
itemShow
=
item
;
}
else
{
item
.
visible
=
false
;
}
})
}
move
()
{
let
rndist
=
Math
.
random
();
let
halfWidth
=
this
.
bashou
.
width
/
2
;
let
randomX
=
rndist
*
(
rndist
>
0.5
?
1
:
-
1
)
*
props
.
bashouMoveDist
;
console
.
log
(
randomX
);
engine
.
Tween
.
get
(
this
.
moveNode
).
to
({
x
:
370
+
halfWidth
-
71
},
1000
).
call
(()
=>
{
this
.
zhangkai
();
});
// this.moveArr.forEach((item,index) => {
// engine.Tween.get(item).to({ x: item.x +randomX}, 500).to({x: 370}, 500).call(() => {
// if (index == this.moveArr.length-1) {
// this.zhangkai();
// }
// });
// })
}
zhangkai
()
{
this
.
left_zhuazi
.
anchorX
=
this
.
left_zhuazi
.
width
;
this
.
left_zhuazi
.
anchorY
=
0
;
engine
.
Tween
.
get
(
this
.
left_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
props
.
leftRotation
},
1000
);
engine
.
Tween
.
get
(
this
.
right_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
props
.
rightRotation
},
1000
);
setTimeout
(()
=>
{
this
.
getLong
();
},
500
);
}
getLong
()
{
let
droptime
=
Number
((
this
.
GameView
.
getMoveX
()
/
60
-
1
).
toFixed
(
2
))
*
1000
;
console
.
log
(
'dr'
,
droptime
);
let
times
=
(
props
.
ganMoveEndY
-
this
.
ganzi
.
y
)
/
this
.
ganzi
.
height
;
console
.
log
(
Number
(
times
.
toFixed
(
2
))
);
engine
.
Tween
.
get
(
this
.
ganzi
).
to
({
scaleY
:
Number
(
times
.
toFixed
(
2
))
},
droptime
).
to
({
scaleY
:
1
},
droptime
)
console
.
log
(
'node'
,
this
.
zhuaziY
);
engine
.
Tween
.
get
(
this
.
ganNode
).
to
({
y
:
props
.
ganMoveEndY
},
droptime
).
call
(()
=>
{
this
.
GameView
.
stopMove
();
this
.
showPrizeBox
();
this
.
GameView
.
setVisible
(
false
);
}).
to
({
y
:
this
.
zhuaziY
},
droptime
).
call
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'doll-mac-getprize'
);
this
.
getReset
();
})
// .to({ scaleY: 1 }, droptime)
// to({ y: this.zhuaziY }, droptime)
}
getReset
()
{
this
.
itemShow
.
visible
=
false
;
this
.
left_zhuazi
.
anchorX
=
this
.
left_zhuazi
.
width
;
this
.
left_zhuazi
.
anchorY
=
0
;
engine
.
Tween
.
get
(
this
.
moveNode
,
{
loop
:
false
}).
to
({
x
:
262
},
1000
);
engine
.
Tween
.
get
(
this
.
left_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
0
},
1000
);
engine
.
Tween
.
get
(
this
.
right_zhuazi
,
{
loop
:
false
}).
to
({
rotation
:
0
},
1000
);
}
}
\ No newline at end of file
src/custom/doll-machine/src/game/backBox.ts
0 → 100644
View file @
b9593434
import
{
getTextureByName
}
from
"./utils"
;
import
{
props
}
from
"../props"
;
export
class
BackBoxs
extends
engine
.
Container
{
//盒子1
private
box1
:
engine
.
Container
;
//盒子2
private
box2
:
engine
.
Container
;
//盒子3
private
box3
:
engine
.
Container
;
//盒子4
private
box4
:
engine
.
Container
;
//盒子5
private
box5
:
engine
.
Container
;
private
backBoxs
=
[];
constructor
()
{
super
();
}
setup
()
{
let
initX
,
initY
=
0
;
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
initX
=
this
.
box1
.
x
=
188
;
initY
=
this
.
box1
.
y
=
706
;
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
backBoxs
=
[
this
.
box1
,
this
.
box2
,
this
.
box3
,
this
.
box4
,
this
.
box5
];
for
(
let
i
=
0
;
i
<
this
.
backBoxs
.
length
;
i
++
)
{
this
.
backBoxs
[
i
].
scaleX
=
0.5
;
this
.
backBoxs
[
i
].
scaleY
=
0.5
;
if
(
i
==
0
)
{
this
.
backBoxs
[
i
].
x
=
initX
;
}
else
{
this
.
backBoxs
[
i
].
x
=
this
.
backBoxs
[
i
-
1
].
x
+
this
.
backBoxs
[
i
].
width
+
props
.
backmargin
;
}
this
.
backBoxs
[
i
].
y
=
initY
;
this
.
addChild
(
this
.
backBoxs
[
i
]);
}
this
.
addEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
frameMove
,
this
);
}
frameMove
()
{
this
.
backBoxs
.
forEach
((
item
)
=>
{
item
.
x
-=
props
.
moveSpeed
;
if
(
item
.
x
<=
0
)
{
let
lastitem
=
this
.
backBoxs
.
shift
();
lastitem
.
x
=
this
.
backBoxs
[
this
.
backBoxs
.
length
-
1
].
x
+
item
.
width
+
props
.
backmargin
;
this
.
backBoxs
.
push
(
lastitem
);
}
})
}
}
\ No newline at end of file
src/custom/doll-machine/src/game/frontBox.ts
0 → 100644
View file @
b9593434
import
{
getTextureByName
}
from
"./utils"
;
import
GameView
from
'./GameView'
;
import
{
props
}
from
"../props"
;
export
class
FrontBoxs
extends
engine
.
Container
{
//盒子1
private
box1
:
engine
.
Container
;
//盒子2
private
box2
:
engine
.
Container
;
//盒子3
private
box3
:
engine
.
Container
;
//盒子4
private
box4
:
engine
.
Container
;
//盒子5
private
box5
:
engine
.
Container
;
// 需隐藏的盒子
private
hideBox
:
engine
.
Container
;
private
frontBoxs
=
[];
public
GameView
:
GameView
;
constructor
()
{
super
();
}
setup
()
{
let
initX
,
initY
=
0
;
this
.
box1
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box1
[
"npcType"
]
=
"box1"
;
initX
=
this
.
box1
.
x
=
435
;
initY
=
this
.
box1
.
y
=
734
;
this
.
box2
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box2
[
"npcType"
]
=
"box2"
;
this
.
box3
=
new
engine
.
Sprite
(
getTextureByName
(
"草泥马盒"
));
this
.
box3
[
"npcType"
]
=
"box3"
;
this
.
box4
=
new
engine
.
Sprite
(
getTextureByName
(
"狗盒"
));
this
.
box4
[
"npcType"
]
=
"box4"
;
this
.
box5
=
new
engine
.
Sprite
(
getTextureByName
(
"猫盒"
));
this
.
box5
[
"npcType"
]
=
"box5"
;
this
.
frontBoxs
=
[
this
.
box1
,
this
.
box2
,
this
.
box3
,
this
.
box4
];
for
(
let
i
=
0
;
i
<
this
.
frontBoxs
.
length
;
i
++
)
{
if
(
i
==
0
)
{
this
.
frontBoxs
[
i
].
x
=
initX
;
}
else
{
this
.
frontBoxs
[
i
].
x
=
this
.
frontBoxs
[
i
-
1
].
x
-
this
.
box1
.
width
-
props
.
frontmargin
;
}
this
.
frontBoxs
[
i
].
y
=
initY
;
this
.
addChild
(
this
.
frontBoxs
[
i
]);
}
this
.
addEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
frameMove
,
this
);
}
frameMove
()
{
this
.
frontBoxs
.
forEach
((
item
,
index
)
=>
{
item
.
x
+=
props
.
moveSpeed
;
if
(
item
.
x
<=
0
&&
!
item
.
visible
)
{
item
.
visible
=
true
;
}
if
(
item
.
x
>=
750
)
{
let
lastitem
=
this
.
frontBoxs
.
shift
();
lastitem
.
x
=
this
.
frontBoxs
[
this
.
frontBoxs
.
length
-
1
].
x
-
this
.
box1
.
width
-
props
.
frontmargin
;
if
(
!
this
.
GameView
.
getMoveX
()
&&
item
.
x
<=
0
)
{
this
.
GameView
.
setMoveX
((
370
-
item
.
x
-
13
)
/
props
.
moveSpeed
,
item
);
this
.
hideBox
=
item
;
}
this
.
frontBoxs
.
push
(
lastitem
);
}
})
}
stop
()
{
// this.removeEventListener(engine.Event.ENTER_FRAME, this.frameMove, this);
}
showHidePrizeBox
(
isshow
)
{
this
.
hideBox
.
visible
=
isshow
}
}
\ No newline at end of file
src/custom/doll-machine/src/game/object-pool-init.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-02-03.
*/
import
{
Goods
}
from
"./Goods"
;
import
ObjectPool
=
engine
.
ObjectPool
;
export
const
PoolName
:
string
=
'goods'
;
ObjectPool
.
registerPool
(
PoolName
,
function
()
{
return
new
Goods
();
},
function
(
item
:
Goods
,
data
)
{
item
.
reset
();
});
src/custom/doll-machine/src/game/utils.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-01-21.
*/
export
function
getTexture
(
uuid
)
{
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
}
export
function
getTextureByName
(
name
)
{
return
getTexture
(
engine
.
getAssetByName
(
name
).
uuid
);
}
export
function
playSound
(
name
)
{
engine
.
playSound
(
engine
.
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
}
export
function
createSvga
(
name
,
anchorName
?)
{
let
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
}
\ No newline at end of file
src/custom/doll-machine/src/index.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2019-11-20.
*/
import
{
GameWrapper
}
from
"./game/GameWrapper"
;
import
{
injectProps
,
prepareProps
}
from
"./props"
;
export
default
function
(
props
)
{
prepareProps
();
injectProps
(
props
);
let
instance
=
new
GameWrapper
();
return
instance
;
}
src/custom/doll-machine/src/props.ts
0 → 100644
View file @
b9593434
/**
* Created by rockyl on 2020-01-21.
*/
export
let
props
:
any
=
{};
export
function
prepareProps
()
{
let
metaProps
=
getProps
();
engine
.
injectProp
(
props
,
metaProps
);
}
export
function
injectProps
(
p
)
{
engine
.
injectProp
(
props
,
p
);
}
src/custom/food-fell/debug/main.js
View file @
b9593434
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
function
injectProps
(
p
)
{
function
injectProps
(
p
)
{
engine
.
injectProp
(
props
,
p
);
engine
.
injectProp
(
props
,
p
);
}
}
//# sourceMappingURL=props.js.map
function
getTexture
(
uuid
)
{
function
getTexture
(
uuid
)
{
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
...
@@ -25,7 +24,6 @@
...
@@ -25,7 +24,6 @@
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
return
inst
;
}
}
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
tslib
.
__extends
(
Goods
,
_super
);
...
@@ -94,7 +92,6 @@
...
@@ -94,7 +92,6 @@
});
});
return
Goods
;
return
Goods
;
}(
engine
.
Container
));
}(
engine
.
Container
));
//# sourceMappingURL=Goods.js.map
var
ObjectPool
=
engine
.
ObjectPool
;
var
ObjectPool
=
engine
.
ObjectPool
;
var
PoolName
=
'goods'
;
var
PoolName
=
'goods'
;
...
@@ -103,7 +100,6 @@
...
@@ -103,7 +100,6 @@
},
function
(
item
,
data
)
{
},
function
(
item
,
data
)
{
item
.
reset
();
item
.
reset
();
});
});
//# sourceMappingURL=object-pool-init.js.map
var
ObjectPool$1
=
engine
.
ObjectPool
;
var
ObjectPool$1
=
engine
.
ObjectPool
;
var
GameView
=
(
function
(
_super
)
{
var
GameView
=
(
function
(
_super
)
{
...
@@ -345,7 +341,6 @@
...
@@ -345,7 +341,6 @@
};
};
return
GameWrapper
;
return
GameWrapper
;
}(
engine
.
Container
));
}(
engine
.
Container
));
//# sourceMappingURL=GameWrapper.js.map
function
index
(
props
)
{
function
index
(
props
)
{
prepareProps
();
prepareProps
();
...
@@ -353,7 +348,6 @@
...
@@ -353,7 +348,6 @@
var
instance
=
new
GameWrapper
();
var
instance
=
new
GameWrapper
();
return
instance
;
return
instance
;
}
}
//# sourceMappingURL=index.js.map
return
index
;
return
index
;
...
...
src/custom/food-fell/debug/main.js.map
View file @
b9593434
{"version":3,"file":"index.js","sources":["src/custom/food-fell/src/props.ts","src/custom/food-fell/src/game/utils.ts","src/custom/food-fell/src/game/Goods.ts","src/custom/food-fell/src/game/object-pool-init.ts","src/custom/food-fell/src/game/GameView.ts","src/custom/food-fell/src/game/GameWrapper.ts","src/custom/food-fell/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport function getTexture(uuid) {\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\n}\n\nexport function getTextureByName(name) {\n\treturn getTexture(engine.getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Goods extends engine.Container {\n\tprivate _body:engine.Rect\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body\n\t\tbody = this._body =new engine.Rect()\n\t\t\n\t\t\n\t\tlet rain = new engine.Sprite(getTextureByName('雨滴'));\n\t\train[\"npcType\"]=\"rain\"\n\t\tlet stone = new engine.Sprite(getTextureByName('石块'));\n\t\tstone[\"npcType\"]=\"stone\"\n\t\tlet boom = new engine.Sprite(getTextureByName('炸弹'));\n\t\tboom[\"npcType\"]=\"boom\"\n\n\t\train.visible=false;\n\t\tstone.visible=false;\n\t\tboom.visible=false;\n\t\tbody.addChild(rain)\n\t\tbody.addChild(stone)\n\t\tbody.addChild(boom)\n\t\t\n\t\tthis.addChild(body);\n\t\tbody.width=.0001;\n\t\tbody.height=.0001;\n\t\tbody.mouseEnabled=false;\n\t}\n\n\n\tgetRandomNumberByRange(start, end) {\n\t\treturn Math.floor(Math.random() * (end - start) + start)\n\t}\n\n\treset() {\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tthis.y = 0;\n\t\tthis.x = (750-120)*Math.random()+30;\n\t\tthis.rotation = 0;\n\t\tlet random=Math.random()\n\n\t\tif(random<props.goodsProbability[0]){\n\t\t\tthis.showNpc(\"rain\")\n\t\t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"stone\")\n\t\t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"boom\")\n\t\t}\n\t}\n\n\n\tshowNpc(type){\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tthis._body.children[i].visible=false;\n\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t}\n\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tif(this._body.children[i][\"npcType\"]==type){\n\t\t\t\tthis[\"npcType\"]=type\n\t\t\t\tthis._body.children[i].visible=true;\n\t\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\tset anchorOffsetY(v) {\n\t\tthis._body.y = v;\n\t}\n}\n","/**\n * Created by rockyl on 2020-02-03.\n */\n\nimport {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\tprivate rectBg: engine.Rect;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\n\t//当前分数\n\tprivate score\n\n\t//游戏状态\n\tprivate gameIng;\n\n\t//npc出身计时器\n\tprivate timer\n\t//倒计时计时器\n\tprivate countdownTimer: any\n\t//倒计时\n\tprivate countdown: number\n\n\t//当前速度\n\tprivate speed: number\n\n\t// 当前场景上面的物品\n\tprivate goodsItems = []\n\n\n\tprivate _goods: Goods;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tprivate waterSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\t\tthis.NpcBg = new engine.Container();\n\t\tthis.NpcBg.alpha = 1;\n\t\tthis.NpcBg.width = 0;\n\t\tthis.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg)\n\n\t\n\n\t\tthis.player = new engine.Container();\n\t\tthis.player.mouseEnabled = false;\n\t//\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n\t\t//console.log(this.player.fillColor)\n\t\n\t\tthis.addChild(this.player);\n\n\t\tthis.waterSvga=createSvga(\"水花\")\n\t\tthis.playerSvga=createSvga(\"玩家\")\n\t\tthis.boomSvga=createSvga(\"炸弹svga\")\n\t\tthis.player.addChild(this.playerSvga);\n\t\tthis.player.addChild(this.waterSvga);\n\t\tthis.player.addChild(this.boomSvga);\n\t\tthis.playerSvga.gotoAndPlay(1);\n\n\t\tthis.visible=false;\n\t\tsetTimeout(()=>{\n\t\t\tthis.visible=true;\n\t\t\t// this.player.width=this.playerSvga.width;\n\t\t\t// this.player.height=this.playerSvga.height;\n\t\t\tthis.player.anchorY = this.player.height / 2;\n\t\t\tthis.player.anchorX = this.player.width / 2;\n\t\t\tconsole.log(this.player.width)\n\t\t\tconsole.log(this.playerSvga.width)\n\t\t\tthis.player.x = 375 - this.player.width / 2;\n\t\t\tthis.player.y = props.playerPositionY;\n\t\t},300)\n\n\t\t\n\t\tthis.rectBg = new engine.Rect();\n\t\tthis.rectBg.alpha = 0;\n\t\tthis.rectBg.width = 750;\n\t\tthis.rectBg.height = 1624;\n\t\tthis.addChild(this.rectBg)\n\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\n\t\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tthis.recycleGoods()\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.score = 0;\n\t\tthis.speed = 1\n\t\tthis.gameIng = true;\n\t\tthis.creatNpc()\n\t\tthis.beginNpc()\n\t\tthis.countdown = props.countDown;\n\t\t\n\t\tthis.countdownTimer = setInterval(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tif (this.countdown > 0) {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-time-update', {\n\t\t\t\t\t\ttime: this.countdown,\n\t\t\t\t\t});\n\t\t\t\t\tthis.countdown -= 1\n\t\t\t\t} else {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\treason: 1\n\t\t\t\t\t});\n\t\t\t\t\tthis.died()\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1000)\n\t}\n\n\t/**\n\t * npc开始掉落\n\t */\n\tbeginNpc() {\n\t\tthis.timer = setTimeout(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\t\tthis.creatNpc()\n\t\t\t}\n\t\t\t//递归执行\n\t\t\tthis.beginNpc()\n\t\t}, 2000 / this.speed)\n\t}\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\tthis.gameIng = false;\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t\tthis.gameIng = true;\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\tthis.reset()\n\t\tthis.start()\n\t}\n\n\t/**\n\t * 创建NPC\n\t */\n\tprivate creatNpc() {\n\t\tlet goods = this._goods = <Goods>ObjectPool.getObject(PoolName);\n\t\tthis.goodsItems.push(goods)\n\t\tthis.NpcBg.addChild(goods);\n\t\tgoods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = () => {\n\t\t\tif (goods.y > 1624) {\n\t\t\t\tthis.removeNpc(goods)\n\t\t\t} else {\n\t\t\t\tif (this.gameIng) {\n\t\t\t\t\t//速度叠加\n\t\t\t\t\tgoods.y += (4 * this.speed)\n\t\t\t\t\t//如果玩家和物品发生碰撞\n\t\t\t\t\tif (this.hasHit(this.player, goods)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (goods[\"npcType\"] == \"rain\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rainScore\n\t\t\t\t\t\t\tthis.waterSvga.visible=true;\n\t\t\t\t\t\t\tthis.waterSvga.play(false, false)\n\t\t\t\t\t\t\tthis.waterSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.waterSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"stone\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到石头\")\n\t\t\t\t\t\t\tthis.score += props.stoneScore\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"boom\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到炸弹\")\n\t\t\t\t\t\t\tthis.boomSvga.visible=true;\n\t\t\t\t\t\t\tthis.boomSvga.play(false, false)\n\t\t\t\t\t\t\tthis.boomSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.boomSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t\t\treason: 2\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.died()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-score-update', {\n\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.removeNpc(goods)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, this);\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.score = 0\n\t\tthis.pause()\n\t}\n\n\t/**\n\t * 回收指定物品\n\t * @param goods 物品\n\t */\n\tprivate removeNpc(goods) {\n\t\tthis.NpcBg.removeChild(goods);\n\t\tObjectPool.recycleObject(PoolName, goods);\n\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\tlet index = this.goodsItems.indexOf(goods);\n\t\tif (index > -1) {\n\t\t\tthis.goodsItems.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * 回收对象\n\t */\n\tprivate recycleGoods() {\n\t\tclearTimeout(this.timer)\n\t\tclearInterval(this.countdownTimer)\n\t\tfor (let goods of this.goodsItems) {\n\t\t\tif (goods) {\n\t\t\t\tthis.removeChild(goods);\n\t\t\t\tObjectPool.recycleObject(PoolName, goods);\n\t\t\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\t\t}\n\t\t}\n\t\tthis.goodsItems = []\n\t}\n\n\tprivate moveCatchX = 0\n\tprivate playerCatchX = 0\n\n\t/**\n\t * 碰撞检测\n\t * @param a a盒子\n\t * @param b b盒子\n\t */\n\tprivate hasHit(a, b) {\n\t\tif (\n\t\t\tMath.abs((a.x + a.width / 2) - (b.x + b.width / 2)) < a.width / 2 + b.width / 2\n\t\t\t&&\n\t\t\tMath.abs((a.y + a.height / 2) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate onDownStage = (e) => {\n\t\tthis.moveCatchX = e.localX;\n\t\tthis.playerCatchX = this.player.x\n\t}\n\n\tprivate onMoveStage = (e) => {\n\t\tif (this.gameIng) {\n\t\t\tthis.player.x = this.playerCatchX + (e.localX - this.moveCatchX)\n\t\t}\n\t}\n\n\tprivate onOutStage = (e) => {\n\t\tthis.moveCatchX = 0\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('food-fell-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('food-fell-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('food-fell-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('food-fell-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('food-fell-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('food-fell-clear', this.clear, this);\n\n\t\tthis.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\t\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tclear() {\n\t\tthis._gameView.visible = false;\n\t}\n\n\tprivate onTap(event) {\n\t//\tthis._gameView.tap(event);\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {GameWrapper} from \"./game/GameWrapper\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance = new GameWrapper();\n\treturn instance;\n}\n"],"names":["__extends","ObjectPool"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;UCVe,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AAED,UAAgB,gBAAgB,CAAC,IAAI;KACpC,OAAO,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;AAED,UAGgB,UAAU,CAAC,IAAI,EAAE,UAAW;KAC3C,IAAI,IAAI,GA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BAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
{"version":3,"file":"index.js","sources":["src/custom/food-fell/src/props.ts","src/custom/food-fell/src/game/utils.ts","src/custom/food-fell/src/game/Goods.ts","src/custom/food-fell/src/game/object-pool-init.ts","src/custom/food-fell/src/game/GameView.ts","src/custom/food-fell/src/game/GameWrapper.ts","src/custom/food-fell/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport function getTexture(uuid) {\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\n}\n\nexport function getTextureByName(name) {\n\treturn getTexture(engine.getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Goods extends engine.Container {\n\tprivate _body:engine.Rect\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body\n\t\tbody = this._body =new engine.Rect()\n\t\t\n\t\t\n\t\tlet rain = new engine.Sprite(getTextureByName('雨滴'));\n\t\train[\"npcType\"]=\"rain\"\n\t\tlet stone = new engine.Sprite(getTextureByName('石块'));\n\t\tstone[\"npcType\"]=\"stone\"\n\t\tlet boom = new engine.Sprite(getTextureByName('炸弹'));\n\t\tboom[\"npcType\"]=\"boom\"\n\n\t\train.visible=false;\n\t\tstone.visible=false;\n\t\tboom.visible=false;\n\t\tbody.addChild(rain)\n\t\tbody.addChild(stone)\n\t\tbody.addChild(boom)\n\t\t\n\t\tthis.addChild(body);\n\t\tbody.width=.0001;\n\t\tbody.height=.0001;\n\t\tbody.mouseEnabled=false;\n\t}\n\n\n\tgetRandomNumberByRange(start, end) {\n\t\treturn Math.floor(Math.random() * (end - start) + start)\n\t}\n\n\treset() {\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tthis.y = 0;\n\t\tthis.x = (750-120)*Math.random()+30;\n\t\tthis.rotation = 0;\n\t\tlet random=Math.random()\n\n\t\tif(random<props.goodsProbability[0]){\n\t\t\tthis.showNpc(\"rain\")\n\t\t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"stone\")\n\t\t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"boom\")\n\t\t}\n\t}\n\n\n\tshowNpc(type){\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tthis._body.children[i].visible=false;\n\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t}\n\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tif(this._body.children[i][\"npcType\"]==type){\n\t\t\t\tthis[\"npcType\"]=type\n\t\t\t\tthis._body.children[i].visible=true;\n\t\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\tset anchorOffsetY(v) {\n\t\tthis._body.y = v;\n\t}\n}\n","/**\n * Created by rockyl on 2020-02-03.\n */\n\nimport {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\tprivate rectBg: engine.Rect;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\n\t//当前分数\n\tprivate score\n\n\t//游戏状态\n\tprivate gameIng;\n\n\t//npc出身计时器\n\tprivate timer\n\t//倒计时计时器\n\tprivate countdownTimer: any\n\t//倒计时\n\tprivate countdown: number\n\n\t//当前速度\n\tprivate speed: number\n\n\t// 当前场景上面的物品\n\tprivate goodsItems = []\n\n\n\tprivate _goods: Goods;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tprivate waterSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\t\tthis.NpcBg = new engine.Container();\n\t\tthis.NpcBg.alpha = 1;\n\t\tthis.NpcBg.width = 0;\n\t\tthis.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg)\n\n\t\n\n\t\tthis.player = new engine.Container();\n\t\tthis.player.mouseEnabled = false;\n\t//\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n\t\t//console.log(this.player.fillColor)\n\t\n\t\tthis.addChild(this.player);\n\n\t\tthis.waterSvga=createSvga(\"水花\")\n\t\tthis.playerSvga=createSvga(\"玩家\")\n\t\tthis.boomSvga=createSvga(\"炸弹svga\")\n\t\tthis.player.addChild(this.playerSvga);\n\t\tthis.player.addChild(this.waterSvga);\n\t\tthis.player.addChild(this.boomSvga);\n\t\tthis.playerSvga.gotoAndPlay(1);\n\n\t\tthis.visible=false;\n\t\tsetTimeout(()=>{\n\t\t\tthis.visible=true;\n\t\t\t// this.player.width=this.playerSvga.width;\n\t\t\t// this.player.height=this.playerSvga.height;\n\t\t\tthis.player.anchorY = this.player.height / 2;\n\t\t\tthis.player.anchorX = this.player.width / 2;\n\t\t\tconsole.log(this.player.width)\n\t\t\tconsole.log(this.playerSvga.width)\n\t\t\tthis.player.x = 375 - this.player.width / 2;\n\t\t\tthis.player.y = props.playerPositionY;\n\t\t},300)\n\n\t\t\n\t\tthis.rectBg = new engine.Rect();\n\t\tthis.rectBg.alpha = 0;\n\t\tthis.rectBg.width = 750;\n\t\tthis.rectBg.height = 1624;\n\t\tthis.addChild(this.rectBg)\n\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\n\t\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tthis.recycleGoods()\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.score = 0;\n\t\tthis.speed = 1\n\t\tthis.gameIng = true;\n\t\tthis.creatNpc()\n\t\tthis.beginNpc()\n\t\tthis.countdown = props.countDown;\n\t\t\n\t\tthis.countdownTimer = setInterval(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tif (this.countdown > 0) {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-time-update', {\n\t\t\t\t\t\ttime: this.countdown,\n\t\t\t\t\t});\n\t\t\t\t\tthis.countdown -= 1\n\t\t\t\t} else {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\treason: 1\n\t\t\t\t\t});\n\t\t\t\t\tthis.died()\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1000)\n\t}\n\n\t/**\n\t * npc开始掉落\n\t */\n\tbeginNpc() {\n\t\tthis.timer = setTimeout(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\t\tthis.creatNpc()\n\t\t\t}\n\t\t\t//递归执行\n\t\t\tthis.beginNpc()\n\t\t}, 2000 / this.speed)\n\t}\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\tthis.gameIng = false;\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t\tthis.gameIng = true;\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\tthis.reset()\n\t\tthis.start()\n\t}\n\n\t/**\n\t * 创建NPC\n\t */\n\tprivate creatNpc() {\n\t\tlet goods = this._goods = <Goods>ObjectPool.getObject(PoolName);\n\t\tthis.goodsItems.push(goods)\n\t\tthis.NpcBg.addChild(goods);\n\t\tgoods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = () => {\n\t\t\tif (goods.y > 1624) {\n\t\t\t\tthis.removeNpc(goods)\n\t\t\t} else {\n\t\t\t\tif (this.gameIng) {\n\t\t\t\t\t//速度叠加\n\t\t\t\t\tgoods.y += (4 * this.speed)\n\t\t\t\t\t//如果玩家和物品发生碰撞\n\t\t\t\t\tif (this.hasHit(this.player, goods)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (goods[\"npcType\"] == \"rain\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rainScore\n\t\t\t\t\t\t\tthis.waterSvga.visible=true;\n\t\t\t\t\t\t\tthis.waterSvga.play(false, false)\n\t\t\t\t\t\t\tthis.waterSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.waterSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"stone\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到石头\")\n\t\t\t\t\t\t\tthis.score += props.stoneScore\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"boom\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到炸弹\")\n\t\t\t\t\t\t\tthis.boomSvga.visible=true;\n\t\t\t\t\t\t\tthis.boomSvga.play(false, false)\n\t\t\t\t\t\t\tthis.boomSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.boomSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t\t\treason: 2\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.died()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-score-update', {\n\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.removeNpc(goods)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, this);\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.score = 0\n\t\tthis.pause()\n\t}\n\n\t/**\n\t * 回收指定物品\n\t * @param goods 物品\n\t */\n\tprivate removeNpc(goods) {\n\t\tthis.NpcBg.removeChild(goods);\n\t\tObjectPool.recycleObject(PoolName, goods);\n\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\tlet index = this.goodsItems.indexOf(goods);\n\t\tif (index > -1) {\n\t\t\tthis.goodsItems.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * 回收对象\n\t */\n\tprivate recycleGoods() {\n\t\tclearTimeout(this.timer)\n\t\tclearInterval(this.countdownTimer)\n\t\tfor (let goods of this.goodsItems) {\n\t\t\tif (goods) {\n\t\t\t\tthis.removeChild(goods);\n\t\t\t\tObjectPool.recycleObject(PoolName, goods);\n\t\t\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\t\t}\n\t\t}\n\t\tthis.goodsItems = []\n\t}\n\n\tprivate moveCatchX = 0\n\tprivate playerCatchX = 0\n\n\t/**\n\t * 碰撞检测\n\t * @param a a盒子\n\t * @param b b盒子\n\t */\n\tprivate hasHit(a, b) {\n\t\tif (\n\t\t\tMath.abs((a.x + a.width / 2) - (b.x + b.width / 2)) < a.width / 2 + b.width / 2\n\t\t\t&&\n\t\t\tMath.abs((a.y + a.height / 2) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate onDownStage = (e) => {\n\t\tthis.moveCatchX = e.localX;\n\t\tthis.playerCatchX = this.player.x\n\t}\n\n\tprivate onMoveStage = (e) => {\n\t\tif (this.gameIng) {\n\t\t\tthis.player.x = this.playerCatchX + (e.localX - this.moveCatchX)\n\t\t}\n\t}\n\n\tprivate onOutStage = (e) => {\n\t\tthis.moveCatchX = 0\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('food-fell-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('food-fell-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('food-fell-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('food-fell-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('food-fell-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('food-fell-clear', this.clear, this);\n\n\t\tthis.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\t\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tclear() {\n\t\tthis._gameView.visible = false;\n\t}\n\n\tprivate onTap(event) {\n\t//\tthis._gameView.tap(event);\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {GameWrapper} from \"./game/GameWrapper\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance = new GameWrapper();\n\treturn instance;\n}\n"],"names":["__extends","ObjectPool"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;UAEX,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;UAEe,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B;;UCVgB,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AAED,UAAgB,gBAAgB,CAAC,IAAI;KACpC,OAAO,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;AAED,UAGgB,UAAU,CAAC,IAAI,EAAE,UAAW;KAC3C,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AElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;"}
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment