Commit 7e45c4dd authored by lujinlei's avatar lujinlei

-a

parent 1b305156
......@@ -136,5 +136,5 @@
}
},
"id": "rockji-new",
"code": "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :\n\ttypeof 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\tvar props = {};\r\n\tfunction prepareProps() {\r\n\t var metaProps = getProps();\r\n\t engine.injectProp(props, metaProps);\r\n\t}\r\n\tfunction injectProps(p) {\r\n\t engine.injectProp(props, p);\r\n\t}\r\n\t//# sourceMappingURL=props.js.map\n\n\tvar 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\tvar 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\tfunction 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\treturn index;\n\n})));\n"
"code": "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :\n\ttypeof 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\tvar props = {};\r\n\tfunction prepareProps() {\r\n\t var metaProps = getProps();\r\n\t engine.injectProp(props, metaProps);\r\n\t}\r\n\tfunction injectProps(p) {\r\n\t engine.injectProp(props, p);\r\n\t}\n\n\tvar 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 < this.prizes.length; 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));\n\n\tvar 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));\n\n\tfunction 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}\n\n\treturn index;\n\n})));\n"
}
......@@ -12,7 +12,6 @@
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
......@@ -174,7 +173,7 @@
};
GameView.prototype.getPrizeUrl = function (pid) {
var purl = "";
for (var i = 0; i < 3; i++) {
for (var i = 0; i < this.prizes.length; i++) {
if (this.prizes[i].prizeId == pid) {
return this.prizes[i].icon;
}
......@@ -199,7 +198,6 @@
};
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
......@@ -243,7 +241,6 @@
};
return GameWrapper;
}(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) {
prepareProps();
......@@ -251,7 +248,6 @@
var instance = new GameWrapper();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
......
{"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,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,iBAAO,SA8DP;SAjEO,kBAAY,GAAG,EAAE,CAAC;SAIzB,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,CAAC;SAuDzD,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;SAC7B,KAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;SAC3B,KAAI,CAAC,SAAS,GAAG,GAAG,CAAC;SACrB,KAAI,CAAC,SAAS,GAAG,GAAG,CAAC;SAErB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;;MAC3C;KAOD,wBAAK,GAAL;SACC,IAAI,IAAI,CAAC,SAAS,EAAE;aACnB,OAAO;UACP;SAED,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SAEtB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SAKnB,IAAI,CAAC,aAAa,GAAG,IAAI,MAAM,CAAC,S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eAAe,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAExC,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SAC/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;MAExB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
{"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 < this.prizes.length; 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":";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;MACvB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;"}
\ No newline at end of file
......@@ -319,7 +319,7 @@ export default class GameView extends engine.Container {
private getPrizeUrl(pid: string): string {
let purl = "";
for (let i = 0; i < 3; i++) {
for (let i = 0; i < this.prizes.length; i++) {
if (this.prizes[i].prizeId == pid) {
return this.prizes[i].icon;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment