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
1b305156
Commit
1b305156
authored
Sep 16, 2020
by
lujinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-a
parent
7de6de9a
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1453 additions
and
13 deletions
+1453
-13
rockji-new.json
dist/customs/rockji-new.json
+140
-0
rockji.json
dist/customs/rockji.json
+18
-2
app.js
src/custom/rockji-new/debug/app.js
+136
-0
index.html
src/custom/rockji-new/debug/index.html
+52
-0
load-assets.js
src/custom/rockji-new/debug/load-assets.js
+64
-0
main.js
src/custom/rockji-new/debug/main.js
+260
-0
main.js.map
src/custom/rockji-new/debug/main.js.map
+1
-0
props.js
src/custom/rockji-new/debug/props.js
+7
-0
meta.json
src/custom/rockji-new/meta.json
+137
-0
GameView.ts
src/custom/rockji-new/src/game/GameView.ts
+370
-0
GameWrapper.ts
src/custom/rockji-new/src/game/GameWrapper.ts
+65
-0
Goods.ts
src/custom/rockji-new/src/game/Goods.ts
+97
-0
object-pool-init.ts
src/custom/rockji-new/src/game/object-pool-init.ts
+14
-0
utils.ts
src/custom/rockji-new/src/game/utils.ts
+20
-0
index.ts
src/custom/rockji-new/src/index.ts
+14
-0
props.ts
src/custom/rockji-new/src/props.ts
+15
-0
main.js
src/custom/rockji/debug/main.js
+25
-9
main.js.map
src/custom/rockji/debug/main.js.map
+1
-1
meta.json
src/custom/rockji/meta.json
+17
-1
No files found.
dist/customs/rockji-new.json
0 → 100644
View file @
1b305156
{
"name"
:
"摇奖机"
,
"desc"
:
"摇奖机"
,
"props"
:
{
"boxImgSizeW"
:
{
"alias"
:
"奖品图片外框宽"
,
"type"
:
"number"
,
"default"
:
110
},
"boxImgSizeH"
:
{
"alias"
:
"奖品图片外框高"
,
"type"
:
"number"
,
"default"
:
111
},
"imgSizeW"
:
{
"alias"
:
"奖品图片宽"
,
"type"
:
"number"
,
"default"
:
99
},
"imgSizeH"
:
{
"alias"
:
"奖品图片高"
,
"type"
:
"number"
,
"default"
:
99
},
"spaceSizeX"
:
{
"alias"
:
"奖品横向间隙"
,
"type"
:
"number"
,
"default"
:
15
},
"spaceSizeY"
:
{
"alias"
:
"奖品纵向间隙"
,
"type"
:
"number"
,
"default"
:
20
},
"cOriginSizeX"
:
{
"alias"
:
"遮罩左边顶点坐标"
,
"type"
:
"number"
,
"default"
:
22
},
"cOriginSizeY"
:
{
"alias"
:
"遮罩左边顶点坐标"
,
"type"
:
"number"
,
"default"
:
19
},
"cSpaceSizeX"
:
{
"alias"
:
"每列奖品容器的横向间隙"
,
"type"
:
"number"
,
"default"
:
23
},
"maskSizeW"
:
{
"alias"
:
"遮罩宽"
,
"type"
:
"number"
,
"default"
:
428
},
"maskSizeH"
:
{
"alias"
:
"遮罩高"
,
"type"
:
"number"
,
"default"
:
221
},
"viewWidth"
:
{
"alias"
:
"模块宽"
,
"type"
:
"number"
,
"default"
:
472
},
"viewHeight"
:
{
"alias"
:
"模块高"
,
"type"
:
"number"
,
"default"
:
256
}
},
"assets"
:
[
{
"name"
:
"rock-背景"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png"
,
"uuid"
:
"7baa74f5-e057-4fd3-846f-f58ff7a92c3d"
,
"ext"
:
".png"
},
{
"name"
:
"奖品外框图"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/bee4c8c7fba8a83b18d3e43921118421f73f389d.png"
,
"uuid"
:
"80036ef2-d070-469b-afd0-54d8296cfbe9"
,
"ext"
:
".png"
}
],
"events"
:
{
"in"
:
{
"rock-info"
:
{
"alias"
:
"初始化进入页面调用"
,
"data"
:
[
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png"
,
"id"
:
"o58df634f"
,
"index"
:
1
,
"name"
:
"一等奖"
,
"prizeId"
:
"sss_3"
,
"prizeType"
:
2
,
"refId"
:
"49781"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png"
,
"id"
:
"o4a578392"
,
"index"
:
2
,
"name"
:
"二等奖"
,
"prizeId"
:
"sss_2"
,
"prizeType"
:
2
,
"refId"
:
"49780"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_1"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
}
]
},
"rock-start"
:
{
"alias"
:
"开始摇奖,透传中奖id"
,
"data"
:
{
"prizeId"
:
"sss_3"
}
},
"rock-reset"
:
{
"alias"
:
"关闭中奖弹窗时调用"
}
},
"out"
:
{
"rock-gameover"
:
{
"alias"
:
"摇奖机停止是派发"
}
}
},
"id"
:
"rockji-new"
,
"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['rockji-new'] = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\r\n\t
function prepareProps() {
\r\n\t
var metaProps = getProps();
\r\n\t
engine.injectProp(props, metaProps);
\r\n\t
}
\r\n\t
function injectProps(p) {
\r\n\t
engine.injectProp(props, p);
\r\n\t
}
\r\n\t
//# sourceMappingURL=props.js.map
\n\n\t
var GameView = (function (_super) {
\r\n\t
tslib.__extends(GameView, _super);
\r\n\t
function GameView() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
_this.textureCache = {};
\r\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\r\n\t
_this.prizeId = props.prizeId;
\r\n\t
_this.prizes = props.prizes;
\r\n\t
_this.countdown = 150;
\r\n\t
_this.timeSpace = 500;
\r\n\t
console.log(
\"
props.prizes=
\"
, props.prizes);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameView.prototype.setup = function () {
\r\n\t
if (this._hasSetup) {
\r\n\t
return;
\r\n\t
}
\r\n\t
this._hasSetup = true;
\r\n\t
this.itemInfo = {};
\r\n\t
this.mainContainer = new engine.Container();
\r\n\t
this.viewContainer = new engine.Container();
\r\n\t
this.addChild(this.viewContainer);
\r\n\t
this.viewContainer.width = props.viewWidth;
\r\n\t
this.viewContainer.height = props.viewHeight;
\r\n\t
this.bgImg = new engine.Image();
\r\n\t
this.bgImg.source = engine.getAssetByName(
\"
rock-背景
\"
).url;
\r\n\t
this.viewContainer.addChild(this.bgImg);
\r\n\t
this.container0 = new engine.Container();
\r\n\t
this.container1 = new engine.Container();
\r\n\t
this.container2 = new engine.Container();
\r\n\t
this.mainContainer.addChild(this.container0);
\r\n\t
this.mainContainer.addChild(this.container1);
\r\n\t
this.mainContainer.addChild(this.container2);
\r\n\t
this.viewContainer.addChild(this.mainContainer);
\r\n\t
this.mainContainer.x = props.cOriginSizeX;
\r\n\t
this.mainContainer.y = props.cOriginSizeY;
\r\n\t
var mask = new engine.Rect();
\r\n\t
mask.x = props.cOriginSizeX;
\r\n\t
mask.y = props.cOriginSizeY;
\r\n\t
mask.fillColor = 0xffff00;
\r\n\t
mask.width = props.maskSizeW;
\r\n\t
mask.height = props.maskSizeH;
\r\n\t
this.addChild(mask);
\r\n\t
this.mainContainer.mask = mask;
\r\n\t
if (this.prizes.length > 3) {
\r\n\t
this.createItem(2);
\r\n\t
this.prizeMaxH = this.prizes.length * (props.boxImgSizeH + props.spaceSizeY) + props.spaceSizeY;
\r\n\t
}
\r\n\t
else {
\r\n\t
this.createItem(1);
\r\n\t
this.prizeMaxH = 4 * (props.boxImgSizeH + props.spaceSizeY) + props.spaceSizeY;
\r\n\t
}
\r\n\t
this.orgY = -(this.prizeMaxH - props.maskSizeH) + props.boxImgSizeH * 0.5;
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
this['container' + i].x = i * (props.cSpaceSizeX * 2 + props.boxImgSizeW);
\r\n\t
this['container' + i].y = this.orgY;
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.createItem = function (type) {
\r\n\t
var len = 4;
\r\n\t
if (type == 1) {
\r\n\t
len = 4;
\r\n\t
}
\r\n\t
else if (type == 2) {
\r\n\t
len = this.prizes.length;
\r\n\t
}
\r\n\t
for (var j = 0; j < 3; j++) {
\r\n\t
this.itemInfo[
\"
items
\"
+ j] = [];
\r\n\t
for (var i = 0; i < len; i++) {
\r\n\t
var url = this.prizes[i % this.prizes.length].icon;
\r\n\t
var itemBox = new engine.Image();
\r\n\t
itemBox.source = engine.getAssetByName(
\"
奖品外框图
\"
).url;
\r\n\t
itemBox.width = props.boxImgSizeW;
\r\n\t
itemBox.height = props.boxImgSizeH;
\r\n\t
itemBox.x = props.spaceSizeX;
\r\n\t
itemBox.y = props.spaceSizeY + i * (props.boxImgSizeH + props.spaceSizeY);
\r\n\t
this[
\"
container
\"
+ j].addChild(itemBox);
\r\n\t
var item = new engine.Sprite();
\r\n\t
item.texture = this.getTexture(url);
\r\n\t
this.itemInfo[
\"
items
\"
+ j][i] = item;
\r\n\t
item.width = props.imgSizeW;
\r\n\t
item.height = props.imgSizeH;
\r\n\t
item.x = (itemBox.width - item.width) / 2;
\r\n\t
item.y = (itemBox.height - item.height) / 2;
\r\n\t
itemBox.addChild(item);
\r\n\t
}
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.reset = function () {
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
this[
\"
container
\"
+ i].y = this.orgY;
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.start = function () {
\r\n\t
var _this = this;
\r\n\t
this.prizeId = props.prizeId;
\r\n\t
console.log(
\"
this.prizeId=
\"
, this.prizeId);
\r\n\t
var _loop_1 = function (i) {
\r\n\t
engine.Tween.removeTweens(this_1[
\"
container
\"
+ i]);
\r\n\t
setTimeout(function () {
\r\n\t
engine.Tween.get(_this[
\"
container
\"
+ i], { loop: true }).to({ y: 0 }, _this.countdown).call(function () {
\r\n\t
_this[
\"
container
\"
+ i].y = _this.orgY;
\r\n\t
});
\r\n\t
}, this_1.timeSpace * i);
\r\n\t
};
\r\n\t
var this_1 = this;
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
_loop_1(i);
\r\n\t
}
\r\n\t
setTimeout(function () {
\r\n\t
var _loop_2 = function (i) {
\r\n\t
setTimeout(function () {
\r\n\t
_this[
\"
container
\"
+ i].y = _this.orgY;
\r\n\t
engine.Tween.removeTweens(_this[
\"
container
\"
+ i]);
\r\n\t
engine.Tween.get(_this[
\"
container
\"
+ i]).to({ y: -(props.boxImgSizeH * 0.5 + props.spaceSizeY) }, 1500);
\r\n\t
}, _this.timeSpace * i);
\r\n\t
};
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
_loop_2(i);
\r\n\t
}
\r\n\t
_this.setPrizePos();
\r\n\t
setTimeout(function () {
\r\n\t
engine.globalEvent.dispatchEvent('rock-gameover');
\r\n\t
}, _this.timeSpace * 2 + 2000);
\r\n\t
}, 2500);
\r\n\t
};
\r\n\t
GameView.prototype.setPrizePos = function () {
\r\n\t
var direct = Math.random() > 0.5 ? 1 : -1;
\r\n\t
for (var j = 0; j < 3; j++) {
\r\n\t
var len = this.itemInfo[
\"
items
\"
+ j].length;
\r\n\t
direct *= -1;
\r\n\t
for (var i = 0; i < len; i++) {
\r\n\t
var plen = this.prizes.length;
\r\n\t
if (direct > 0) {
\r\n\t
this.itemInfo[
\"
items
\"
+ j][i].texture = this.getTexture(this.prizes[(plen - 1) - (i % plen)].icon);
\r\n\t
}
\r\n\t
else {
\r\n\t
this.itemInfo[
\"
items
\"
+ j][i].texture = this.getTexture(this.prizes[(i % plen)].icon);
\r\n\t
}
\r\n\t
}
\r\n\t
}
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
var p = this.itemInfo[
\"
items
\"
+ i][1].parent;
\r\n\t
p.removeChild(this.itemInfo[
\"
items
\"
+ i][1]);
\r\n\t
var ix = this.itemInfo[
\"
items
\"
+ i][1].x;
\r\n\t
var iy = this.itemInfo[
\"
items
\"
+ i][1].y;
\r\n\t
var iw = this.itemInfo[
\"
items
\"
+ i][1].width;
\r\n\t
var ih = this.itemInfo[
\"
items
\"
+ i][1].height;
\r\n\t
var nItem = new engine.Sprite();
\r\n\t
nItem.texture = this.getTexture(this.getPrizeUrl(this.prizeId));
\r\n\t
this.itemInfo[
\"
items
\"
+ i][1] = nItem;
\r\n\t
nItem.x = ix;
\r\n\t
nItem.y = iy;
\r\n\t
nItem.width = iw;
\r\n\t
nItem.height = ih;
\r\n\t
p.addChild(nItem);
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.getPrizeUrl = function (pid) {
\r\n\t
var purl =
\"\"
;
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
if (this.prizes[i].prizeId == pid) {
\r\n\t
return this.prizes[i].icon;
\r\n\t
}
\r\n\t
}
\r\n\t
return purl;
\r\n\t
};
\r\n\t
GameView.prototype.pause = function () {
\r\n\t
};
\r\n\t
GameView.prototype.revive = function () {
\r\n\t
};
\r\n\t
GameView.prototype.resume = function () {
\r\n\t
};
\r\n\t
GameView.prototype.died = function () {
\r\n\t
this.pause();
\r\n\t
};
\r\n\t
GameView.prototype.getTexture = function (url) {
\r\n\t
var texture = this.textureCache[url];
\r\n\t
if (!texture) {
\r\n\t
texture = this.textureCache[url] = engine.Texture.fromImage(url);
\r\n\t
}
\r\n\t
return texture;
\r\n\t
};
\r\n\t
return GameView;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameView.js.map
\n\n\t
var GameWrapper = (function (_super) {
\r\n\t
tslib.__extends(GameWrapper, _super);
\r\n\t
function GameWrapper() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
engine.globalEvent.addEventListener('rock-reset', _this.reset, _this);
\r\n\t
engine.globalEvent.addEventListener('rock-start', _this.start, _this);
\r\n\t
engine.globalEvent.addEventListener('rock-info', _this.rinfo, _this);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameWrapper.prototype.reset = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._gameView.visible = true;
\r\n\t
this._gameView.reset();
\r\n\t
};
\r\n\t
GameWrapper.prototype.start = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._status = 1;
\r\n\t
this._gameView.start();
\r\n\t
};
\r\n\t
GameWrapper.prototype.rinfo = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
console.log(
\"
event=
\"
, event);
\r\n\t
console.log(
\"
event.data =
\"
, event.data);
\r\n\t
var gameView = this._gameView = new GameView();
\r\n\t
this.addChild(gameView);
\r\n\t
};
\r\n\t
GameWrapper.prototype.pause = function () {
\r\n\t
this._gameView.pause();
\r\n\t
};
\r\n\t
GameWrapper.prototype.resume = function () {
\r\n\t
this._gameView.resume();
\r\n\t
};
\r\n\t
GameWrapper.prototype.revive = function () {
\r\n\t
this._gameView.revive();
\r\n\t
};
\r\n\t
GameWrapper.prototype.clear = function () {
\r\n\t
this._gameView.visible = false;
\r\n\t
};
\r\n\t
GameWrapper.prototype.onTap = function (event) {
\r\n\t
};
\r\n\t
return GameWrapper;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\r\n\t
prepareProps();
\r\n\t
injectProps(props);
\r\n\t
var instance = new GameWrapper();
\r\n\t
return instance;
\r\n\t
}
\r\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})));
\n
"
}
dist/customs/rockji.json
View file @
1b305156
...
...
@@ -2,6 +2,16 @@
"name"
:
"摇奖机"
,
"desc"
:
"摇奖机"
,
"props"
:
{
"boxImgSizeW"
:
{
"alias"
:
"奖品图片外框宽"
,
"type"
:
"number"
,
"default"
:
110
},
"boxImgSizeH"
:
{
"alias"
:
"奖品图片外框高"
,
"type"
:
"number"
,
"default"
:
111
},
"imgSizeW"
:
{
"alias"
:
"奖品图片宽"
,
"type"
:
"number"
,
...
...
@@ -15,7 +25,7 @@
"spaceSizeX"
:
{
"alias"
:
"奖品横向间隙"
,
"type"
:
"number"
,
"default"
:
20
"default"
:
15
},
"spaceSizeY"
:
{
"alias"
:
"奖品纵向间隙"
,
...
...
@@ -64,6 +74,12 @@
"url"
:
"//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png"
,
"uuid"
:
"7baa74f5-e057-4fd3-846f-f58ff7a92c3d"
,
"ext"
:
".png"
},
{
"name"
:
"奖品外框图"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/bee4c8c7fba8a83b18d3e43921118421f73f389d.png"
,
"uuid"
:
"80036ef2-d070-469b-afd0-54d8296cfbe9"
,
"ext"
:
".png"
}
],
"events"
:
{
...
...
@@ -120,5 +136,5 @@
}
},
"id"
:
"rockji"
,
"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.rockji = 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
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.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\n\t
_this.prizeId = props.prizeId;
\n\t
_this.prizes = props.prizes;
\n\t
_this.countdown = 150;
\n\t
_this.timeSpace = 500;
\n\t
console.log(
\"
props.prizes=
\"
, props.prizes);
\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
this.itemInfo = {};
\n\t
this.mainContainer = new engine.Container();
\n\t
this.viewContainer = new engine.Container();
\n\t
this.addChild(this.viewContainer);
\n\t
this.viewContainer.width = props.viewWidth;
\n\t
this.viewContainer.height = props.viewHeight;
\n\t
this.bgImg = new engine.Image();
\n\t
this.bgImg.source = getAssetByName(
\"
rock-背景
\"
).url;
\n\t
this.viewContainer.addChild(this.bgImg);
\n\t
this.container0 = new engine.Container();
\n\t
this.container1 = new engine.Container();
\n\t
this.container2 = new engine.Container();
\n\t
this.mainContainer.addChild(this.container0);
\n\t
this.mainContainer.addChild(this.container1);
\n\t
this.mainContainer.addChild(this.container2);
\n\t
this.viewContainer.addChild(this.mainContainer);
\n\t
this.mainContainer.x = props.cOriginSizeX;
\n\t
this.mainContainer.y = props.cOriginSizeY;
\n\t
var mask = new engine.Rect();
\n\t
mask.x = props.cOriginSizeX;
\n\t
mask.y = props.cOriginSizeY;
\n\t
mask.fillColor = 0xffff00;
\n\t
mask.width = props.maskSizeW;
\n\t
mask.height = props.maskSizeH;
\n\t
this.addChild(mask);
\n\t
this.mainContainer.mask = mask;
\n\t
if (this.prizes.length > 3) {
\n\t
this.createItem(2);
\n\t
this.prizeMaxH = this.prizes.length * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;
\n\t
}
\n\t
else {
\n\t
this.createItem(1);
\n\t
this.prizeMaxH = 4 * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;
\n\t
}
\n\t
this.orgY = -(this.prizeMaxH - props.maskSizeH) + props.imgSizeH * 0.5;
\n\t
for (var i = 0; i < 3; i++) {
\n\t
this['container' + i].x = i * (props.cSpaceSizeX * 2 + props.imgSizeW);
\n\t
this['container' + i].y = this.orgY;
\n\t
}
\n\t
};
\n\t
GameView.prototype.createItem = function (type) {
\n\t
var len = 4;
\n\t
if (type == 1) {
\n\t
len = 4;
\n\t
}
\n\t
else if (type == 2) {
\n\t
len = this.prizes.length;
\n\t
}
\n\t
for (var j = 0; j < 3; j++) {
\n\t
this.itemInfo[
\"
items
\"
+ j] = [];
\n\t
for (var i = 0; i < len; i++) {
\n\t
var url = this.prizes[i % this.prizes.length].icon;
\n\t
var item = new engine.Sprite();
\n\t
item.texture = engine.Texture.fromImage(url);
\n\t
this.itemInfo[
\"
items
\"
+ j][i] = item;
\n\t
this[
\"
container
\"
+ j].addChild(item);
\n\t
item.width = props.imgSizeW;
\n\t
item.height = props.imgSizeH;
\n\t
item.x = props.spaceSizeX;
\n\t
item.y = props.spaceSizeY + i * (props.imgSizeH + props.spaceSizeY);
\n\t
}
\n\t
}
\n\t
};
\n\t
GameView.prototype.reset = function () {
\n\t
for (var i = 0; i < 3; i++) {
\n\t
this[
\"
container
\"
+ i].y = this.orgY;
\n\t
}
\n\t
};
\n\t
GameView.prototype.start = function () {
\n\t
var _this = this;
\n\t
this.prizeId = props.prizeId;
\n\t
console.log(
\"
this.prizeId=
\"
, this.prizeId);
\n\t
var _loop_1 = function (i) {
\n\t
engine.Tween.removeTweens(this_1[
\"
container
\"
+ i]);
\n\t
setTimeout(function () {
\n\t
engine.Tween.get(_this[
\"
container
\"
+ i], { loop: true }).to({ y: 0 }, _this.countdown).call(function () {
\n\t
_this[
\"
container
\"
+ i].y = _this.orgY;
\n\t
});
\n\t
}, this_1.timeSpace * i);
\n\t
};
\n\t
var this_1 = this;
\n\t
for (var i = 0; i < 3; i++) {
\n\t
_loop_1(i);
\n\t
}
\n\t
setTimeout(function () {
\n\t
var _loop_2 = function (i) {
\n\t
setTimeout(function () {
\n\t
_this[
\"
container
\"
+ i].y = _this.orgY;
\n\t
engine.Tween.removeTweens(_this[
\"
container
\"
+ i]);
\n\t
engine.Tween.get(_this[
\"
container
\"
+ i]).to({ y: -(props.imgSizeH * 0.5 + props.spaceSizeY) }, 1500);
\n\t
}, _this.timeSpace * i);
\n\t
};
\n\t
for (var i = 0; i < 3; i++) {
\n\t
_loop_2(i);
\n\t
}
\n\t
_this.setPrizePos();
\n\t
setTimeout(function () {
\n\t
engine.globalEvent.dispatchEvent('rock-gameover');
\n\t
}, _this.timeSpace * 2 + 2000);
\n\t
}, 2500);
\n\t
};
\n\t
GameView.prototype.setPrizePos = function () {
\n\t
var direct = Math.random() > 0.5 ? 1 : -1;
\n\t
for (var j = 0; j < 3; j++) {
\n\t
var len = this.itemInfo[
\"
items
\"
+ j].length;
\n\t
direct *= -1;
\n\t
for (var i = 0; i < len; i++) {
\n\t
var plen = this.prizes.length;
\n\t
if (direct > 0) {
\n\t
this.itemInfo[
\"
items
\"
+ j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;
\n\t
}
\n\t
else {
\n\t
this.itemInfo[
\"
items
\"
+ j][i].source = this.prizes[(i % plen)].icon;
\n\t
}
\n\t
}
\n\t
}
\n\t
for (var i = 0; i < 3; i++) {
\n\t
this.itemInfo[
\"
items
\"
+ i][1].source = this.getPrizeUrl(this.prizeId);
\n\t
}
\n\t
};
\n\t
GameView.prototype.getPrizeUrl = function (pid) {
\n\t
for (var _i = 0, _a = this.prizes; _i < _a.length; _i++) {
\n\t
var prize = _a[_i];
\n\t
if (prize.prizeId == pid) {
\n\t
return prize.icon;
\n\t
}
\n\t
}
\n\t
};
\n\t
GameView.prototype.pause = function () {
\n\t
};
\n\t
GameView.prototype.revive = function () {
\n\t
};
\n\t
GameView.prototype.resume = function () {
\n\t
};
\n\t
GameView.prototype.died = function () {
\n\t
this.pause();
\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('rock-reset', _this.reset, _this);
\n\t
engine.globalEvent.addEventListener('rock-start', _this.start, _this);
\n\t
engine.globalEvent.addEventListener('rock-info', _this.rinfo, _this);
\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.rinfo = function (event) {
\n\t
injectProps(event.data);
\n\t
console.log(
\"
event=
\"
, event);
\n\t
console.log(
\"
event.data =
\"
, event.data);
\n\t
var gameView = this._gameView = new GameView();
\n\t
this.addChild(gameView);
\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
"
"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.rockji = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\
r\n\t
function prepareProps() {
\r\n\t
var metaProps = getProps();
\r\n\t
engine.injectProp(props, metaProps);
\r\n\t
}
\r\n\t
function injectProps(p) {
\r\n\t
engine.injectProp(props, p);
\r\n\t
}
\r\n\t
//# sourceMappingURL=props.js.map
\n\n\t
var GameView = (function (_super) {
\r\n\t
tslib.__extends(GameView, _super);
\r\n\t
function GameView() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
_this.textureCache = {};
\r\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\r\n\t
_this.prizeId = props.prizeId;
\r\n\t
_this.prizes = props.prizes;
\r\n\t
_this.countdown = 150;
\r\n\t
_this.timeSpace = 500;
\r\n\t
console.log(
\"
props.prizes=
\"
, props.prizes);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameView.prototype.setup = function () {
\r\n\t
if (this._hasSetup) {
\r\n\t
return;
\r\n\t
}
\r\n\t
this._hasSetup = true;
\r\n\t
this.itemInfo = {};
\r\n\t
this.mainContainer = new engine.Container();
\r\n\t
this.viewContainer = new engine.Container();
\r\n\t
this.addChild(this.viewContainer);
\r\n\t
this.viewContainer.width = props.viewWidth;
\r\n\t
this.viewContainer.height = props.viewHeight;
\r\n\t
this.bgImg = new engine.Image();
\r\n\t
this.bgImg.source = getAssetByName(
\"
rock-背景
\"
).url;
\r\n\t
this.viewContainer.addChild(this.bgImg);
\r\n\t
this.container0 = new engine.Container();
\r\n\t
this.container1 = new engine.Container();
\r\n\t
this.container2 = new engine.Container();
\r\n\t
this.mainContainer.addChild(this.container0);
\r\n\t
this.mainContainer.addChild(this.container1);
\r\n\t
this.mainContainer.addChild(this.container2);
\r\n\t
this.viewContainer.addChild(this.mainContainer);
\r\n\t
this.mainContainer.x = props.cOriginSizeX;
\r\n\t
this.mainContainer.y = props.cOriginSizeY;
\r\n\t
var mask = new engine.Rect();
\r\n\t
mask.x = props.cOriginSizeX;
\r\n\t
mask.y = props.cOriginSizeY;
\r\n\t
mask.fillColor = 0xffff00;
\r\n\t
mask.width = props.maskSizeW;
\r\n\t
mask.height = props.maskSizeH;
\r\n\t
this.addChild(mask);
\r\n\t
this.mainContainer.mask = mask;
\r\n\t
if (this.prizes.length > 3) {
\r\n\t
this.createItem(2);
\r\n\t
this.prizeMaxH = this.prizes.length * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;
\r\n\t
}
\r\n\t
else {
\r\n\t
this.createItem(1);
\r\n\t
this.prizeMaxH = 4 * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;
\r\n\t
}
\r\n\t
this.orgY = -(this.prizeMaxH - props.maskSizeH) + props.boxImgSizeH * 0.5;
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
this['container' + i].x = i * (props.cSpaceSizeX * 2 + props.imgSizeW);
\r\n\t
this['container' + i].y = this.orgY;
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.createItem = function (type) {
\r\n\t
var len = 4;
\r\n\t
if (type == 1) {
\r\n\t
len = 4;
\r\n\t
}
\r\n\t
else if (type == 2) {
\r\n\t
len = this.prizes.length;
\r\n\t
}
\r\n\t
for (var j = 0; j < 3; j++) {
\r\n\t
this.itemInfo[
\"
items
\"
+ j] = [];
\r\n\t
for (var i = 0; i < len; i++) {
\r\n\t
var url = this.prizes[i % this.prizes.length].icon;
\r\n\t
var itemBox = new engine.Image();
\r\n\t
itemBox.source = getAssetByName(
\"
奖品外框图
\"
).url;
\r\n\t
itemBox.width = props.boxImgSizeW;
\r\n\t
itemBox.height = props.boxImgSizeH;
\r\n\t
itemBox.x = props.spaceSizeX;
\r\n\t
itemBox.y = props.spaceSizeY + i * (props.boxImgSizeH + props.spaceSizeY);
\r\n\t
this[
\"
container
\"
+ j].addChild(itemBox);
\r\n\t
var item = new engine.Sprite();
\r\n\t
item.texture = this.getTexture(url);
\r\n\t
this.itemInfo[
\"
items
\"
+ j][i] = item;
\r\n\t
item.width = props.imgSizeW;
\r\n\t
item.height = props.imgSizeH;
\r\n\t
item.x = (itemBox.width - item.width) / 2;
\r\n\t
item.y = (itemBox.height - item.height) / 2;
\r\n\t
itemBox.addChild(item);
\r\n\t
}
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.reset = function () {
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
this[
\"
container
\"
+ i].y = this.orgY;
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.start = function () {
\r\n\t
var _this = this;
\r\n\t
this.prizeId = props.prizeId;
\r\n\t
console.log(
\"
this.prizeId=
\"
, this.prizeId);
\r\n\t
var _loop_1 = function (i) {
\r\n\t
engine.Tween.removeTweens(this_1[
\"
container
\"
+ i]);
\r\n\t
setTimeout(function () {
\r\n\t
engine.Tween.get(_this[
\"
container
\"
+ i], { loop: true }).to({ y: 0 }, _this.countdown).call(function () {
\r\n\t
_this[
\"
container
\"
+ i].y = _this.orgY;
\r\n\t
});
\r\n\t
}, this_1.timeSpace * i);
\r\n\t
};
\r\n\t
var this_1 = this;
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
_loop_1(i);
\r\n\t
}
\r\n\t
setTimeout(function () {
\r\n\t
var _loop_2 = function (i) {
\r\n\t
setTimeout(function () {
\r\n\t
_this[
\"
container
\"
+ i].y = _this.orgY;
\r\n\t
engine.Tween.removeTweens(_this[
\"
container
\"
+ i]);
\r\n\t
engine.Tween.get(_this[
\"
container
\"
+ i]).to({ y: -(props.boxImgSizeH * 0.5 + props.spaceSizeY) }, 1500);
\r\n\t
}, _this.timeSpace * i);
\r\n\t
};
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
_loop_2(i);
\r\n\t
}
\r\n\t
_this.setPrizePos();
\r\n\t
setTimeout(function () {
\r\n\t
engine.globalEvent.dispatchEvent('rock-gameover');
\r\n\t
}, _this.timeSpace * 2 + 2000);
\r\n\t
}, 2500);
\r\n\t
};
\r\n\t
GameView.prototype.setPrizePos = function () {
\r\n\t
var direct = Math.random() > 0.5 ? 1 : -1;
\r\n\t
for (var j = 0; j < 3; j++) {
\r\n\t
var len = this.itemInfo[
\"
items
\"
+ j].length;
\r\n\t
direct *= -1;
\r\n\t
for (var i = 0; i < len; i++) {
\r\n\t
var plen = this.prizes.length;
\r\n\t
if (direct > 0) {
\r\n\t
this.itemInfo[
\"
items
\"
+ j][i].texture = this.getTexture(this.prizes[(plen - 1) - (i % plen)].icon);
\r\n\t
}
\r\n\t
else {
\r\n\t
this.itemInfo[
\"
items
\"
+ j][i].texture = this.getTexture(this.prizes[(i % plen)].icon);
\r\n\t
}
\r\n\t
}
\r\n\t
}
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
var p = this.itemInfo[
\"
items
\"
+ i][1].parent;
\r\n\t
p.removeChild(this.itemInfo[
\"
items
\"
+ i][1]);
\r\n\t
var ix = this.itemInfo[
\"
items
\"
+ i][1].x;
\r\n\t
var iy = this.itemInfo[
\"
items
\"
+ i][1].y;
\r\n\t
var iw = this.itemInfo[
\"
items
\"
+ i][1].width;
\r\n\t
var ih = this.itemInfo[
\"
items
\"
+ i][1].height;
\r\n\t
var nItem = new engine.Sprite();
\r\n\t
nItem.texture = this.getTexture(this.getPrizeUrl(this.prizeId));
\r\n\t
this.itemInfo[
\"
items
\"
+ i][1] = nItem;
\r\n\t
nItem.x = ix;
\r\n\t
nItem.y = iy;
\r\n\t
nItem.width = iw;
\r\n\t
nItem.height = ih;
\r\n\t
p.addChild(nItem);
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.getPrizeUrl = function (pid) {
\r\n\t
var purl =
\"\"
;
\r\n\t
for (var i = 0; i < 3; i++) {
\r\n\t
if (this.prizes[i].prizeId == pid) {
\r\n\t
return this.prizes[i].icon;
\r\n\t
}
\r\n\t
}
\r\n\t
return purl;
\r\n\t
};
\r\n\t
GameView.prototype.pause = function () {
\r\n\t
};
\r\n\t
GameView.prototype.revive = function () {
\r\n\t
};
\r\n\t
GameView.prototype.resume = function () {
\r\n\t
};
\r\n\t
GameView.prototype.died = function () {
\r\n\t
this.pause();
\r\n\t
};
\r\n\t
GameView.prototype.getTexture = function (url) {
\r\n\t
var texture = this.textureCache[url];
\r\n\t
if (!texture) {
\r\n\t
texture = this.textureCache[url] = engine.Texture.fromImage(url);
\r\n\t
}
\r\n\t
return texture;
\r\n\t
};
\r\n\t
return GameView;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameView.js.map
\n\n\t
var GameWrapper = (function (_super) {
\r\n\t
tslib.__extends(GameWrapper, _super);
\r\n\t
function GameWrapper() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
engine.globalEvent.addEventListener('rock-reset', _this.reset, _this);
\r\n\t
engine.globalEvent.addEventListener('rock-start', _this.start, _this);
\r\n\t
engine.globalEvent.addEventListener('rock-info', _this.rinfo, _this);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameWrapper.prototype.reset = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._gameView.visible = true;
\r\n\t
this._gameView.reset();
\r\n\t
};
\r\n\t
GameWrapper.prototype.start = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._status = 1;
\r\n\t
this._gameView.start();
\r\n\t
};
\r\n\t
GameWrapper.prototype.rinfo = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
console.log(
\"
event=
\"
, event);
\r\n\t
console.log(
\"
event.data =
\"
, event.data);
\r\n\t
var gameView = this._gameView = new GameView();
\r\n\t
this.addChild(gameView);
\r\n\t
};
\r\n\t
GameWrapper.prototype.pause = function () {
\r\n\t
this._gameView.pause();
\r\n\t
};
\r\n\t
GameWrapper.prototype.resume = function () {
\r\n\t
this._gameView.resume();
\r\n\t
};
\r\n\t
GameWrapper.prototype.revive = function () {
\r\n\t
this._gameView.revive();
\r\n\t
};
\r\n\t
GameWrapper.prototype.clear = function () {
\r\n\t
this._gameView.visible = false;
\r\n\t
};
\r\n\t
GameWrapper.prototype.onTap = function (event) {
\r\n\t
};
\r\n\t
return GameWrapper;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\r\n\t
prepareProps();
\r\n\t
injectProps(props);
\r\n\t
var instance = new GameWrapper();
\r\n\t
return instance;
\r\n\t
}
\r\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})));
\n
"
}
src/custom/rockji-new/debug/app.js
0 → 100644
View file @
1b305156
/**
* Created by renjianfeng on 2020-03-13.
*/
const
customId
=
'rockji-new'
;
(
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
,
}
}],
customs
:
[]
},
null
,
function
()
{
setTimeout
(()
=>
{
engine
.
addCustomModule
(
customId
,
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
));
engine
.
globalEvent
.
dispatchEvent
(
'rock-info'
,
{
prizes
:
[
{
"icon"
:
"//yun.duiba.com.cn/polaris/odzr8wuh7y.3417f09f476bd948682b54ec13018796a63aa15f.jpeg"
,
"id"
:
"o58df634f"
,
"index"
:
1
,
"name"
:
"一等奖"
,
"prizeId"
:
"sss_3"
,
"prizeType"
:
2
,
"refId"
:
"49781"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/o0shhpxtoy.22951ab8ac8975c1c08ba7933caa21fe2d629806.jpg"
,
"id"
:
"o4a578392"
,
"index"
:
2
,
"name"
:
"二等奖"
,
"prizeId"
:
"sss_2"
,
"prizeType"
:
2
,
"refId"
:
"49780"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/xnjwcjf5ip.b7e68855228ddc5ef86bed1fefe63e7b1a65ebdf.jpeg"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_1"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/u9vmvsvdeb.ebd3ca0774faddbf7220feca9eba30dfda1a343a.jpg"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_4"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/v6uikiq60u.cbf7c5a21b83079aa3ea2a4fd41e7234fb8578a4.jpg"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_5"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/10元话费.a34ae4a9411cfd82065fa366f8c3e3ec7a897fed.png"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_6"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
}]
});
},
100
);
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'rock-start'
,
{
prizeId
:
"sss_2"
});
},
5000
);
});
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/rockji-new/debug/index.html
0 → 100644
View file @
1b305156
<!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
:
white
;
}
.game-container
{
width
:
100%
;
height
:
100%
;
line-height
:
0
;
font-size
:
0
;
}
</style>
</head>
<body>
<div
id=
"game-container"
class=
"game-container"
></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/engine.fbc60c6d3cb30e5ab97e82d392d9efeee91b8581.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/rockji-new/debug/load-assets.js
0 → 100644
View file @
1b305156
/**
* Created by rockyl on 2020-01-21.
*/
const
assets
=
[
{
"name"
:
"雨滴0"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/badb3627bbcc75276a3eed53daa8b0a454ced6eb.png"
,
"uuid"
:
"d3ce99da-89e1-447d-8c52-b3f391925c3c"
,
"ext"
:
".png"
},
{
"name"
:
"雨滴1"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5cc0092913c571eeb52317b8e1e0dc715793049c.png"
,
"uuid"
:
"02f17008-1d8d-4108-a0fc-03fbc71fd118"
,
"ext"
:
".png"
},
{
"name"
:
"雨滴2"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/4b938949b85d50b36ef0f66450643495efbf7580.png"
,
"uuid"
:
"46aa4f8a-9a6c-4210-8ffd-92da0dd3bc75"
,
"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/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886.svga"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"ext"
:
".svga"
},
{
"name"
:
"石头svga"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a.svga"
,
"uuid"
:
"846a139d-0990-4db4-a323-f22379932ee4"
,
"ext"
:
".svga"
},
{
"name"
:
"炸弹svga"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/3b58e7ace031b09c651cf8e7202f9c86e86852c9.svga"
,
"uuid"
:
"d7a3947b-7fcb-48f2-9ddf-2f075d37a619"
,
"ext"
:
".svga"
},
{
"name"
:
"玩家"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/db0130d36ef79865be9c753ea0627027f16341d8.png"
,
"uuid"
:
"4931d296-4421-4a2f-8299-7bab87407c72"
,
"ext"
:
".png"
}
];
function
loadAssets
(
customModuleAssets
,
onProgress
,
onComplete
){
return
engine
.
loadAssets
(
assets
.
concat
(...
customModuleAssets
),
onProgress
,
onComplete
);
}
src/custom/rockji-new/debug/main.js
0 → 100644
View file @
1b305156
(
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
[
'rockji-new'
]
=
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
var
GameView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameView
,
_super
);
function
GameView
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
textureCache
=
{};
_this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
_this
.
setup
,
_this
);
_this
.
prizeId
=
props
.
prizeId
;
_this
.
prizes
=
props
.
prizes
;
_this
.
countdown
=
150
;
_this
.
timeSpace
=
500
;
console
.
log
(
"props.prizes="
,
props
.
prizes
);
return
_this
;
}
GameView
.
prototype
.
setup
=
function
()
{
if
(
this
.
_hasSetup
)
{
return
;
}
this
.
_hasSetup
=
true
;
this
.
itemInfo
=
{};
this
.
mainContainer
=
new
engine
.
Container
();
this
.
viewContainer
=
new
engine
.
Container
();
this
.
addChild
(
this
.
viewContainer
);
this
.
viewContainer
.
width
=
props
.
viewWidth
;
this
.
viewContainer
.
height
=
props
.
viewHeight
;
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
.
source
=
engine
.
getAssetByName
(
"rock-背景"
).
url
;
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
container0
=
new
engine
.
Container
();
this
.
container1
=
new
engine
.
Container
();
this
.
container2
=
new
engine
.
Container
();
this
.
mainContainer
.
addChild
(
this
.
container0
);
this
.
mainContainer
.
addChild
(
this
.
container1
);
this
.
mainContainer
.
addChild
(
this
.
container2
);
this
.
viewContainer
.
addChild
(
this
.
mainContainer
);
this
.
mainContainer
.
x
=
props
.
cOriginSizeX
;
this
.
mainContainer
.
y
=
props
.
cOriginSizeY
;
var
mask
=
new
engine
.
Rect
();
mask
.
x
=
props
.
cOriginSizeX
;
mask
.
y
=
props
.
cOriginSizeY
;
mask
.
fillColor
=
0xffff00
;
mask
.
width
=
props
.
maskSizeW
;
mask
.
height
=
props
.
maskSizeH
;
this
.
addChild
(
mask
);
this
.
mainContainer
.
mask
=
mask
;
if
(
this
.
prizes
.
length
>
3
)
{
this
.
createItem
(
2
);
this
.
prizeMaxH
=
this
.
prizes
.
length
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
)
+
props
.
spaceSizeY
;
}
else
{
this
.
createItem
(
1
);
this
.
prizeMaxH
=
4
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
)
+
props
.
spaceSizeY
;
}
this
.
orgY
=
-
(
this
.
prizeMaxH
-
props
.
maskSizeH
)
+
props
.
boxImgSizeH
*
0.5
;
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
this
[
'container'
+
i
].
x
=
i
*
(
props
.
cSpaceSizeX
*
2
+
props
.
boxImgSizeW
);
this
[
'container'
+
i
].
y
=
this
.
orgY
;
}
};
GameView
.
prototype
.
createItem
=
function
(
type
)
{
var
len
=
4
;
if
(
type
==
1
)
{
len
=
4
;
}
else
if
(
type
==
2
)
{
len
=
this
.
prizes
.
length
;
}
for
(
var
j
=
0
;
j
<
3
;
j
++
)
{
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
var
itemBox
=
new
engine
.
Image
();
itemBox
.
source
=
engine
.
getAssetByName
(
"奖品外框图"
).
url
;
itemBox
.
width
=
props
.
boxImgSizeW
;
itemBox
.
height
=
props
.
boxImgSizeH
;
itemBox
.
x
=
props
.
spaceSizeX
;
itemBox
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
);
this
[
"container"
+
j
].
addChild
(
itemBox
);
var
item
=
new
engine
.
Sprite
();
item
.
texture
=
this
.
getTexture
(
url
);
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
item
.
width
=
props
.
imgSizeW
;
item
.
height
=
props
.
imgSizeH
;
item
.
x
=
(
itemBox
.
width
-
item
.
width
)
/
2
;
item
.
y
=
(
itemBox
.
height
-
item
.
height
)
/
2
;
itemBox
.
addChild
(
item
);
}
}
};
GameView
.
prototype
.
reset
=
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
this
[
"container"
+
i
].
y
=
this
.
orgY
;
}
};
GameView
.
prototype
.
start
=
function
()
{
var
_this
=
this
;
this
.
prizeId
=
props
.
prizeId
;
console
.
log
(
"this.prizeId="
,
this
.
prizeId
);
var
_loop_1
=
function
(
i
)
{
engine
.
Tween
.
removeTweens
(
this_1
[
"container"
+
i
]);
setTimeout
(
function
()
{
engine
.
Tween
.
get
(
_this
[
"container"
+
i
],
{
loop
:
true
}).
to
({
y
:
0
},
_this
.
countdown
).
call
(
function
()
{
_this
[
"container"
+
i
].
y
=
_this
.
orgY
;
});
},
this_1
.
timeSpace
*
i
);
};
var
this_1
=
this
;
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
_loop_1
(
i
);
}
setTimeout
(
function
()
{
var
_loop_2
=
function
(
i
)
{
setTimeout
(
function
()
{
_this
[
"container"
+
i
].
y
=
_this
.
orgY
;
engine
.
Tween
.
removeTweens
(
_this
[
"container"
+
i
]);
engine
.
Tween
.
get
(
_this
[
"container"
+
i
]).
to
({
y
:
-
(
props
.
boxImgSizeH
*
0.5
+
props
.
spaceSizeY
)
},
1500
);
},
_this
.
timeSpace
*
i
);
};
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
_loop_2
(
i
);
}
_this
.
setPrizePos
();
setTimeout
(
function
()
{
engine
.
globalEvent
.
dispatchEvent
(
'rock-gameover'
);
},
_this
.
timeSpace
*
2
+
2000
);
},
2500
);
};
GameView
.
prototype
.
setPrizePos
=
function
()
{
var
direct
=
Math
.
random
()
>
0.5
?
1
:
-
1
;
for
(
var
j
=
0
;
j
<
3
;
j
++
)
{
var
len
=
this
.
itemInfo
[
"items"
+
j
].
length
;
direct
*=
-
1
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
plen
=
this
.
prizes
.
length
;
if
(
direct
>
0
)
{
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
this
.
getTexture
(
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
);
}
else
{
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
this
.
getTexture
(
this
.
prizes
[(
i
%
plen
)].
icon
);
}
}
}
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
p
=
this
.
itemInfo
[
"items"
+
i
][
1
].
parent
;
p
.
removeChild
(
this
.
itemInfo
[
"items"
+
i
][
1
]);
var
ix
=
this
.
itemInfo
[
"items"
+
i
][
1
].
x
;
var
iy
=
this
.
itemInfo
[
"items"
+
i
][
1
].
y
;
var
iw
=
this
.
itemInfo
[
"items"
+
i
][
1
].
width
;
var
ih
=
this
.
itemInfo
[
"items"
+
i
][
1
].
height
;
var
nItem
=
new
engine
.
Sprite
();
nItem
.
texture
=
this
.
getTexture
(
this
.
getPrizeUrl
(
this
.
prizeId
));
this
.
itemInfo
[
"items"
+
i
][
1
]
=
nItem
;
nItem
.
x
=
ix
;
nItem
.
y
=
iy
;
nItem
.
width
=
iw
;
nItem
.
height
=
ih
;
p
.
addChild
(
nItem
);
}
};
GameView
.
prototype
.
getPrizeUrl
=
function
(
pid
)
{
var
purl
=
""
;
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
if
(
this
.
prizes
[
i
].
prizeId
==
pid
)
{
return
this
.
prizes
[
i
].
icon
;
}
}
return
purl
;
};
GameView
.
prototype
.
pause
=
function
()
{
};
GameView
.
prototype
.
revive
=
function
()
{
};
GameView
.
prototype
.
resume
=
function
()
{
};
GameView
.
prototype
.
died
=
function
()
{
this
.
pause
();
};
GameView
.
prototype
.
getTexture
=
function
(
url
)
{
var
texture
=
this
.
textureCache
[
url
];
if
(
!
texture
)
{
texture
=
this
.
textureCache
[
url
]
=
engine
.
Texture
.
fromImage
(
url
);
}
return
texture
;
};
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
(
'rock-reset'
,
_this
.
reset
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'rock-start'
,
_this
.
start
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'rock-info'
,
_this
.
rinfo
,
_this
);
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
.
rinfo
=
function
(
event
)
{
injectProps
(
event
.
data
);
console
.
log
(
"event="
,
event
);
console
.
log
(
"event.data = "
,
event
.
data
);
var
gameView
=
this
.
_gameView
=
new
GameView
();
this
.
addChild
(
gameView
);
};
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/rockji-new/debug/main.js.map
0 → 100644
View file @
1b305156
{"version":3,"file":"index.js","sources":["src/custom/rockji-new/src/props.ts","src/custom/rockji-new/src/game/GameView.ts","src/custom/rockji-new/src/game/GameWrapper.ts","src/custom/rockji-new/src/index.ts"],"sourcesContent":["/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\r\n\tengine.injectProp(props, metaProps);\r\n}\r\n\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","/**\r\n * Created by rockyl on 2018/8/16.\r\n */\r\n\r\nimport {props} from \"../props\";\r\nimport {playSound, createSvga} from \"./utils\";\r\nimport ObjectPool = engine.ObjectPool;\r\nimport {getTextureByName} from \"./utils\";\r\nimport {Goods} from \"./Goods\";\r\nimport {PoolName} from \"./object-pool-init\";\r\n\r\n\r\nexport default class GameView extends engine.Container {\r\n\r\n\tprivate _hasSetup;\r\n\r\n\t//玩家\r\n\tprivate player: engine.Container;\r\n\t//触摸层\r\n\t// private rectBg: engine.Rect;\r\n\tprivate rectBg: engine.Container;\r\n\t//npc层\r\n\tprivate NpcBg: engine.Container;\r\n\t//倒计时\r\n\tprivate countdown: number;\r\n\t//每列滚动时间间隔\r\n\tprivate timeSpace: number;\r\n\r\n\tprivate prizes;\r\n\tprivate bgImg: engine.Image;\r\n\tprivate bgImgUrl: string;\r\n\tprivate itemInfo: any;\r\n\tprivate prizeMaxH: number;\r\n\tprivate orgY: number;\r\n\r\n\tprivate prizeId: string;\r\n\r\n\tprivate container0: engine.Container;\r\n\tprivate container1: engine.Container;\r\n\tprivate container2: engine.Container;\r\n\r\n\tprivate mainContainer: engine.Container;\r\n\tprivate viewContainer: engine.Container;\r\n\r\n\tprivate configInfo: any;\r\n\r\n\tprivate textureCache = {};\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n\t\t// this.configInfo = {\r\n\t\t// \tprizes:[\r\n\t\t// \t\t{type:0, url:'//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png'},\r\n\t\t// \t\t{type:1, url:'//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png'},\r\n\t\t// \t\t{type:2, url:'//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png'}\r\n\t\t// \t],//奖品链接列表\r\n\t\t// \tbgImgUrl:'//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png',\r\n\t\t// \timgSize:{w:99,h:103},//奖品尺寸\r\n\t\t// \tspaceSize:{x:20, y:20},//奖品横向和纵向间隙\r\n\t\t// \tcOriginSize:{x:22, y:19},//遮罩左边定点位置\r\n\t\t// \tcSpaceSize:{x:23, y:0},//每列奖品的间隙\r\n\t\t// }\r\n\r\n\r\n\t\t// this.bgImgUrl = '//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png';\r\n\r\n\t\t// this.maskSize = {w:428, h:221};\r\n\t\t// this.imgSize = {w:99,h:103};\r\n\t\t// this.spaceSize = {x:20, y:20};\r\n\t\t// // this.originSize = {x:0, y:0}\r\n\t\t// this.cOriginSize = {x:22, y:19};//遮罩的初始坐标\r\n\t\t// this.cSpaceSize = {x:23, y:0};//奖品容器横向纵向的边距\r\n\r\n\t\t// this.prizes = [\r\n\t\t// \t{\r\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png\",\r\n\t\t// \t\t\"id\":\"o58df634f\",\r\n\t\t// \t\t\"index\":1,\r\n\t\t// \t\t\"name\":\"一等奖\",\r\n\t\t// \t\t\"prizeId\":\"sss_3\",\r\n\t\t// \t\t\"prizeType\":2,\r\n\t\t// \t\t\"refId\":\"49781\",\r\n\t\t// \t\t\"refType\":\"virtual\"\r\n\t\t// \t},\r\n\t\t// \t{\r\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png\",\r\n\t\t// \t\t\"id\":\"o4a578392\",\r\n\t\t// \t\t\"index\":2,\r\n\t\t// \t\t\"name\":\"二等奖\",\r\n\t\t// \t\t\"prizeId\":\"sss_2\",\r\n\t\t// \t\t\"prizeType\":2,\r\n\t\t// \t\t\"refId\":\"49780\",\r\n\t\t// \t\t\"refType\":\"virtual\"\r\n\t\t// \t},\r\n\t\t// \t{\r\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png\",\r\n\t\t// \t\t\"id\":\"o26efbbeb\",\r\n\t\t// \t\t\"index\":3,\r\n\t\t// \t\t\"name\":\"三等奖\",\r\n\t\t// \t\t\"prizeId\":\"sss_1\",\r\n\t\t// \t\t\"prizeType\":2,\r\n\t\t// \t\t\"refId\":\"49779\",\r\n\t\t// \t\t\"refType\":\"virtual\"\r\n\t\t// }];\r\n\t\tthis.prizeId = props.prizeId;\r\n\t\tthis.prizes = props.prizes;\r\n\t\tthis.countdown = 150;\r\n\t\tthis.timeSpace = 500;\r\n\r\n\t\tconsole.log(\"props.prizes=\", props.prizes);\r\n\t}\r\n\r\n\tprivate waterSvga\r\n\tprivate stoneSvga\r\n\tprivate boomSvga\r\n\tprivate playerSvga\r\n\r\n\tsetup() {\r\n\t\tif (this._hasSetup) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._hasSetup = true;\r\n\r\n\t\tthis.itemInfo = {};\r\n\r\n\t\t// this.bgImg = new engine.Image();\r\n\t\t// this.bgImg.source = this.bgImgUrl;\r\n\r\n\t\tthis.mainContainer = new engine.Container();\r\n\t\tthis.viewContainer = new engine.Container();\r\n\t\tthis.addChild(this.viewContainer);\r\n\r\n\t\tthis.viewContainer.width = props.viewWidth;\r\n\t\tthis.viewContainer.height = props.viewHeight;\r\n\r\n\t\t//this.bgImg = new engine.Image(getTextureByName('rock-背景'));\r\n\t\tthis.bgImg = new engine.Image();\r\n\t\tthis.bgImg.source = engine.getAssetByName(\"rock-背景\").url;\r\n\t\tthis.viewContainer.addChild(this.bgImg);\r\n\r\n\t\tthis.container0 = new engine.Container();\r\n\t\tthis.container1 = new engine.Container();\r\n\t\tthis.container2 = new engine.Container();\r\n\r\n\t\tthis.mainContainer.addChild(this.container0);\r\n\t\tthis.mainContainer.addChild(this.container1);\r\n\t\tthis.mainContainer.addChild(this.container2);\r\n\r\n\t\tthis.viewContainer.addChild(this.mainContainer);\r\n\t\tthis.mainContainer.x = props.cOriginSizeX;\r\n\t\tthis.mainContainer.y = props.cOriginSizeY;\r\n\r\n\t\tlet mask = new engine.Rect();\r\n\t\tmask.x = props.cOriginSizeX;\r\n\t\tmask.y = props.cOriginSizeY;\r\n\t\tmask.fillColor = 0xffff00;\r\n\t\tmask.width = props.maskSizeW;\r\n\t\tmask.height = props.maskSizeH;\r\n\t\tthis.addChild(mask);\r\n\r\n\t\tthis.mainContainer.mask = mask;\r\n\r\n\t\t// this.container0.width = 140;\r\n\t\t// this.container0.height = 221;\r\n\r\n\t\t// this.container1.width = 140()\r\n\t\t// this.container1.height = 221;\r\n\r\n\t\t// this.container2.width = 140;\r\n\t\t// this.container2.height = 221;\r\n\r\n\t\tif (this.prizes.length > 3) {\r\n\t\t\tthis.createItem(2);\r\n\t\t\tthis.prizeMaxH = this.prizes.length * (props.boxImgSizeH + props.spaceSizeY) + props.spaceSizeY;\r\n\t\t} else {\r\n\t\t\tthis.createItem(1);\r\n\t\t\tthis.prizeMaxH = 4 * (props.boxImgSizeH + props.spaceSizeY) + props.spaceSizeY;\r\n\t\t}\r\n\r\n\t\tthis.orgY = -(this.prizeMaxH - props.maskSizeH) + props.boxImgSizeH * 0.5;\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tthis['container' + i].x = i * (props.cSpaceSizeX * 2 + props.boxImgSizeW);\r\n\t\t\t// this['container' + i].y = this.orgY;\r\n\t\t\tthis['container' + i].y = this.orgY;\r\n\r\n\t\t}\r\n\r\n\t\t//mask 438 221\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * type 1.小于4个奖品 2.4个及以上奖品\r\n\t */\r\n\tprivate createItem(type: number): void {\r\n\t\tlet len = 4;\r\n\t\tif (type == 1) {\r\n\t\t\tlen = 4;\r\n\t\t} else if (type == 2) {\r\n\t\t\tlen = this.prizes.length;\r\n\t\t}\r\n\r\n\t\tfor (let j = 0; j < 3; j++) {\r\n\t\t\tthis.itemInfo[\"items\" + j] = [];\r\n\t\t\tfor (let i = 0; i < len; i++) {\r\n\t\t\t\tlet url = this.prizes[i % this.prizes.length].icon;\r\n\t\t\t\r\n\t\t\t\tlet itemBox = new engine.Image();\r\n\t\t\t\titemBox.source = engine.getAssetByName(\"奖品外框图\").url;\r\n\t\t\t\titemBox.width = props.boxImgSizeW;\r\n\t\t\t\titemBox.height = props.boxImgSizeH;\r\n\t\t\t\titemBox.x = props.spaceSizeX;\r\n\t\t\t\titemBox.y = props.spaceSizeY + i * (props.boxImgSizeH + props.spaceSizeY);\r\n\t\t\t\tthis[\"container\" + j].addChild(itemBox);\r\n\r\n\t\t\t\tlet item = new engine.Sprite();\r\n\t\t\t\titem.texture = this.getTexture(url);\r\n\t\t\t\tthis.itemInfo[\"items\" + j][i] = item;\r\n\t\t\t\titem.width = props.imgSizeW;\r\n\t\t\t\titem.height = props.imgSizeH;\r\n\t\t\t\titem.x = (itemBox.width - item.width) / 2;\r\n\t\t\t\titem.y = (itemBox.height - item.height) / 2;\r\n\t\t\t\titemBox.addChild(item);\r\n\r\n\t\t\t\t// console.log('i=', i)\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * 重置场景\r\n\t */\r\n\treset() {\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tthis[\"container\" + i].y = this.orgY;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * 开始\r\n\t */\r\n\tstart() {\r\n\t\tthis.prizeId = props.prizeId;\r\n\t\tconsole.log(\"this.prizeId=\", this.prizeId);\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tengine.Tween.get(this[\"container\" + i], {loop: true}).to({y: 0}, this.countdown).call(() => {\r\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\r\n\t\t\t\t});\r\n\t\t\t}, this.timeSpace * i);\r\n\t\t}\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\t\t// this[\"container\" + i].y = 0;//this.orgY;\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\r\n\t\t\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\r\n\t\t\t\t\tengine.Tween.get(this[\"container\" + i]).to({y: -(props.boxImgSizeH * 0.5 + props.spaceSizeY)}, 1500);\r\n\t\t\t\t}, this.timeSpace * i);\r\n\t\t\t}\r\n\t\t\tthis.setPrizePos();\r\n\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tengine.globalEvent.dispatchEvent('rock-gameover');\r\n\t\t\t}, this.timeSpace * 2 + 2000);\r\n\t\t}, 2500);\r\n\r\n\t}\r\n\r\n\tprivate setPrizePos(): void {\r\n\t\tlet direct = Math.random() > 0.5 ? 1 : -1;\r\n\t\tfor (let j = 0; j < 3; j++) {\r\n\t\t\tlet len = this.itemInfo[\"items\" + j].length;\r\n\t\t\tdirect *= -1;\r\n\t\t\tfor (let i = 0; i < len; i++) {\r\n\t\t\t\tlet plen = this.prizes.length;\r\n\t\t\t\tif (direct > 0) {\r\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = this.getTexture(this.prizes[(plen - 1) - (i % plen)].icon);\r\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = this.getTexture(this.prizes[(i % plen)].icon);\r\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(i % plen)].icon;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\t// this.prizeId = \"sss_3\";\r\n\r\n\t\t\t// this.itemInfo[\"items\" + i][1].texture = this.getTexture(this.getPrizeUrl(this.prizeId));\r\n\t\t\tlet p = this.itemInfo[\"items\" + i][1].parent;\r\n\t\t\tp.removeChild(this.itemInfo[\"items\" + i][1]);\r\n\r\n\t\t\tlet ix = this.itemInfo[\"items\" + i][1].x;\r\n\t\t\tlet iy = this.itemInfo[\"items\" + i][1].y;\r\n\t\t\tlet iw = this.itemInfo[\"items\" + i][1].width;\r\n\t\t\tlet ih = this.itemInfo[\"items\" + i][1].height;\r\n\r\n\t\t\tlet nItem = new engine.Sprite();\r\n\t\t\tnItem.texture = this.getTexture(this.getPrizeUrl(this.prizeId));\r\n\t\t\tthis.itemInfo[\"items\" + i][1] = nItem;\r\n\t\t\tnItem.x = ix;\r\n\t\t\tnItem.y = iy;\r\n\t\t\tnItem.width = iw;\r\n\t\t\tnItem.height = ih;\r\n\t\t\tp.addChild(nItem);\r\n\r\n\r\n\t\t\t// this.itemInfo[\"items\" + i][1].source = this.getPrizeUrl(this.prizeId);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tprivate getPrizeUrl(pid: string): string {\r\n\t\tlet purl = \"\";\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tif (this.prizes[i].prizeId == pid) {\r\n\t\t\t\treturn this.prizes[i].icon;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn purl;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * 暂停\r\n\t */\r\n\tpause() {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * 恢复\r\n\t */\r\n\trevive() {\r\n\t}\r\n\r\n\t/**\r\n\t * 重新开始\r\n\t */\r\n\tresume() {\r\n\t\t// this.reset()\r\n\t\t// this.start()\r\n\t}\r\n\r\n\t/**\r\n\t * 玩家死亡\r\n\t */\r\n\tprivate died() {\r\n\t\tthis.pause()\r\n\t}\r\n\r\n\t/**\r\n\t * 获取纹理(缓存)\r\n\t * @param url\r\n\t */\r\n\tgetTexture(url) {\r\n\t\tlet texture = this.textureCache[url];\r\n\t\tif (!texture) {\r\n\t\t\ttexture = this.textureCache[url] = engine.Texture.fromImage(url);\r\n\t\t}\r\n\t\treturn texture;\r\n\t}\r\n}\r\n","/**\r\n * Created by rockyl on 2020-01-09.\r\n */\r\n\r\nimport GameView from \"./GameView\";\r\nimport {injectProps} from \"../props\";\r\n\r\n\r\nexport class GameWrapper extends engine.Container {\r\n\tprivate _status;\r\n\tprivate _gameView: GameView;\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tengine.globalEvent.addEventListener('rock-reset', this.reset, this);\r\n\t\tengine.globalEvent.addEventListener('rock-start', this.start, this);\r\n\t\tengine.globalEvent.addEventListener('rock-info', this.rinfo, this);\r\n\r\n\t\t// this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\r\n\t\t// gameView.reset()\r\n\t\t// gameView.start()\r\n\t}\r\n\r\n\treset(event: engine.Event) {\t\t\r\n\t\tinjectProps(event.data);\r\n\t\tthis._gameView.visible = true;\r\n\t\tthis._gameView.reset();\r\n\t}\r\n\r\n\tstart(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\t\tthis._status = 1;\r\n\t\tthis._gameView.start();\r\n\t}\r\n\r\n\tprivate rinfo(event: engine.Event):void{\r\n\t\tinjectProps(event.data);\r\n\t\tconsole.log(\"event=\",event)\r\n\t\tconsole.log(\"event.data = \",event.data);\r\n\r\n\t\tlet gameView = this._gameView = new GameView();\r\n\t\tthis.addChild(gameView);\r\n\r\n\t}\r\n\r\n\tpause() {\r\n\t\tthis._gameView.pause();\r\n\t}\r\n\r\n\tresume() {\r\n\t\tthis._gameView.resume();\r\n\t}\r\n\r\n\trevive() {\r\n\t\tthis._gameView.revive();\r\n\t}\r\n\r\n\tclear() {\r\n\t\tthis._gameView.visible = false;\r\n\t}\r\n\r\n\tprivate onTap(event) {\r\n\t//\tthis._gameView.tap(event);\r\n\t}\r\n}\r\n","/**\r\n * Created by rockyl on 2019-11-20.\r\n */\r\n\r\nimport {GameWrapper} from \"./game/GameWrapper\";\r\nimport {injectProps, prepareProps} from \"./props\";\r\n\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\r\n\tlet instance = new GameWrapper();\r\n\treturn instance;\r\n}\r\n"],"names":["__extends"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAA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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/rockji-new/debug/props.js
0 → 100644
View file @
1b305156
/**
* Created by rockyl on 2020-01-21.
*/
let
customModuleProps
=
{
};
src/custom/rockji-new/meta.json
0 → 100644
View file @
1b305156
{
"name"
:
"摇奖机"
,
"desc"
:
"摇奖机"
,
"props"
:
{
"boxImgSizeW"
:{
"alias"
:
"奖品图片外框宽"
,
"type"
:
"number"
,
"default"
:
110
},
"boxImgSizeH"
:{
"alias"
:
"奖品图片外框高"
,
"type"
:
"number"
,
"default"
:
111
},
"imgSizeW"
:
{
"alias"
:
"奖品图片宽"
,
"type"
:
"number"
,
"default"
:
99
},
"imgSizeH"
:
{
"alias"
:
"奖品图片高"
,
"type"
:
"number"
,
"default"
:
99
},
"spaceSizeX"
:
{
"alias"
:
"奖品横向间隙"
,
"type"
:
"number"
,
"default"
:
15
},
"spaceSizeY"
:
{
"alias"
:
"奖品纵向间隙"
,
"type"
:
"number"
,
"default"
:
20
},
"cOriginSizeX"
:
{
"alias"
:
"遮罩左边顶点坐标"
,
"type"
:
"number"
,
"default"
:
22
},
"cOriginSizeY"
:
{
"alias"
:
"遮罩左边顶点坐标"
,
"type"
:
"number"
,
"default"
:
19
},
"cSpaceSizeX"
:
{
"alias"
:
"每列奖品容器的横向间隙"
,
"type"
:
"number"
,
"default"
:
23
},
"maskSizeW"
:
{
"alias"
:
"遮罩宽"
,
"type"
:
"number"
,
"default"
:
428
},
"maskSizeH"
:
{
"alias"
:
"遮罩高"
,
"type"
:
"number"
,
"default"
:
221
},
"viewWidth"
:
{
"alias"
:
"模块宽"
,
"type"
:
"number"
,
"default"
:
472
},
"viewHeight"
:
{
"alias"
:
"模块高"
,
"type"
:
"number"
,
"default"
:
256
}
},
"assets"
:
[
{
"name"
:
"rock-背景"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png"
,
"uuid"
:
"7baa74f5-e057-4fd3-846f-f58ff7a92c3d"
,
"ext"
:
".png"
},
{
"name"
:
"奖品外框图"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/bee4c8c7fba8a83b18d3e43921118421f73f389d.png"
,
"uuid"
:
"80036ef2-d070-469b-afd0-54d8296cfbe9"
,
"ext"
:
".png"
}
],
"events"
:
{
"in"
:
{
"rock-info"
:
{
"alias"
:
"初始化进入页面调用"
,
"data"
:
[{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png"
,
"id"
:
"o58df634f"
,
"index"
:
1
,
"name"
:
"一等奖"
,
"prizeId"
:
"sss_3"
,
"prizeType"
:
2
,
"refId"
:
"49781"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png"
,
"id"
:
"o4a578392"
,
"index"
:
2
,
"name"
:
"二等奖"
,
"prizeId"
:
"sss_2"
,
"prizeType"
:
2
,
"refId"
:
"49780"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_1"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
}]
},
"rock-start"
:
{
"alias"
:
"开始摇奖,透传中奖id"
,
"data"
:{
"prizeId"
:
"sss_3"
}
},
"rock-reset"
:
{
"alias"
:
"关闭中奖弹窗时调用"
}
},
"out"
:
{
"rock-gameover"
:
{
"alias"
:
"摇奖机停止是派发"
}
}
}
}
\ No newline at end of file
src/custom/rockji-new/src/game/GameView.ts
0 → 100644
View file @
1b305156
/**
* 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"
;
export
default
class
GameView
extends
engine
.
Container
{
private
_hasSetup
;
//玩家
private
player
:
engine
.
Container
;
//触摸层
// private rectBg: engine.Rect;
private
rectBg
:
engine
.
Container
;
//npc层
private
NpcBg
:
engine
.
Container
;
//倒计时
private
countdown
:
number
;
//每列滚动时间间隔
private
timeSpace
:
number
;
private
prizes
;
private
bgImg
:
engine
.
Image
;
private
bgImgUrl
:
string
;
private
itemInfo
:
any
;
private
prizeMaxH
:
number
;
private
orgY
:
number
;
private
prizeId
:
string
;
private
container0
:
engine
.
Container
;
private
container1
:
engine
.
Container
;
private
container2
:
engine
.
Container
;
private
mainContainer
:
engine
.
Container
;
private
viewContainer
:
engine
.
Container
;
private
configInfo
:
any
;
private
textureCache
=
{};
constructor
()
{
super
();
this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
this
.
setup
,
this
);
// this.configInfo = {
// prizes:[
// {type:0, url:'//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png'},
// {type:1, url:'//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png'},
// {type:2, url:'//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png'}
// ],//奖品链接列表
// bgImgUrl:'//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png',
// imgSize:{w:99,h:103},//奖品尺寸
// spaceSize:{x:20, y:20},//奖品横向和纵向间隙
// cOriginSize:{x:22, y:19},//遮罩左边定点位置
// cSpaceSize:{x:23, y:0},//每列奖品的间隙
// }
// this.bgImgUrl = '//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png';
// this.maskSize = {w:428, h:221};
// this.imgSize = {w:99,h:103};
// this.spaceSize = {x:20, y:20};
// // this.originSize = {x:0, y:0}
// this.cOriginSize = {x:22, y:19};//遮罩的初始坐标
// this.cSpaceSize = {x:23, y:0};//奖品容器横向纵向的边距
// this.prizes = [
// {
// "icon":"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png",
// "id":"o58df634f",
// "index":1,
// "name":"一等奖",
// "prizeId":"sss_3",
// "prizeType":2,
// "refId":"49781",
// "refType":"virtual"
// },
// {
// "icon":"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png",
// "id":"o4a578392",
// "index":2,
// "name":"二等奖",
// "prizeId":"sss_2",
// "prizeType":2,
// "refId":"49780",
// "refType":"virtual"
// },
// {
// "icon":"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png",
// "id":"o26efbbeb",
// "index":3,
// "name":"三等奖",
// "prizeId":"sss_1",
// "prizeType":2,
// "refId":"49779",
// "refType":"virtual"
// }];
this
.
prizeId
=
props
.
prizeId
;
this
.
prizes
=
props
.
prizes
;
this
.
countdown
=
150
;
this
.
timeSpace
=
500
;
console
.
log
(
"props.prizes="
,
props
.
prizes
);
}
private
waterSvga
private
stoneSvga
private
boomSvga
private
playerSvga
setup
()
{
if
(
this
.
_hasSetup
)
{
return
;
}
this
.
_hasSetup
=
true
;
this
.
itemInfo
=
{};
// this.bgImg = new engine.Image();
// this.bgImg.source = this.bgImgUrl;
this
.
mainContainer
=
new
engine
.
Container
();
this
.
viewContainer
=
new
engine
.
Container
();
this
.
addChild
(
this
.
viewContainer
);
this
.
viewContainer
.
width
=
props
.
viewWidth
;
this
.
viewContainer
.
height
=
props
.
viewHeight
;
//this.bgImg = new engine.Image(getTextureByName('rock-背景'));
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
.
source
=
engine
.
getAssetByName
(
"rock-背景"
).
url
;
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
container0
=
new
engine
.
Container
();
this
.
container1
=
new
engine
.
Container
();
this
.
container2
=
new
engine
.
Container
();
this
.
mainContainer
.
addChild
(
this
.
container0
);
this
.
mainContainer
.
addChild
(
this
.
container1
);
this
.
mainContainer
.
addChild
(
this
.
container2
);
this
.
viewContainer
.
addChild
(
this
.
mainContainer
);
this
.
mainContainer
.
x
=
props
.
cOriginSizeX
;
this
.
mainContainer
.
y
=
props
.
cOriginSizeY
;
let
mask
=
new
engine
.
Rect
();
mask
.
x
=
props
.
cOriginSizeX
;
mask
.
y
=
props
.
cOriginSizeY
;
mask
.
fillColor
=
0xffff00
;
mask
.
width
=
props
.
maskSizeW
;
mask
.
height
=
props
.
maskSizeH
;
this
.
addChild
(
mask
);
this
.
mainContainer
.
mask
=
mask
;
// this.container0.width = 140;
// this.container0.height = 221;
// this.container1.width = 140()
// this.container1.height = 221;
// this.container2.width = 140;
// this.container2.height = 221;
if
(
this
.
prizes
.
length
>
3
)
{
this
.
createItem
(
2
);
this
.
prizeMaxH
=
this
.
prizes
.
length
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
)
+
props
.
spaceSizeY
;
}
else
{
this
.
createItem
(
1
);
this
.
prizeMaxH
=
4
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
)
+
props
.
spaceSizeY
;
}
this
.
orgY
=
-
(
this
.
prizeMaxH
-
props
.
maskSizeH
)
+
props
.
boxImgSizeH
*
0.5
;
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
this
[
'container'
+
i
].
x
=
i
*
(
props
.
cSpaceSizeX
*
2
+
props
.
boxImgSizeW
);
// this['container' + i].y = this.orgY;
this
[
'container'
+
i
].
y
=
this
.
orgY
;
}
//mask 438 221
}
/**
* type 1.小于4个奖品 2.4个及以上奖品
*/
private
createItem
(
type
:
number
):
void
{
let
len
=
4
;
if
(
type
==
1
)
{
len
=
4
;
}
else
if
(
type
==
2
)
{
len
=
this
.
prizes
.
length
;
}
for
(
let
j
=
0
;
j
<
3
;
j
++
)
{
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
let
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
let
itemBox
=
new
engine
.
Image
();
itemBox
.
source
=
engine
.
getAssetByName
(
"奖品外框图"
).
url
;
itemBox
.
width
=
props
.
boxImgSizeW
;
itemBox
.
height
=
props
.
boxImgSizeH
;
itemBox
.
x
=
props
.
spaceSizeX
;
itemBox
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
);
this
[
"container"
+
j
].
addChild
(
itemBox
);
let
item
=
new
engine
.
Sprite
();
item
.
texture
=
this
.
getTexture
(
url
);
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
item
.
width
=
props
.
imgSizeW
;
item
.
height
=
props
.
imgSizeH
;
item
.
x
=
(
itemBox
.
width
-
item
.
width
)
/
2
;
item
.
y
=
(
itemBox
.
height
-
item
.
height
)
/
2
;
itemBox
.
addChild
(
item
);
// console.log('i=', i)
}
}
}
/**
* 重置场景
*/
reset
()
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
this
[
"container"
+
i
].
y
=
this
.
orgY
;
}
}
/**
* 开始
*/
start
()
{
this
.
prizeId
=
props
.
prizeId
;
console
.
log
(
"this.prizeId="
,
this
.
prizeId
);
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
engine
.
Tween
.
removeTweens
(
this
[
"container"
+
i
]);
setTimeout
(()
=>
{
engine
.
Tween
.
get
(
this
[
"container"
+
i
],
{
loop
:
true
}).
to
({
y
:
0
},
this
.
countdown
).
call
(()
=>
{
this
[
"container"
+
i
].
y
=
this
.
orgY
;
});
},
this
.
timeSpace
*
i
);
}
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
// this["container" + i].y = 0;//this.orgY;
setTimeout
(()
=>
{
this
[
"container"
+
i
].
y
=
this
.
orgY
;
engine
.
Tween
.
removeTweens
(
this
[
"container"
+
i
]);
engine
.
Tween
.
get
(
this
[
"container"
+
i
]).
to
({
y
:
-
(
props
.
boxImgSizeH
*
0.5
+
props
.
spaceSizeY
)},
1500
);
},
this
.
timeSpace
*
i
);
}
this
.
setPrizePos
();
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'rock-gameover'
);
},
this
.
timeSpace
*
2
+
2000
);
},
2500
);
}
private
setPrizePos
():
void
{
let
direct
=
Math
.
random
()
>
0.5
?
1
:
-
1
;
for
(
let
j
=
0
;
j
<
3
;
j
++
)
{
let
len
=
this
.
itemInfo
[
"items"
+
j
].
length
;
direct
*=
-
1
;
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
let
plen
=
this
.
prizes
.
length
;
if
(
direct
>
0
)
{
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
this
.
getTexture
(
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
);
// this.itemInfo["items" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;
}
else
{
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
this
.
getTexture
(
this
.
prizes
[(
i
%
plen
)].
icon
);
// this.itemInfo["items" + j][i].source = this.prizes[(i % plen)].icon;
}
}
}
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
// this.prizeId = "sss_3";
// this.itemInfo["items" + i][1].texture = this.getTexture(this.getPrizeUrl(this.prizeId));
let
p
=
this
.
itemInfo
[
"items"
+
i
][
1
].
parent
;
p
.
removeChild
(
this
.
itemInfo
[
"items"
+
i
][
1
]);
let
ix
=
this
.
itemInfo
[
"items"
+
i
][
1
].
x
;
let
iy
=
this
.
itemInfo
[
"items"
+
i
][
1
].
y
;
let
iw
=
this
.
itemInfo
[
"items"
+
i
][
1
].
width
;
let
ih
=
this
.
itemInfo
[
"items"
+
i
][
1
].
height
;
let
nItem
=
new
engine
.
Sprite
();
nItem
.
texture
=
this
.
getTexture
(
this
.
getPrizeUrl
(
this
.
prizeId
));
this
.
itemInfo
[
"items"
+
i
][
1
]
=
nItem
;
nItem
.
x
=
ix
;
nItem
.
y
=
iy
;
nItem
.
width
=
iw
;
nItem
.
height
=
ih
;
p
.
addChild
(
nItem
);
// this.itemInfo["items" + i][1].source = this.getPrizeUrl(this.prizeId);
}
}
private
getPrizeUrl
(
pid
:
string
):
string
{
let
purl
=
""
;
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
if
(
this
.
prizes
[
i
].
prizeId
==
pid
)
{
return
this
.
prizes
[
i
].
icon
;
}
}
return
purl
;
}
/**
* 暂停
*/
pause
()
{
}
/**
* 恢复
*/
revive
()
{
}
/**
* 重新开始
*/
resume
()
{
// this.reset()
// this.start()
}
/**
* 玩家死亡
*/
private
died
()
{
this
.
pause
()
}
/**
* 获取纹理(缓存)
* @param url
*/
getTexture
(
url
)
{
let
texture
=
this
.
textureCache
[
url
];
if
(
!
texture
)
{
texture
=
this
.
textureCache
[
url
]
=
engine
.
Texture
.
fromImage
(
url
);
}
return
texture
;
}
}
src/custom/rockji-new/src/game/GameWrapper.ts
0 → 100644
View file @
1b305156
/**
* 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
(
'rock-reset'
,
this
.
reset
,
this
);
engine
.
globalEvent
.
addEventListener
(
'rock-start'
,
this
.
start
,
this
);
engine
.
globalEvent
.
addEventListener
(
'rock-info'
,
this
.
rinfo
,
this
);
// this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);
// 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
();
}
private
rinfo
(
event
:
engine
.
Event
):
void
{
injectProps
(
event
.
data
);
console
.
log
(
"event="
,
event
)
console
.
log
(
"event.data = "
,
event
.
data
);
let
gameView
=
this
.
_gameView
=
new
GameView
();
this
.
addChild
(
gameView
);
}
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/rockji-new/src/game/Goods.ts
0 → 100644
View file @
1b305156
/**
* 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 randomNum = Math.floor(Math.random() * 3)
// console.log('雨滴' + randomNum);
let
rain
=
new
engine
.
Sprite
(
getTextureByName
(
'雨滴0'
));
let
rain1
=
new
engine
.
Sprite
(
getTextureByName
(
'雨滴1'
));
let
rain2
=
new
engine
.
Sprite
(
getTextureByName
(
'雨滴2'
));
rain
[
"npcType"
]
=
"rain0"
rain1
[
"npcType"
]
=
"rain1"
rain2
[
"npcType"
]
=
"rain2"
let
stone
=
new
engine
.
Sprite
(
getTextureByName
(
'石块'
));
stone
[
"npcType"
]
=
"stone"
let
boom
=
new
engine
.
Sprite
(
getTextureByName
(
'炸弹'
));
boom
[
"npcType"
]
=
"boom"
rain
.
visible
=
false
;
rain1
.
visible
=
false
;
rain2
.
visible
=
false
;
stone
.
visible
=
false
;
boom
.
visible
=
false
;
body
.
addChild
(
rain
)
body
.
addChild
(
rain1
)
body
.
addChild
(
rain2
)
body
.
addChild
(
stone
)
body
.
addChild
(
boom
)
this
.
addChild
(
body
);
body
.
width
=
.
0001
;
body
.
height
=
.
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
(
typeof
(
props
.
goodsProbability
)
==
'string'
){
props
.
goodsProbability
=
props
.
goodsProbability
.
split
(
','
).
map
((
i
:
string
)
=>
+
i
)
console
.
log
(
props
.
goodsProbability
);
}
if
(
random
<
props
.
goodsProbability
[
0
]){
let
randomNum
=
Math
.
floor
(
Math
.
random
()
*
3
)
this
.
showNpc
(
"rain"
+
randomNum
)
}
else
if
(
random
>=
props
.
goodsProbability
[
0
]
&&
random
<=
(
props
.
goodsProbability
[
0
]
+
props
.
goodsProbability
[
1
])){
this
.
showNpc
(
"stone"
)
}
else
if
(
random
>
(
props
.
goodsProbability
[
0
]
+
props
.
goodsProbability
[
1
])){
this
.
showNpc
(
"boom"
)
}
}
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
this
.
_body
.
children
[
i
].
visible
=
true
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
}
}
set
anchorOffsetY
(
v
)
{
this
.
_body
.
y
=
v
;
}
}
src/custom/rockji-new/src/game/object-pool-init.ts
0 → 100644
View file @
1b305156
/**
* 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/rockji-new/src/game/utils.ts
0 → 100644
View file @
1b305156
/**
* Created by rockyl on 2020-01-21.
*/
export
function
getTexture
(
uuid
)
{
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
}
export
function
getTextureByName
(
name
)
{
return
engine
.
Texture
.
from
(
getAssetByName
(
name
).
uuid
);
}
export
function
playSound
(
name
)
{
engine
.
playSound
(
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
}
export
function
createSvga
(
name
,
anchorName
?)
{
let
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
getAssetByName
(
name
).
uuid
;
return
inst
;
}
\ No newline at end of file
src/custom/rockji-new/src/index.ts
0 → 100644
View file @
1b305156
/**
* 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/rockji-new/src/props.ts
0 → 100644
View file @
1b305156
/**
* 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/rockji/debug/main.js
View file @
1b305156
...
...
@@ -18,6 +18,7 @@
tslib
.
__extends
(
GameView
,
_super
);
function
GameView
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
textureCache
=
{};
_this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
_this
.
setup
,
_this
);
_this
.
prizeId
=
props
.
prizeId
;
_this
.
prizes
=
props
.
prizes
;
...
...
@@ -65,7 +66,7 @@
this
.
createItem
(
1
);
this
.
prizeMaxH
=
4
*
(
props
.
imgSizeW
+
props
.
spaceSizeY
)
+
props
.
spaceSizeY
;
}
this
.
orgY
=
-
(
this
.
prizeMaxH
-
props
.
maskSizeH
)
+
props
.
i
mgSizeH
*
0.5
;
this
.
orgY
=
-
(
this
.
prizeMaxH
-
props
.
maskSizeH
)
+
props
.
boxI
mgSizeH
*
0.5
;
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
this
[
'container'
+
i
].
x
=
i
*
(
props
.
cSpaceSizeX
*
2
+
props
.
imgSizeW
);
this
[
'container'
+
i
].
y
=
this
.
orgY
;
...
...
@@ -83,14 +84,21 @@
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
var
itemBox
=
new
engine
.
Image
();
itemBox
.
source
=
getAssetByName
(
"奖品外框图"
).
url
;
itemBox
.
width
=
props
.
boxImgSizeW
;
itemBox
.
height
=
props
.
boxImgSizeH
;
itemBox
.
x
=
props
.
spaceSizeX
;
itemBox
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
boxImgSizeH
+
props
.
spaceSizeY
);
this
[
"container"
+
j
].
addChild
(
itemBox
);
var
item
=
new
engine
.
Sprite
();
item
.
texture
=
engine
.
Texture
.
fromImag
e
(
url
);
item
.
texture
=
this
.
getTextur
e
(
url
);
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
[
"container"
+
j
].
addChild
(
item
);
item
.
width
=
props
.
imgSizeW
;
item
.
height
=
props
.
imgSizeH
;
item
.
x
=
props
.
spaceSizeX
;
item
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
imgSizeH
+
props
.
spaceSizeY
);
item
.
x
=
(
itemBox
.
width
-
item
.
width
)
/
2
;
item
.
y
=
(
itemBox
.
height
-
item
.
height
)
/
2
;
itemBox
.
addChild
(
item
);
}
}
};
...
...
@@ -120,7 +128,7 @@
setTimeout
(
function
()
{
_this
[
"container"
+
i
].
y
=
_this
.
orgY
;
engine
.
Tween
.
removeTweens
(
_this
[
"container"
+
i
]);
engine
.
Tween
.
get
(
_this
[
"container"
+
i
]).
to
({
y
:
-
(
props
.
i
mgSizeH
*
0.5
+
props
.
spaceSizeY
)
},
1500
);
engine
.
Tween
.
get
(
_this
[
"container"
+
i
]).
to
({
y
:
-
(
props
.
boxI
mgSizeH
*
0.5
+
props
.
spaceSizeY
)
},
1500
);
},
_this
.
timeSpace
*
i
);
};
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -140,10 +148,10 @@
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
plen
=
this
.
prizes
.
length
;
if
(
direct
>
0
)
{
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
engine
.
Texture
.
fromImag
e
(
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
);
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
this
.
getTextur
e
(
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
);
}
else
{
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
engine
.
Texture
.
fromImag
e
(
this
.
prizes
[(
i
%
plen
)].
icon
);
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
this
.
getTextur
e
(
this
.
prizes
[(
i
%
plen
)].
icon
);
}
}
}
...
...
@@ -155,7 +163,7 @@
var
iw
=
this
.
itemInfo
[
"items"
+
i
][
1
].
width
;
var
ih
=
this
.
itemInfo
[
"items"
+
i
][
1
].
height
;
var
nItem
=
new
engine
.
Sprite
();
nItem
.
texture
=
engine
.
Texture
.
fromImag
e
(
this
.
getPrizeUrl
(
this
.
prizeId
));
nItem
.
texture
=
this
.
getTextur
e
(
this
.
getPrizeUrl
(
this
.
prizeId
));
this
.
itemInfo
[
"items"
+
i
][
1
]
=
nItem
;
nItem
.
x
=
ix
;
nItem
.
y
=
iy
;
...
...
@@ -182,8 +190,16 @@
GameView
.
prototype
.
died
=
function
()
{
this
.
pause
();
};
GameView
.
prototype
.
getTexture
=
function
(
url
)
{
var
texture
=
this
.
textureCache
[
url
];
if
(
!
texture
)
{
texture
=
this
.
textureCache
[
url
]
=
engine
.
Texture
.
fromImage
(
url
);
}
return
texture
;
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/rockji/debug/main.js.map
View file @
1b305156
{"version":3,"file":"index.js","sources":["src/custom/rockji/src/props.ts","src/custom/rockji/src/game/GameView.ts","src/custom/rockji/src/game/GameWrapper.ts","src/custom/rockji/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 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\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\t//倒计时\n\tprivate countdown: number;\n\t//每列滚动时间间隔\n\tprivate timeSpace: number;\n\n\tprivate prizes;\n\tprivate bgImg:engine.Image;\n\tprivate bgImgUrl:string;\n\tprivate itemInfo:any;\n\tprivate prizeMaxH:number;\n\tprivate orgY:number;\n\n\tprivate prizeId:string;\n\n\tprivate container0:engine.Container;\n\tprivate container1:engine.Container;\n\tprivate container2:engine.Container;\n\n\tprivate mainContainer:engine.Container;\n\tprivate viewContainer:engine.Container;\n\n\tprivate configInfo:any;\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t\t// this.configInfo = {\n\t\t// \tprizes:[\n\t\t// \t\t{type:0, url:'//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png'},\n\t\t// \t\t{type:1, url:'//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png'},\n\t\t// \t\t{type:2, url:'//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png'}\n\t\t// \t],//奖品链接列表\n\t\t// \tbgImgUrl:'//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png',\n\t\t// \timgSize:{w:99,h:103},//奖品尺寸\n\t\t// \tspaceSize:{x:20, y:20},//奖品横向和纵向间隙\n\t\t// \tcOriginSize:{x:22, y:19},//遮罩左边定点位置\n\t\t// \tcSpaceSize:{x:23, y:0},//每列奖品的间隙\n\t\t// }\n\t\t\n\n\t\t// this.bgImgUrl = '//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png';\n\n\t\t// this.maskSize = {w:428, h:221};\n\t\t// this.imgSize = {w:99,h:103};\n\t\t// this.spaceSize = {x:20, y:20};\n\t\t// // this.originSize = {x:0, y:0}\n\t\t// this.cOriginSize = {x:22, y:19};//遮罩的初始坐标\n\t\t// this.cSpaceSize = {x:23, y:0};//奖品容器横向纵向的边距\n\n\t\t// this.prizes = [\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png\",\n\t\t// \t\t\"id\":\"o58df634f\",\n\t\t// \t\t\"index\":1,\n\t\t// \t\t\"name\":\"一等奖\",\n\t\t// \t\t\"prizeId\":\"sss_3\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49781\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png\",\n\t\t// \t\t\"id\":\"o4a578392\",\n\t\t// \t\t\"index\":2,\n\t\t// \t\t\"name\":\"二等奖\",\n\t\t// \t\t\"prizeId\":\"sss_2\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49780\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png\",\n\t\t// \t\t\"id\":\"o26efbbeb\",\n\t\t// \t\t\"index\":3,\n\t\t// \t\t\"name\":\"三等奖\",\n\t\t// \t\t\"prizeId\":\"sss_1\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49779\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// }];\n\t\tthis.prizeId = props.prizeId;\n\t\tthis.prizes = props.prizes;\n\t\tthis.countdown = 150;\n\t\tthis.timeSpace = 500;\n\n\t\tconsole.log(\"props.prizes=\",props.prizes);\n\t}\n\n\tprivate waterSvga\n\tprivate stoneSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis._hasSetup = true;\n\n\t\tthis.itemInfo = {};\n\n\t\t// this.bgImg = new engine.Image();\n\t\t// this.bgImg.source = this.bgImgUrl;\n\n\t\tthis.mainContainer = new engine.Container();\n\t\tthis.viewContainer = new engine.Container();\n\t\tthis.addChild(this.viewContainer);\n\n\t\tthis.viewContainer.width = props.viewWidth;\n\t\tthis.viewContainer.height = props.viewHeight;\n\n\t\t// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));\n\t\tthis.bgImg = new engine.Image();\n\t\tthis.bgImg.source = getAssetByName(\"rock-背景\").url;\n\t\tthis.viewContainer.addChild(this.bgImg);\n\n\t\tthis.container0 = new engine.Container();\n\t\tthis.container1 = new engine.Container();\n\t\tthis.container2 = new engine.Container();\n\n\t\tthis.mainContainer.addChild(this.container0);\n\t\tthis.mainContainer.addChild(this.container1);\n\t\tthis.mainContainer.addChild(this.container2);\n\n\t\tthis.viewContainer.addChild(this.mainContainer);\n\t\tthis.mainContainer.x = props.cOriginSizeX;\n\t\tthis.mainContainer.y = props.cOriginSizeY;\n\n\t\tlet mask = new engine.Rect();\n\t\tmask.x = props.cOriginSizeX;\n\t\tmask.y = props.cOriginSizeY;\n\t\tmask.fillColor = 0xffff00;\n\t\tmask.width = props.maskSizeW;\n\t\tmask.height = props.maskSizeH;\n\t\tthis.addChild(mask);\n\n\t\tthis.mainContainer.mask = mask;\n\n\t\t// this.container0.width = 140;\n\t\t// this.container0.height = 221;\n\n\t\t// this.container1.width = 140()\n\t\t// this.container1.height = 221;\n\n\t\t// this.container2.width = 140;\n\t\t// this.container2.height = 221;\n\n\t\tif(this.prizes.length > 3){\n\t\t\tthis.createItem(2);\n\t\t\tthis.prizeMaxH = this.prizes.length * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\n\t\t}else{\n\t\t\tthis.createItem(1);\n\t\t\tthis.prizeMaxH = 4 * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\n\t\t}\n\n\t\tthis.orgY = -(this.prizeMaxH - props.maskSizeH) + props.imgSizeH * 0.5;\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tthis['container' + i].x = i * (props.cSpaceSizeX * 2 + props.imgSizeW);\n\t\t\t// this['container' + i].y = this.orgY;\n\t\t\tthis['container' + i].y = this.orgY;\n\n\t\t}\n\n\t\t//mask 438 221\n\n\t}\n\n\t/**\n\t * type 1.小于4个奖品 2.4个及以上奖品\n\t */\n\tprivate createItem(type:number):void{\n\t\tlet len = 4;\n\t\tif(type == 1){\n\t\t\tlen = 4;\n\t\t}else if(type == 2){\n\t\t\tlen = this.prizes.length;\n\t\t}\n\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tthis.itemInfo[\"items\" + j] = [];\n\t\t\tfor(let i = 0; i < len; i++){\n\t\t\t\tlet url = this.prizes[i % this.prizes.length].icon;\n\t\t\t\tlet item = new engine.Sprite();\n\t\t\t\titem.texture = engine.Texture.fromImage(url);\n\t\t\t\tthis.itemInfo[\"items\" + j][i] = item;\n\t\t\t\tthis[\"container\" + j].addChild(item);\n\n\t\t\t\titem.width = props.imgSizeW;\n\t\t\t\titem.height = props.imgSizeH;\n\t\t\t\titem.x = props.spaceSizeX;\n\t\t\t\titem.y = props.spaceSizeY + i * (props.imgSizeH + props.spaceSizeY);\n\n\t\t\t\t// console.log('i=', i)\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t}\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.prizeId = props.prizeId;\n\t\tconsole.log(\"this.prizeId=\",this.prizeId);\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\n\t\t\tsetTimeout(() => {\n\t\t\t\tengine.Tween.get(this[\"container\" + i],{loop:true}).to({y:0}, this.countdown).call(()=>{\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t\t\t});\n\t\t\t}, this.timeSpace * i);\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tfor(let i = 0; i < 3; i++){\n\t\t\t\t// this[\"container\" + i].y = 0;//this.orgY;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\n\t\t\t\t\tengine.Tween.get(this[\"container\" + i]).to({y:-(props.imgSizeH * 0.5 + props.spaceSizeY)}, 1500);\n\t\t\t\t}, this.timeSpace * i);\n\t\t\t}\n\t\t\tthis.setPrizePos();\n\n\t\t\tsetTimeout(() => {\t\n\t\t\t\tengine.globalEvent.dispatchEvent('rock-gameover');\n\t\t\t}, this.timeSpace * 2 + 2000);\n\t\t}, 2500);\n\t\t\n\t}\n\n\tprivate setPrizePos():void{\n\t\tlet direct = Math.random() > 0.5 ? 1 : -1;\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tlet len = this.itemInfo[\"items\" + j].length;\n\t\t\tdirect *= -1;\n\t\t\tfor(let i = 0; i < len; i++){\n\t\t\t\tlet plen = this.prizes.length;\n\t\t\t\tif(direct > 0){\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = engine.Texture.fromImage(this.prizes[(plen - 1) - (i % plen)].icon);\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;\n\t\t\t\t}else{\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = engine.Texture.fromImage(this.prizes[(i % plen)].icon);\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(i % plen)].icon;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\t// this.prizeId = \"sss_3\";\n\n\t\t\t// this.itemInfo[\"items\" + i][1].texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));\n\t\t\tlet p = this.itemInfo[\"items\" + i][1].parent;\n\t\t\tp.removeChild(this.itemInfo[\"items\" + i][1]);\n\n\t\t\tlet ix = this.itemInfo[\"items\" + i][1].x;\n\t\t\tlet iy = this.itemInfo[\"items\" + i][1].y;\n\t\t\tlet iw = this.itemInfo[\"items\" + i][1].width;\n\t\t\tlet ih = this.itemInfo[\"items\" + i][1].height;\n\n\t\t\tlet nItem = new engine.Sprite();\n\t\t\tnItem.texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));\n\t\t\tthis.itemInfo[\"items\" + i][1] = nItem;\n\t\t\tnItem.x = ix;\n\t\t\tnItem.y = iy;\n\t\t\tnItem.width = iw;\n\t\t\tnItem.height = ih;\n\t\t\tp.addChild(nItem);\n\n\n\t\t\t\n\t\t\t// this.itemInfo[\"items\" + i][1].source = this.getPrizeUrl(this.prizeId);\n\t\t}\n\n\t}\n\n\tprivate getPrizeUrl(pid:string):string{\n\t\tlet purl = \"\";\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tif(this.prizes[i].prizeId == pid){\n\t\t\t\treturn this.prizes[i].icon;\n\t\t\t}\n\t\t}\n\t\treturn purl;\n\t}\n\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\t\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\t// this.reset()\n\t\t// this.start()\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.pause()\n\t}\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\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('rock-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('rock-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('rock-info', this.rinfo, this);\n\n\t\t// this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\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\tprivate rinfo(event: engine.Event):void{\n\t\tinjectProps(event.data);\n\t\tconsole.log(\"event=\",event)\n\t\tconsole.log(\"event.data = \",event.data);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\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"],"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;;;CCDD;KAAsCA,kCAAgB;KAoCrD;SAAA,YACC,iBAAO,SA8DP;SA7DA,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,CAAC;SAuDzD,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAA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,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
{"version":3,"file":"index.js","sources":["src/custom/rockji/src/props.ts","src/custom/rockji/src/game/GameView.ts","src/custom/rockji/src/game/GameWrapper.ts","src/custom/rockji/src/index.ts"],"sourcesContent":["/**\r\n * Created by rockyl on 2020-01-21.\r\n */\r\n\r\nexport let props: any = {};\r\n\r\nexport function prepareProps() {\r\n\tlet metaProps = getProps();\r\n\r\n\tengine.injectProp(props, metaProps);\r\n}\r\n\r\nexport function injectProps(p) {\r\n\tengine.injectProp(props, p);\r\n}\r\n","/**\r\n * Created by rockyl on 2018/8/16.\r\n */\r\n\r\nimport {props} from \"../props\";\r\nimport {playSound, createSvga} from \"./utils\";\r\nimport ObjectPool = engine.ObjectPool;\r\nimport {getTextureByName} from \"./utils\";\r\nimport {Goods} from \"./Goods\";\r\nimport {PoolName} from \"./object-pool-init\";\r\n\r\n\r\nexport default class GameView extends engine.Container {\r\n\r\n\tprivate _hasSetup;\r\n\r\n\t//玩家\r\n\tprivate player: engine.Container;\r\n\t//触摸层\r\n\t// private rectBg: engine.Rect;\r\n\tprivate rectBg: engine.Container;\r\n\t//npc层\r\n\tprivate NpcBg: engine.Container;\r\n\t//倒计时\r\n\tprivate countdown: number;\r\n\t//每列滚动时间间隔\r\n\tprivate timeSpace: number;\r\n\r\n\tprivate prizes;\r\n\tprivate bgImg: engine.Image;\r\n\tprivate bgImgUrl: string;\r\n\tprivate itemInfo: any;\r\n\tprivate prizeMaxH: number;\r\n\tprivate orgY: number;\r\n\r\n\tprivate prizeId: string;\r\n\r\n\tprivate container0: engine.Container;\r\n\tprivate container1: engine.Container;\r\n\tprivate container2: engine.Container;\r\n\r\n\tprivate mainContainer: engine.Container;\r\n\tprivate viewContainer: engine.Container;\r\n\r\n\tprivate configInfo: any;\r\n\r\n\tprivate textureCache = {};\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\r\n\t\t// this.configInfo = {\r\n\t\t// \tprizes:[\r\n\t\t// \t\t{type:0, url:'//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png'},\r\n\t\t// \t\t{type:1, url:'//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png'},\r\n\t\t// \t\t{type:2, url:'//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png'}\r\n\t\t// \t],//奖品链接列表\r\n\t\t// \tbgImgUrl:'//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png',\r\n\t\t// \timgSize:{w:99,h:103},//奖品尺寸\r\n\t\t// \tspaceSize:{x:20, y:20},//奖品横向和纵向间隙\r\n\t\t// \tcOriginSize:{x:22, y:19},//遮罩左边定点位置\r\n\t\t// \tcSpaceSize:{x:23, y:0},//每列奖品的间隙\r\n\t\t// }\r\n\r\n\r\n\t\t// this.bgImgUrl = '//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png';\r\n\r\n\t\t// this.maskSize = {w:428, h:221};\r\n\t\t// this.imgSize = {w:99,h:103};\r\n\t\t// this.spaceSize = {x:20, y:20};\r\n\t\t// // this.originSize = {x:0, y:0}\r\n\t\t// this.cOriginSize = {x:22, y:19};//遮罩的初始坐标\r\n\t\t// this.cSpaceSize = {x:23, y:0};//奖品容器横向纵向的边距\r\n\r\n\t\t// this.prizes = [\r\n\t\t// \t{\r\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png\",\r\n\t\t// \t\t\"id\":\"o58df634f\",\r\n\t\t// \t\t\"index\":1,\r\n\t\t// \t\t\"name\":\"一等奖\",\r\n\t\t// \t\t\"prizeId\":\"sss_3\",\r\n\t\t// \t\t\"prizeType\":2,\r\n\t\t// \t\t\"refId\":\"49781\",\r\n\t\t// \t\t\"refType\":\"virtual\"\r\n\t\t// \t},\r\n\t\t// \t{\r\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png\",\r\n\t\t// \t\t\"id\":\"o4a578392\",\r\n\t\t// \t\t\"index\":2,\r\n\t\t// \t\t\"name\":\"二等奖\",\r\n\t\t// \t\t\"prizeId\":\"sss_2\",\r\n\t\t// \t\t\"prizeType\":2,\r\n\t\t// \t\t\"refId\":\"49780\",\r\n\t\t// \t\t\"refType\":\"virtual\"\r\n\t\t// \t},\r\n\t\t// \t{\r\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png\",\r\n\t\t// \t\t\"id\":\"o26efbbeb\",\r\n\t\t// \t\t\"index\":3,\r\n\t\t// \t\t\"name\":\"三等奖\",\r\n\t\t// \t\t\"prizeId\":\"sss_1\",\r\n\t\t// \t\t\"prizeType\":2,\r\n\t\t// \t\t\"refId\":\"49779\",\r\n\t\t// \t\t\"refType\":\"virtual\"\r\n\t\t// }];\r\n\t\tthis.prizeId = props.prizeId;\r\n\t\tthis.prizes = props.prizes;\r\n\t\tthis.countdown = 150;\r\n\t\tthis.timeSpace = 500;\r\n\r\n\t\tconsole.log(\"props.prizes=\", props.prizes);\r\n\t}\r\n\r\n\tprivate waterSvga\r\n\tprivate stoneSvga\r\n\tprivate boomSvga\r\n\tprivate playerSvga\r\n\r\n\tsetup() {\r\n\t\tif (this._hasSetup) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._hasSetup = true;\r\n\r\n\t\tthis.itemInfo = {};\r\n\r\n\t\t// this.bgImg = new engine.Image();\r\n\t\t// this.bgImg.source = this.bgImgUrl;\r\n\r\n\t\tthis.mainContainer = new engine.Container();\r\n\t\tthis.viewContainer = new engine.Container();\r\n\t\tthis.addChild(this.viewContainer);\r\n\r\n\t\tthis.viewContainer.width = props.viewWidth;\r\n\t\tthis.viewContainer.height = props.viewHeight;\r\n\r\n\t\t//this.bgImg = new engine.Image(getTextureByName('rock-背景'));\r\n\t\tthis.bgImg = new engine.Image();\r\n\t\tthis.bgImg.source = getAssetByName(\"rock-背景\").url;\r\n\t\tthis.viewContainer.addChild(this.bgImg);\r\n\r\n\t\tthis.container0 = new engine.Container();\r\n\t\tthis.container1 = new engine.Container();\r\n\t\tthis.container2 = new engine.Container();\r\n\r\n\t\tthis.mainContainer.addChild(this.container0);\r\n\t\tthis.mainContainer.addChild(this.container1);\r\n\t\tthis.mainContainer.addChild(this.container2);\r\n\r\n\t\tthis.viewContainer.addChild(this.mainContainer);\r\n\t\tthis.mainContainer.x = props.cOriginSizeX;\r\n\t\tthis.mainContainer.y = props.cOriginSizeY;\r\n\r\n\t\tlet mask = new engine.Rect();\r\n\t\tmask.x = props.cOriginSizeX;\r\n\t\tmask.y = props.cOriginSizeY;\r\n\t\tmask.fillColor = 0xffff00;\r\n\t\tmask.width = props.maskSizeW;\r\n\t\tmask.height = props.maskSizeH;\r\n\t\tthis.addChild(mask);\r\n\r\n\t\tthis.mainContainer.mask = mask;\r\n\r\n\t\t// this.container0.width = 140;\r\n\t\t// this.container0.height = 221;\r\n\r\n\t\t// this.container1.width = 140()\r\n\t\t// this.container1.height = 221;\r\n\r\n\t\t// this.container2.width = 140;\r\n\t\t// this.container2.height = 221;\r\n\r\n\t\tif (this.prizes.length > 3) {\r\n\t\t\tthis.createItem(2);\r\n\t\t\tthis.prizeMaxH = this.prizes.length * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\r\n\t\t} else {\r\n\t\t\tthis.createItem(1);\r\n\t\t\tthis.prizeMaxH = 4 * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\r\n\t\t}\r\n\r\n\t\tthis.orgY = -(this.prizeMaxH - props.maskSizeH) + props.boxImgSizeH * 0.5;\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tthis['container' + i].x = i * (props.cSpaceSizeX * 2 + props.imgSizeW);\r\n\t\t\t// this['container' + i].y = this.orgY;\r\n\t\t\tthis['container' + i].y = this.orgY;\r\n\r\n\t\t}\r\n\r\n\t\t//mask 438 221\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * type 1.小于4个奖品 2.4个及以上奖品\r\n\t */\r\n\tprivate createItem(type: number): void {\r\n\t\tlet len = 4;\r\n\t\tif (type == 1) {\r\n\t\t\tlen = 4;\r\n\t\t} else if (type == 2) {\r\n\t\t\tlen = this.prizes.length;\r\n\t\t}\r\n\r\n\t\tfor (let j = 0; j < 3; j++) {\r\n\t\t\tthis.itemInfo[\"items\" + j] = [];\r\n\t\t\tfor (let i = 0; i < len; i++) {\r\n\t\t\t\tlet url = this.prizes[i % this.prizes.length].icon;\r\n\t\t\t\r\n\t\t\t\tlet itemBox = new engine.Image();\r\n\t\t\t\titemBox.source = getAssetByName(\"奖品外框图\").url;\r\n\t\t\t\titemBox.width = props.boxImgSizeW;\r\n\t\t\t\titemBox.height = props.boxImgSizeH;\r\n\t\t\t\titemBox.x = props.spaceSizeX;\r\n\t\t\t\titemBox.y = props.spaceSizeY + i * (props.boxImgSizeH + props.spaceSizeY);\r\n\t\t\t\tthis[\"container\" + j].addChild(itemBox);\r\n\r\n\t\t\t\tlet item = new engine.Sprite();\r\n\t\t\t\titem.texture = this.getTexture(url);\r\n\t\t\t\tthis.itemInfo[\"items\" + j][i] = item;\r\n\t\t\t\titem.width = props.imgSizeW;\r\n\t\t\t\titem.height = props.imgSizeH;\r\n\t\t\t\titem.x = (itemBox.width - item.width) / 2;\r\n\t\t\t\titem.y = (itemBox.height - item.height) / 2;\r\n\t\t\t\titemBox.addChild(item);\r\n\r\n\t\t\t\t// console.log('i=', i)\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * 重置场景\r\n\t */\r\n\treset() {\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tthis[\"container\" + i].y = this.orgY;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * 开始\r\n\t */\r\n\tstart() {\r\n\t\tthis.prizeId = props.prizeId;\r\n\t\tconsole.log(\"this.prizeId=\", this.prizeId);\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tengine.Tween.get(this[\"container\" + i], {loop: true}).to({y: 0}, this.countdown).call(() => {\r\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\r\n\t\t\t\t});\r\n\t\t\t}, this.timeSpace * i);\r\n\t\t}\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\t\t// this[\"container\" + i].y = 0;//this.orgY;\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\r\n\t\t\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\r\n\t\t\t\t\tengine.Tween.get(this[\"container\" + i]).to({y: -(props.boxImgSizeH * 0.5 + props.spaceSizeY)}, 1500);\r\n\t\t\t\t}, this.timeSpace * i);\r\n\t\t\t}\r\n\t\t\tthis.setPrizePos();\r\n\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tengine.globalEvent.dispatchEvent('rock-gameover');\r\n\t\t\t}, this.timeSpace * 2 + 2000);\r\n\t\t}, 2500);\r\n\r\n\t}\r\n\r\n\tprivate setPrizePos(): void {\r\n\t\tlet direct = Math.random() > 0.5 ? 1 : -1;\r\n\t\tfor (let j = 0; j < 3; j++) {\r\n\t\t\tlet len = this.itemInfo[\"items\" + j].length;\r\n\t\t\tdirect *= -1;\r\n\t\t\tfor (let i = 0; i < len; i++) {\r\n\t\t\t\tlet plen = this.prizes.length;\r\n\t\t\t\tif (direct > 0) {\r\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = this.getTexture(this.prizes[(plen - 1) - (i % plen)].icon);\r\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = this.getTexture(this.prizes[(i % plen)].icon);\r\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(i % plen)].icon;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\t// this.prizeId = \"sss_3\";\r\n\r\n\t\t\t// this.itemInfo[\"items\" + i][1].texture = this.getTexture(this.getPrizeUrl(this.prizeId));\r\n\t\t\tlet p = this.itemInfo[\"items\" + i][1].parent;\r\n\t\t\tp.removeChild(this.itemInfo[\"items\" + i][1]);\r\n\r\n\t\t\tlet ix = this.itemInfo[\"items\" + i][1].x;\r\n\t\t\tlet iy = this.itemInfo[\"items\" + i][1].y;\r\n\t\t\tlet iw = this.itemInfo[\"items\" + i][1].width;\r\n\t\t\tlet ih = this.itemInfo[\"items\" + i][1].height;\r\n\r\n\t\t\tlet nItem = new engine.Sprite();\r\n\t\t\tnItem.texture = this.getTexture(this.getPrizeUrl(this.prizeId));\r\n\t\t\tthis.itemInfo[\"items\" + i][1] = nItem;\r\n\t\t\tnItem.x = ix;\r\n\t\t\tnItem.y = iy;\r\n\t\t\tnItem.width = iw;\r\n\t\t\tnItem.height = ih;\r\n\t\t\tp.addChild(nItem);\r\n\r\n\r\n\t\t\t// this.itemInfo[\"items\" + i][1].source = this.getPrizeUrl(this.prizeId);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tprivate getPrizeUrl(pid: string): string {\r\n\t\tlet purl = \"\";\r\n\t\tfor (let i = 0; i < 3; i++) {\r\n\t\t\tif (this.prizes[i].prizeId == pid) {\r\n\t\t\t\treturn this.prizes[i].icon;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn purl;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * 暂停\r\n\t */\r\n\tpause() {\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * 恢复\r\n\t */\r\n\trevive() {\r\n\t}\r\n\r\n\t/**\r\n\t * 重新开始\r\n\t */\r\n\tresume() {\r\n\t\t// this.reset()\r\n\t\t// this.start()\r\n\t}\r\n\r\n\t/**\r\n\t * 玩家死亡\r\n\t */\r\n\tprivate died() {\r\n\t\tthis.pause()\r\n\t}\r\n\r\n\t/**\r\n\t * 获取纹理(缓存)\r\n\t * @param url\r\n\t */\r\n\tgetTexture(url) {\r\n\t\tlet texture = this.textureCache[url];\r\n\t\tif (!texture) {\r\n\t\t\ttexture = this.textureCache[url] = engine.Texture.fromImage(url);\r\n\t\t}\r\n\t\treturn texture;\r\n\t}\r\n}\r\n","/**\r\n * Created by rockyl on 2020-01-09.\r\n */\r\n\r\nimport GameView from \"./GameView\";\r\nimport {injectProps} from \"../props\";\r\n\r\n\r\nexport class GameWrapper extends engine.Container {\r\n\tprivate _status;\r\n\tprivate _gameView: GameView;\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tengine.globalEvent.addEventListener('rock-reset', this.reset, this);\r\n\t\tengine.globalEvent.addEventListener('rock-start', this.start, this);\r\n\t\tengine.globalEvent.addEventListener('rock-info', this.rinfo, this);\r\n\r\n\t\t// this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\r\n\t\t// gameView.reset()\r\n\t\t// gameView.start()\r\n\t}\r\n\r\n\treset(event: engine.Event) {\t\t\r\n\t\tinjectProps(event.data);\r\n\t\tthis._gameView.visible = true;\r\n\t\tthis._gameView.reset();\r\n\t}\r\n\r\n\tstart(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\t\tthis._status = 1;\r\n\t\tthis._gameView.start();\r\n\t}\r\n\r\n\tprivate rinfo(event: engine.Event):void{\r\n\t\tinjectProps(event.data);\r\n\t\tconsole.log(\"event=\",event)\r\n\t\tconsole.log(\"event.data = \",event.data);\r\n\r\n\t\tlet gameView = this._gameView = new GameView();\r\n\t\tthis.addChild(gameView);\r\n\r\n\t}\r\n\r\n\tpause() {\r\n\t\tthis._gameView.pause();\r\n\t}\r\n\r\n\tresume() {\r\n\t\tthis._gameView.resume();\r\n\t}\r\n\r\n\trevive() {\r\n\t\tthis._gameView.revive();\r\n\t}\r\n\r\n\tclear() {\r\n\t\tthis._gameView.visible = false;\r\n\t}\r\n\r\n\tprivate onTap(event) {\r\n\t//\tthis._gameView.tap(event);\r\n\t}\r\n}\r\n","/**\r\n * Created by rockyl on 2019-11-20.\r\n */\r\n\r\nimport {GameWrapper} from \"./game/GameWrapper\";\r\nimport {injectProps, prepareProps} from \"./props\";\r\n\r\nexport default function (props) {\r\n\tprepareProps();\r\n\tinjectProps(props);\r\n\r\n\tlet instance = new GameWrapper();\r\n\treturn instance;\r\n}\r\n"],"names":["__extends"],"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;;;CCFD;KAAsCA,kCAAgB;KAoCrD;SAAA,YACC,iB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AAW,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/rockji/meta.json
View file @
1b305156
...
...
@@ -2,6 +2,16 @@
"name"
:
"摇奖机"
,
"desc"
:
"摇奖机"
,
"props"
:
{
"boxImgSizeW"
:{
"alias"
:
"奖品图片外框宽"
,
"type"
:
"number"
,
"default"
:
110
},
"boxImgSizeH"
:{
"alias"
:
"奖品图片外框高"
,
"type"
:
"number"
,
"default"
:
111
},
"imgSizeW"
:
{
"alias"
:
"奖品图片宽"
,
"type"
:
"number"
,
...
...
@@ -15,7 +25,7 @@
"spaceSizeX"
:
{
"alias"
:
"奖品横向间隙"
,
"type"
:
"number"
,
"default"
:
20
"default"
:
15
},
"spaceSizeY"
:
{
"alias"
:
"奖品纵向间隙"
,
...
...
@@ -65,6 +75,12 @@
"url"
:
"//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png"
,
"uuid"
:
"7baa74f5-e057-4fd3-846f-f58ff7a92c3d"
,
"ext"
:
".png"
},
{
"name"
:
"奖品外框图"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/bee4c8c7fba8a83b18d3e43921118421f73f389d.png"
,
"uuid"
:
"80036ef2-d070-469b-afd0-54d8296cfbe9"
,
"ext"
:
".png"
}
],
"events"
:
{
...
...
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