Commit 4cd88964 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent a327deb9
......@@ -134,5 +134,5 @@
}
},
"id": "pintu",
"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.pintu = 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\tfunction getTexture(uuid) {\r\n\t return engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n\t}\r\n\tfunction getTextureByName(name) {\r\n\t return getTexture(engine.getAssetByName(name).uuid);\r\n\t}\r\n\tfunction loadImageByUrl(url) {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t return tslib.__generator(this, function (_a) {\r\n\t try {\r\n\t return [2, new Promise(function (resolve) {\r\n\t var t1 = setTimeout(function () {\r\n\t return resolve(null);\r\n\t }, 2000);\r\n\t if (engine.TextureCache[url]) {\r\n\t clearTimeout(t1);\r\n\t resolve(engine.TextureCache[url]);\r\n\t }\r\n\t else {\r\n\t var t = engine.Texture.from(url);\r\n\t t.addEventListener(\"loaded\", function () { clearTimeout(t1); resolve(t); });\r\n\t }\r\n\t })];\r\n\t }\r\n\t catch (e) {\r\n\t return [2, null];\r\n\t }\r\n\t return [2];\r\n\t });\r\n\t });\r\n\t}\r\n\t//# sourceMappingURL=utils.js.map\n\n\tvar Tool = (function () {\r\n\t function Tool() {\r\n\t }\r\n\t Tool.getOnePic = function () {\r\n\t if (this.picPool.length > 0) {\r\n\t return this.picPool.shift();\r\n\t }\r\n\t else {\r\n\t var ipic = new engine.Container();\r\n\t var isprite = new engine.ScrollView();\r\n\t isprite.name = \"iscrollv\";\r\n\t var nsp = new engine.Sprite();\r\n\t nsp.name = \"isprite\";\r\n\t nsp.texture;\r\n\t isprite.addChild(nsp);\r\n\t ipic.addChild(isprite);\r\n\t isprite.mouseEnabled = false;\r\n\t nsp.mouseEnabled = false;\r\n\t return ipic;\r\n\t }\r\n\t };\r\n\t Tool.repushToPool = function (icont) {\r\n\t this.picPool.push(icont);\r\n\t };\r\n\t Tool.picPool = new Array();\r\n\t return Tool;\r\n\t}());\r\n\t//# sourceMappingURL=Tool.js.map\n\n\tvar qietu = (function (url, type1, rows, cols, parent, inshowurl) { return tslib.__awaiter(void 0, void 0, void 0, function () {\r\n\t var t, t1, setimgwid, mwid1, mhei1, picarr, picnames, startlix, addlix, startliy, addliy, twid1, thei1, r, startx, c, starty, nsprite, isprite, nsp, ispritename, e_1;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t _a.trys.push([0, 6, , 8]);\r\n\t t = void 0;\r\n\t if (!(type1 == 1)) return [3, 1];\r\n\t t = url;\r\n\t return [3, 5];\r\n\t case 1:\r\n\t if (!(type1 == 2)) return [3, 3];\r\n\t return [4, loadImageByUrl(url)];\r\n\t case 2:\r\n\t t1 = _a.sent();\r\n\t if (t1) {\r\n\t t = t1;\r\n\t }\r\n\t return [3, 5];\r\n\t case 3:\r\n\t if (!(type1 == 3)) return [3, 5];\r\n\t inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n\t return [4, getTextureByName(\"testimg\")];\r\n\t case 4:\r\n\t t = (_a.sent());\r\n\t _a.label = 5;\r\n\t case 5:\r\n\t if (!t) {\r\n\t inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n\t return [2, qietu(\"testimg\", 3, rows, cols, parent, inshowurl)];\r\n\t }\r\n\t setimgwid = 612;\r\n\t mwid1 = setimgwid / rows;\r\n\t mhei1 = setimgwid / cols;\r\n\t picarr = {};\r\n\t picnames = [];\r\n\t startlix = 0;\r\n\t addlix = 1 / rows;\r\n\t startliy = 0;\r\n\t addliy = 1 / cols;\r\n\t twid1 = setimgwid;\r\n\t thei1 = setimgwid;\r\n\t for (r = 0; r < rows; r++) {\r\n\t startx = startlix + addlix * r;\r\n\t for (c = 0; c < cols; c++) {\r\n\t starty = startliy + addliy * c;\r\n\t nsprite = Tool.getOnePic();\r\n\t isprite = nsprite.getChildByName(\"iscrollv\");\r\n\t nsp = isprite.getChildByName(\"isprite\");\r\n\t nsp.texture = t;\r\n\t nsp.width = twid1;\r\n\t nsp.height = thei1;\r\n\t nsp.x = -starty * twid1;\r\n\t nsp.y = -startx * thei1;\r\n\t isprite.width = mwid1;\r\n\t isprite.height = mhei1;\r\n\t nsprite.width = mwid1;\r\n\t nsprite.height = mhei1;\r\n\t ispritename = \"pic_\" + c + \"_\" + r;\r\n\t nsprite.name = ispritename;\r\n\t picarr[ispritename] = nsprite;\r\n\t picnames.push(ispritename);\r\n\t }\r\n\t }\r\n\t return [2, {\r\n\t res: true,\r\n\t picarr: picarr,\r\n\t mwid: mwid1,\r\n\t mhei: mhei1,\r\n\t picnames: picnames,\r\n\t inshowurl: inshowurl\r\n\t }];\r\n\t case 6:\r\n\t e_1 = _a.sent();\r\n\t return [4, new Promise(function (res) {\r\n\t setTimeout(function () {\r\n\t res();\r\n\t }, 200);\r\n\t })];\r\n\t case 7:\r\n\t _a.sent();\r\n\t inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n\t return [2, qietu(\"testimg\", 3, rows, cols, parent, inshowurl)];\r\n\t case 8: return [2];\r\n\t }\r\n\t });\r\n\t}); });\r\n\t//# sourceMappingURL=qietu.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.ingame = false;\r\n\t _this.selectImgArr = [];\r\n\t _this.sucposData = {};\r\n\t _this.gameUrls = [];\r\n\t _this.gameTimes = [];\r\n\t _this.onegamePics = [];\r\n\t _this.movesteps = 0;\r\n\t _this.startime = 0;\r\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.initScene, _this);\r\n\t return _this;\r\n\t }\r\n\t GameView.prototype.initScene = function () {\r\n\t this.lineShape = new engine.Shape();\r\n\t this.selectimg3 = new engine.Image(getTextureByName(\"框3\"));\r\n\t this.selectimg4 = new engine.Image(getTextureByName(\"框4\"));\r\n\t this.selectimg3.mouseEnabled = false;\r\n\t this.selectimg4.mouseEnabled = false;\r\n\t this.dicont = new engine.Container();\r\n\t this.linecont = new engine.Container();\r\n\t this.blockcont = new engine.Container();\r\n\t this.addChild(this.dicont);\r\n\t this.addChild(this.linecont);\r\n\t this.addChild(this.blockcont);\r\n\t this.linecont.addChild(this.lineShape);\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-initcomp\", {});\r\n\t this.removeEventListener(engine.Event.ADDED_TO_STAGE, this.initScene, this);\r\n\t };\r\n\t GameView.prototype.initgame = function () {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var l, lurl, lt;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t this.gameUrls = props.gameUrls || [\"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/28.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/29.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/30.jpg\"];\r\n\t this.gameTimes = props.gameTimes || [30, 60, 60];\r\n\t this.onegamePics = new Array();\r\n\t l = 0;\r\n\t _a.label = 1;\r\n\t case 1:\r\n\t if (!(l < this.gameUrls.length)) return [3, 4];\r\n\t lurl = this.gameUrls[l];\r\n\t return [4, loadImageByUrl(lurl)];\r\n\t case 2:\r\n\t lt = _a.sent();\r\n\t if (lt) {\r\n\t lt = lt;\r\n\t }\r\n\t else {\r\n\t lt = null;\r\n\t }\r\n\t this.onegamePics.push(lt);\r\n\t if (this.onegamePics.length == 1) {\r\n\t this.startfirst();\r\n\t }\r\n\t _a.label = 3;\r\n\t case 3:\r\n\t l++;\r\n\t return [3, 1];\r\n\t case 4:\r\n\t this.removeSelectImg();\r\n\t return [2];\r\n\t }\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.removeSelectImg = function () {\r\n\t if (this.selectimg3) {\r\n\t this.blockcont.removeChild(this.selectimg3);\r\n\t }\r\n\t if (this.selectimg4) {\r\n\t this.blockcont.removeChild(this.selectimg4);\r\n\t }\r\n\t };\r\n\t GameView.prototype.removeDiPics = function () {\r\n\t var nume = this.dicont.children.length;\r\n\t for (var i = nume - 1; i >= 0; i--) {\r\n\t var ichild = this.dicont.getChildAt(i);\r\n\t if (ichild) {\r\n\t ichild.removeEventListener(engine.MouseEvent.MOUSE_DOWN, this.touchPic, this);\r\n\t this.dicont.removeChild(ichild);\r\n\t Tool.repushToPool(ichild);\r\n\t }\r\n\t }\r\n\t };\r\n\t GameView.prototype.startfirst = function () {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var actidx, tex, type1, inshowurl, result, res, picarr, mwid, mhei, picnames, picurl, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t this.removeDiPics();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\r\n\t this.removeSelectImg();\r\n\t actidx = 0;\r\n\t this.gametime = this.gameTimes[actidx];\r\n\t this.showtime = this.gameTimes[actidx];\r\n\t this.passtime = 0;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-update\", {\r\n\t time: this.showtime,\r\n\t });\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-passtime\", {\r\n\t passtime: this.passtime\r\n\t });\r\n\t this.rows = 3;\r\n\t this.cols = 3;\r\n\t this.nselectimg = null;\r\n\t if (this.rows == 3) {\r\n\t this.nselectimg = this.selectimg3;\r\n\t }\r\n\t if (this.rows == 4) {\r\n\t this.nselectimg = this.selectimg4;\r\n\t }\r\n\t this.selectImgArr = new Array();\r\n\t this.sucposData = {};\r\n\t tex = this.onegamePics[actidx];\r\n\t type1 = 1;\r\n\t if (!tex) {\r\n\t tex = this.gameUrls[actidx];\r\n\t type1 = 3;\r\n\t }\r\n\t inshowurl = this.gameUrls[actidx];\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont, inshowurl)];\r\n\t case 1:\r\n\t result = _a.sent();\r\n\t res = result.res;\r\n\t if (res) {\r\n\t picarr = result.picarr;\r\n\t mwid = result.mwid;\r\n\t mhei = result.mhei;\r\n\t picnames = result.picnames;\r\n\t picurl = result.inshowurl;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-showurl\", {\r\n\t picurl: picurl\r\n\t });\r\n\t this.mwid = mwid;\r\n\t this.mhei = mhei;\r\n\t this.picarr = picarr;\r\n\t this.picnames = picnames;\r\n\t gap = 2;\r\n\t for (r = 0; r < this.rows; r++) {\r\n\t for (c = 0; c < this.cols; c++) {\r\n\t ipicx = mwid * c + gap;\r\n\t ipicy = mhei * r + gap;\r\n\t npicname = \"pic_\" + c + \"_\" + r;\r\n\t ipic = picarr[npicname];\r\n\t this.dicont.addChild(ipic);\r\n\t ipic.x = ipicx;\r\n\t ipic.y = ipicy;\r\n\t }\r\n\t }\r\n\t this.lineShape.clear();\r\n\t this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);\r\n\t this.lineShape.moveTo(0 + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, 0 + gap);\r\n\t for (rl = 1; rl < this.rows; rl++) {\r\n\t this.lineShape.moveTo(0 + gap, rl * mhei + gap);\r\n\t this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);\r\n\t }\r\n\t for (cl = 1; cl < this.cols; cl++) {\r\n\t this.lineShape.moveTo(cl * mwid + gap, 0 + gap);\r\n\t this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);\r\n\t }\r\n\t this.lineShape.endStroke();\r\n\t engine.globalEvent.dispatchEvent(\"pictures-load-complete\");\r\n\t this.ticker && clearInterval(this.ticker);\r\n\t this.ticker = setInterval(this.update, 10);\r\n\t }\r\n\t else {\r\n\t console.error(\"图片处理失败\");\r\n\t }\r\n\t return [2];\r\n\t }\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.start = function () {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var actidx, tex, type1, inshowurl, result, res, picarr, mwid, mhei, picnames, picurl, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t this.removeDiPics();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\r\n\t this.removeSelectImg();\r\n\t actidx = props.actidx;\r\n\t this.gametime = this.gameTimes[actidx];\r\n\t this.showtime = this.gameTimes[actidx];\r\n\t this.passtime = 0;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-update\", {\r\n\t time: this.showtime,\r\n\t });\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-passtime\", {\r\n\t passtime: this.passtime\r\n\t });\r\n\t this.rows = props.rows;\r\n\t this.cols = props.cols;\r\n\t this.nselectimg = null;\r\n\t if (this.rows == 3) {\r\n\t this.nselectimg = this.selectimg3;\r\n\t }\r\n\t if (this.rows == 4) {\r\n\t this.nselectimg = this.selectimg4;\r\n\t }\r\n\t this.selectImgArr = new Array();\r\n\t this.sucposData = {};\r\n\t tex = this.onegamePics[actidx];\r\n\t type1 = 1;\r\n\t if (!tex) {\r\n\t tex = this.gameUrls[actidx];\r\n\t type1 = 3;\r\n\t }\r\n\t inshowurl = this.gameUrls[actidx];\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont, inshowurl)];\r\n\t case 1:\r\n\t result = _a.sent();\r\n\t res = result.res;\r\n\t if (res) {\r\n\t picarr = result.picarr;\r\n\t mwid = result.mwid;\r\n\t mhei = result.mhei;\r\n\t picnames = result.picnames;\r\n\t picurl = result.inshowurl;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-showurl\", {\r\n\t picurl: picurl\r\n\t });\r\n\t this.mwid = mwid;\r\n\t this.mhei = mhei;\r\n\t this.picarr = picarr;\r\n\t this.picnames = picnames;\r\n\t gap = 2;\r\n\t for (r = 0; r < this.rows; r++) {\r\n\t for (c = 0; c < this.cols; c++) {\r\n\t ipicx = mwid * c + gap;\r\n\t ipicy = mhei * r + gap;\r\n\t npicname = \"pic_\" + c + \"_\" + r;\r\n\t ipic = picarr[npicname];\r\n\t this.dicont.addChild(ipic);\r\n\t ipic.x = ipicx;\r\n\t ipic.y = ipicy;\r\n\t }\r\n\t }\r\n\t this.lineShape.clear();\r\n\t this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);\r\n\t this.lineShape.moveTo(0 + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, 0 + gap);\r\n\t for (rl = 1; rl < this.rows; rl++) {\r\n\t this.lineShape.moveTo(0 + gap, rl * mhei + gap);\r\n\t this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);\r\n\t }\r\n\t for (cl = 1; cl < this.cols; cl++) {\r\n\t this.lineShape.moveTo(cl * mwid + gap, 0 + gap);\r\n\t this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);\r\n\t }\r\n\t this.lineShape.endStroke();\r\n\t this.ticker && clearInterval(this.ticker);\r\n\t this.ticker = setInterval(this.update, 10);\r\n\t }\r\n\t else {\r\n\t console.error(\"图片处理失败\");\r\n\t }\r\n\t return [2];\r\n\t }\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.luanxu = function () {\r\n\t var gap = 2;\r\n\t for (var r = 0; r < this.rows; r++) {\r\n\t for (var c = 0; c < this.cols; c++) {\r\n\t var ipicx = this.mwid * c + gap;\r\n\t var ipicy = this.mhei * r + gap;\r\n\t var npicname = \"pic_\" + c + \"_\" + r;\r\n\t this.sucposData[npicname] = r + \"_\" + c;\r\n\t var selidx = Math.floor(Math.random() * this.picnames.length);\r\n\t var ipicname = this.picnames[selidx];\r\n\t if (r == c && r != this.rows - 1) {\r\n\t while (ipicname == npicname) {\r\n\t selidx = Math.floor(Math.random() * this.picnames.length);\r\n\t ipicname = this.picnames[selidx];\r\n\t }\r\n\t }\r\n\t var ipic = this.picarr[ipicname];\r\n\t this.picnames.splice(selidx, 1);\r\n\t ipic.x = ipicx;\r\n\t ipic.y = ipicy;\r\n\t ipic[\"postr\"] = r + \"_\" + c;\r\n\t ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.touchPic, this);\r\n\t }\r\n\t }\r\n\t };\r\n\t GameView.prototype.pause = function () {\r\n\t this.ingame = false;\r\n\t };\r\n\t GameView.prototype.resume = function () {\r\n\t this.lastframetime = Date.now();\r\n\t this.ingame = true;\r\n\t };\r\n\t GameView.prototype.update = function () {\r\n\t var ntime = Date.now();\r\n\t if (!this.lastframetime) {\r\n\t this.lastframetime = ntime;\r\n\t return;\r\n\t }\r\n\t if (this.ingame) {\r\n\t var passtime = (ntime - this.lastframetime) / 1000;\r\n\t this.passtime += passtime;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-passtime\", {\r\n\t passtime: this.passtime\r\n\t });\r\n\t var showtime1 = Math.round(this.gametime - this.passtime);\r\n\t if (this.showtime != showtime1) {\r\n\t this.showtime = showtime1;\r\n\t if (this.showtime <= 0) {\r\n\t this.showtime = 0;\r\n\t this.gameover(2);\r\n\t }\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-update\", {\r\n\t time: this.showtime\r\n\t });\r\n\t }\r\n\t }\r\n\t this.lastframetime = ntime;\r\n\t };\r\n\t GameView.prototype.touchPic = function (e) {\r\n\t if (!this.ingame) {\r\n\t return;\r\n\t }\r\n\t var selectname = e.target.name;\r\n\t var spx = e.target.x;\r\n\t var spy = e.target.y;\r\n\t var gap = 2;\r\n\t if (this.selectImgArr.length == 0) {\r\n\t if (this.nselectimg) {\r\n\t this.blockcont.addChild(this.nselectimg);\r\n\t this.nselectimg.x = spx - gap;\r\n\t this.nselectimg.y = spy - gap;\r\n\t }\r\n\t this.selectImgArr.push(selectname);\r\n\t }\r\n\t else if (this.selectImgArr.length == 1) {\r\n\t if (selectname == this.selectImgArr[0]) {\r\n\t if (this.nselectimg) {\r\n\t this.blockcont.removeChild(this.nselectimg);\r\n\t }\r\n\t this.selectImgArr = new Array();\r\n\t return;\r\n\t }\r\n\t else {\r\n\t this.selectImgArr.push(selectname);\r\n\t this.changeImgPos();\r\n\t }\r\n\t }\r\n\t };\r\n\t GameView.prototype.changeImgPos = function () {\r\n\t var img1name = this.selectImgArr[0];\r\n\t var img2name = this.selectImgArr[1];\r\n\t var img1 = this.dicont.getChildByName(img1name);\r\n\t var img2 = this.dicont.getChildByName(img2name);\r\n\t var imgpos1x = img1.x;\r\n\t var imgpos1y = img1.y;\r\n\t var imgpos2x = img2.x;\r\n\t var imgpos2y = img2.y;\r\n\t var imgpostr1 = img1.postr;\r\n\t var imgpostr2 = img2.postr;\r\n\t img1.x = imgpos2x;\r\n\t img1.y = imgpos2y;\r\n\t img1.postr = imgpostr2;\r\n\t img2.x = imgpos1x;\r\n\t img2.y = imgpos1y;\r\n\t img2.postr = imgpostr1;\r\n\t this.selectImgArr = new Array();\r\n\t this.movesteps += 1;\r\n\t if (this.nselectimg) {\r\n\t this.blockcont.removeChild(this.nselectimg);\r\n\t }\r\n\t var isuc = this.checkSuccess();\r\n\t if (isuc) {\r\n\t this.gameover(1);\r\n\t }\r\n\t };\r\n\t GameView.prototype.checkSuccess = function () {\r\n\t var isuc = true;\r\n\t for (var r = 0; r < this.rows; r++) {\r\n\t for (var c = 0; c < this.cols; c++) {\r\n\t var ipicname = \"pic_\" + c + \"_\" + r;\r\n\t var npicstr = r + \"_\" + c;\r\n\t var ipic = this.dicont.getChildByName(ipicname);\r\n\t var ipostr = ipic.postr;\r\n\t if (npicstr != ipostr) {\r\n\t isuc = false;\r\n\t break;\r\n\t }\r\n\t }\r\n\t }\r\n\t return isuc;\r\n\t };\r\n\t GameView.prototype.gameover = function (reason) {\r\n\t this.ingame = false;\r\n\t this.ticker && clearInterval(this.ticker);\r\n\t var ntime = Date.now();\r\n\t var gametime = ntime - this.startime;\r\n\t engine.globalEvent.dispatchEvent('pictures-game-over', {\r\n\t reason: reason,\r\n\t time: this.passtime,\r\n\t number: this.movesteps,\r\n\t gametime: gametime\r\n\t });\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 _this._gameView = new GameView();\r\n\t _this.addChild(_this._gameView);\r\n\t engine.globalEvent.addEventListener('pictures-initgame', _this.initgame, _this);\r\n\t engine.globalEvent.addEventListener('pictures-start', _this.start, _this);\r\n\t engine.globalEvent.addEventListener('pictures-luanxu', _this.luanxu, _this);\r\n\t engine.globalEvent.addEventListener('pictures-pause', _this.pause, _this);\r\n\t engine.globalEvent.addEventListener('pictures-resume', _this.resume, _this);\r\n\t return _this;\r\n\t }\r\n\t GameWrapper.prototype.initgame = function (event) {\r\n\t injectProps(event.data);\r\n\t this._gameView.initgame();\r\n\t };\r\n\t GameWrapper.prototype.start = function (event) {\r\n\t injectProps(event.data);\r\n\t this._gameView.start();\r\n\t };\r\n\t GameWrapper.prototype.luanxu = function () {\r\n\t this._gameView.luanxu();\r\n\t };\r\n\t GameWrapper.prototype.pause = function (event) {\r\n\t this._gameView.pause();\r\n\t };\r\n\t GameWrapper.prototype.resume = function (event) {\r\n\t this._gameView.resume();\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.pintu = 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\tfunction getTexture(uuid) {\r\n\t return engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n\t}\r\n\tfunction getTextureByName(name) {\r\n\t return getTexture(engine.getAssetByName(name).uuid);\r\n\t}\r\n\tfunction loadImageByUrl(url) {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t return tslib.__generator(this, function (_a) {\r\n\t try {\r\n\t return [2, new Promise(function (resolve) {\r\n\t var t1 = setTimeout(function () {\r\n\t return resolve(null);\r\n\t }, 2000);\r\n\t if (engine.TextureCache[url]) {\r\n\t clearTimeout(t1);\r\n\t resolve(engine.TextureCache[url]);\r\n\t }\r\n\t else {\r\n\t var t = engine.Texture.from(url);\r\n\t t.addEventListener(\"loaded\", function () { clearTimeout(t1); resolve(t); });\r\n\t }\r\n\t })];\r\n\t }\r\n\t catch (e) {\r\n\t return [2, null];\r\n\t }\r\n\t return [2];\r\n\t });\r\n\t });\r\n\t}\n\n\tvar Tool = (function () {\r\n\t function Tool() {\r\n\t }\r\n\t Tool.getOnePic = function () {\r\n\t if (this.picPool.length > 0) {\r\n\t return this.picPool.shift();\r\n\t }\r\n\t else {\r\n\t var ipic = new engine.Container();\r\n\t var isprite = new engine.ScrollView();\r\n\t isprite.name = \"iscrollv\";\r\n\t var nsp = new engine.Sprite();\r\n\t nsp.name = \"isprite\";\r\n\t nsp.texture;\r\n\t isprite.addChild(nsp);\r\n\t ipic.addChild(isprite);\r\n\t isprite.mouseEnabled = false;\r\n\t nsp.mouseEnabled = false;\r\n\t return ipic;\r\n\t }\r\n\t };\r\n\t Tool.repushToPool = function (icont) {\r\n\t this.picPool.push(icont);\r\n\t };\r\n\t Tool.picPool = new Array();\r\n\t return Tool;\r\n\t}());\n\n\tvar qietu = (function (url, type1, rows, cols, parent, inshowurl) { return tslib.__awaiter(void 0, void 0, void 0, function () {\r\n\t var t, t1, setimgwid, mwid1, mhei1, picarr, picnames, startlix, addlix, startliy, addliy, twid1, thei1, r, startx, c, starty, nsprite, isprite, nsp, ispritename, e_1;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t _a.trys.push([0, 6, , 8]);\r\n\t t = void 0;\r\n\t if (!(type1 == 1)) return [3, 1];\r\n\t t = url;\r\n\t return [3, 5];\r\n\t case 1:\r\n\t if (!(type1 == 2)) return [3, 3];\r\n\t return [4, loadImageByUrl(url)];\r\n\t case 2:\r\n\t t1 = _a.sent();\r\n\t if (t1) {\r\n\t t = t1;\r\n\t }\r\n\t return [3, 5];\r\n\t case 3:\r\n\t if (!(type1 == 3)) return [3, 5];\r\n\t inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n\t return [4, getTextureByName(\"testimg\")];\r\n\t case 4:\r\n\t t = (_a.sent());\r\n\t _a.label = 5;\r\n\t case 5:\r\n\t if (!t) {\r\n\t inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n\t return [2, qietu(\"testimg\", 3, rows, cols, parent, inshowurl)];\r\n\t }\r\n\t setimgwid = 612;\r\n\t mwid1 = setimgwid / rows;\r\n\t mhei1 = setimgwid / cols;\r\n\t picarr = {};\r\n\t picnames = [];\r\n\t startlix = 0;\r\n\t addlix = 1 / rows;\r\n\t startliy = 0;\r\n\t addliy = 1 / cols;\r\n\t twid1 = setimgwid;\r\n\t thei1 = setimgwid;\r\n\t for (r = 0; r < rows; r++) {\r\n\t startx = startlix + addlix * r;\r\n\t for (c = 0; c < cols; c++) {\r\n\t starty = startliy + addliy * c;\r\n\t nsprite = Tool.getOnePic();\r\n\t isprite = nsprite.getChildByName(\"iscrollv\");\r\n\t nsp = isprite.getChildByName(\"isprite\");\r\n\t nsp.texture = t;\r\n\t nsp.width = twid1;\r\n\t nsp.height = thei1;\r\n\t nsp.x = -starty * twid1;\r\n\t nsp.y = -startx * thei1;\r\n\t isprite.width = mwid1;\r\n\t isprite.height = mhei1;\r\n\t nsprite.width = mwid1;\r\n\t nsprite.height = mhei1;\r\n\t ispritename = \"pic_\" + c + \"_\" + r;\r\n\t nsprite.name = ispritename;\r\n\t picarr[ispritename] = nsprite;\r\n\t picnames.push(ispritename);\r\n\t }\r\n\t }\r\n\t return [2, {\r\n\t res: true,\r\n\t picarr: picarr,\r\n\t mwid: mwid1,\r\n\t mhei: mhei1,\r\n\t picnames: picnames,\r\n\t inshowurl: inshowurl\r\n\t }];\r\n\t case 6:\r\n\t e_1 = _a.sent();\r\n\t return [4, new Promise(function (res) {\r\n\t setTimeout(function () {\r\n\t res();\r\n\t }, 200);\r\n\t })];\r\n\t case 7:\r\n\t _a.sent();\r\n\t inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n\t return [2, qietu(\"testimg\", 3, rows, cols, parent, inshowurl)];\r\n\t case 8: return [2];\r\n\t }\r\n\t });\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.ingame = false;\r\n\t _this.selectImgArr = [];\r\n\t _this.sucposData = {};\r\n\t _this.gameUrls = [];\r\n\t _this.gameTimes = [];\r\n\t _this.onegamePics = [];\r\n\t _this.movesteps = 0;\r\n\t _this.startime = 0;\r\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.initScene, _this);\r\n\t return _this;\r\n\t }\r\n\t GameView.prototype.initScene = function () {\r\n\t this.lineShape = new engine.Shape();\r\n\t this.selectimg3 = new engine.Image(getTextureByName(\"框3\"));\r\n\t this.selectimg4 = new engine.Image(getTextureByName(\"框4\"));\r\n\t this.selectimg3.mouseEnabled = false;\r\n\t this.selectimg4.mouseEnabled = false;\r\n\t this.dicont = new engine.Container();\r\n\t this.linecont = new engine.Container();\r\n\t this.blockcont = new engine.Container();\r\n\t this.addChild(this.dicont);\r\n\t this.addChild(this.linecont);\r\n\t this.addChild(this.blockcont);\r\n\t this.linecont.addChild(this.lineShape);\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-initcomp\", {});\r\n\t this.removeEventListener(engine.Event.ADDED_TO_STAGE, this.initScene, this);\r\n\t };\r\n\t GameView.prototype.initgame = function () {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var l, lurl, lt;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t this.gameUrls = props.gameUrls || [\"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/28.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/29.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/30.jpg\"];\r\n\t this.gameTimes = props.gameTimes || [30, 60, 60];\r\n\t this.onegamePics = new Array();\r\n\t l = 0;\r\n\t _a.label = 1;\r\n\t case 1:\r\n\t if (!(l < this.gameUrls.length)) return [3, 4];\r\n\t lurl = this.gameUrls[l];\r\n\t return [4, loadImageByUrl(lurl)];\r\n\t case 2:\r\n\t lt = _a.sent();\r\n\t if (lt) {\r\n\t lt = lt;\r\n\t }\r\n\t else {\r\n\t lt = null;\r\n\t }\r\n\t this.onegamePics.push(lt);\r\n\t if (this.onegamePics.length == 1) {\r\n\t this.startfirst();\r\n\t }\r\n\t _a.label = 3;\r\n\t case 3:\r\n\t l++;\r\n\t return [3, 1];\r\n\t case 4:\r\n\t this.removeSelectImg();\r\n\t return [2];\r\n\t }\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.removeSelectImg = function () {\r\n\t if (this.selectimg3) {\r\n\t this.blockcont.removeChild(this.selectimg3);\r\n\t }\r\n\t if (this.selectimg4) {\r\n\t this.blockcont.removeChild(this.selectimg4);\r\n\t }\r\n\t };\r\n\t GameView.prototype.removeDiPics = function () {\r\n\t var nume = this.dicont.children.length;\r\n\t for (var i = nume - 1; i >= 0; i--) {\r\n\t var ichild = this.dicont.getChildAt(i);\r\n\t if (ichild) {\r\n\t ichild.removeEventListener(engine.MouseEvent.MOUSE_DOWN, this.touchPic, this);\r\n\t this.dicont.removeChild(ichild);\r\n\t Tool.repushToPool(ichild);\r\n\t }\r\n\t }\r\n\t };\r\n\t GameView.prototype.startfirst = function () {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var actidx, tex, type1, inshowurl, result, res, picarr, mwid, mhei, picnames, picurl, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t this.removeDiPics();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\r\n\t this.removeSelectImg();\r\n\t actidx = 0;\r\n\t this.gametime = this.gameTimes[actidx];\r\n\t this.showtime = this.gameTimes[actidx];\r\n\t this.passtime = 0;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-update\", {\r\n\t time: this.showtime,\r\n\t });\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-passtime\", {\r\n\t passtime: this.passtime\r\n\t });\r\n\t this.rows = 3;\r\n\t this.cols = 3;\r\n\t this.nselectimg = null;\r\n\t if (this.rows == 3) {\r\n\t this.nselectimg = this.selectimg3;\r\n\t }\r\n\t if (this.rows == 4) {\r\n\t this.nselectimg = this.selectimg4;\r\n\t }\r\n\t this.selectImgArr = new Array();\r\n\t this.sucposData = {};\r\n\t tex = this.onegamePics[actidx];\r\n\t type1 = 1;\r\n\t if (!tex) {\r\n\t tex = this.gameUrls[actidx];\r\n\t type1 = 3;\r\n\t }\r\n\t inshowurl = this.gameUrls[actidx];\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont, inshowurl)];\r\n\t case 1:\r\n\t result = _a.sent();\r\n\t res = result.res;\r\n\t if (res) {\r\n\t picarr = result.picarr;\r\n\t mwid = result.mwid;\r\n\t mhei = result.mhei;\r\n\t picnames = result.picnames;\r\n\t picurl = result.inshowurl;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-showurl\", {\r\n\t picurl: picurl\r\n\t });\r\n\t this.mwid = mwid;\r\n\t this.mhei = mhei;\r\n\t this.picarr = picarr;\r\n\t this.picnames = picnames;\r\n\t gap = 2;\r\n\t for (r = 0; r < this.rows; r++) {\r\n\t for (c = 0; c < this.cols; c++) {\r\n\t ipicx = mwid * c + gap;\r\n\t ipicy = mhei * r + gap;\r\n\t npicname = \"pic_\" + c + \"_\" + r;\r\n\t ipic = picarr[npicname];\r\n\t this.dicont.addChild(ipic);\r\n\t ipic.x = ipicx;\r\n\t ipic.y = ipicy;\r\n\t }\r\n\t }\r\n\t this.lineShape.clear();\r\n\t this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);\r\n\t this.lineShape.moveTo(0 + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, 0 + gap);\r\n\t for (rl = 1; rl < this.rows; rl++) {\r\n\t this.lineShape.moveTo(0 + gap, rl * mhei + gap);\r\n\t this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);\r\n\t }\r\n\t for (cl = 1; cl < this.cols; cl++) {\r\n\t this.lineShape.moveTo(cl * mwid + gap, 0 + gap);\r\n\t this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);\r\n\t }\r\n\t this.lineShape.endStroke();\r\n\t engine.globalEvent.dispatchEvent(\"pictures-load-complete\");\r\n\t this.ticker && clearInterval(this.ticker);\r\n\t this.ticker = setInterval(this.update, 10);\r\n\t }\r\n\t else {\r\n\t console.error(\"图片处理失败\");\r\n\t }\r\n\t return [2];\r\n\t }\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.start = function () {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var actidx, tex, type1, inshowurl, result, res, picarr, mwid, mhei, picnames, picurl, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t switch (_a.label) {\r\n\t case 0:\r\n\t this.removeDiPics();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\r\n\t this.removeSelectImg();\r\n\t actidx = props.actidx;\r\n\t this.gametime = this.gameTimes[actidx];\r\n\t this.showtime = this.gameTimes[actidx];\r\n\t this.passtime = 0;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-update\", {\r\n\t time: this.showtime,\r\n\t });\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-passtime\", {\r\n\t passtime: this.passtime\r\n\t });\r\n\t this.rows = props.rows;\r\n\t this.cols = props.cols;\r\n\t this.nselectimg = null;\r\n\t if (this.rows == 3) {\r\n\t this.nselectimg = this.selectimg3;\r\n\t }\r\n\t if (this.rows == 4) {\r\n\t this.nselectimg = this.selectimg4;\r\n\t }\r\n\t this.selectImgArr = new Array();\r\n\t this.sucposData = {};\r\n\t tex = this.onegamePics[actidx];\r\n\t type1 = 1;\r\n\t if (!tex) {\r\n\t tex = this.gameUrls[actidx];\r\n\t type1 = 3;\r\n\t }\r\n\t inshowurl = this.gameUrls[actidx];\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont, inshowurl)];\r\n\t case 1:\r\n\t result = _a.sent();\r\n\t res = result.res;\r\n\t if (res) {\r\n\t picarr = result.picarr;\r\n\t mwid = result.mwid;\r\n\t mhei = result.mhei;\r\n\t picnames = result.picnames;\r\n\t picurl = result.inshowurl;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-showurl\", {\r\n\t picurl: picurl\r\n\t });\r\n\t this.mwid = mwid;\r\n\t this.mhei = mhei;\r\n\t this.picarr = picarr;\r\n\t this.picnames = picnames;\r\n\t gap = 2;\r\n\t for (r = 0; r < this.rows; r++) {\r\n\t for (c = 0; c < this.cols; c++) {\r\n\t ipicx = mwid * c + gap;\r\n\t ipicy = mhei * r + gap;\r\n\t npicname = \"pic_\" + c + \"_\" + r;\r\n\t ipic = picarr[npicname];\r\n\t this.dicont.addChild(ipic);\r\n\t ipic.x = ipicx;\r\n\t ipic.y = ipicy;\r\n\t }\r\n\t }\r\n\t this.lineShape.clear();\r\n\t this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);\r\n\t this.lineShape.moveTo(0 + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);\r\n\t this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);\r\n\t this.lineShape.lineTo(0 + gap, 0 + gap);\r\n\t for (rl = 1; rl < this.rows; rl++) {\r\n\t this.lineShape.moveTo(0 + gap, rl * mhei + gap);\r\n\t this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);\r\n\t }\r\n\t for (cl = 1; cl < this.cols; cl++) {\r\n\t this.lineShape.moveTo(cl * mwid + gap, 0 + gap);\r\n\t this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);\r\n\t }\r\n\t this.lineShape.endStroke();\r\n\t this.ticker && clearInterval(this.ticker);\r\n\t this.ticker = setInterval(this.update, 10);\r\n\t }\r\n\t else {\r\n\t console.error(\"图片处理失败\");\r\n\t }\r\n\t return [2];\r\n\t }\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.luanxu = function () {\r\n\t var gap = 2;\r\n\t for (var r = 0; r < this.rows; r++) {\r\n\t for (var c = 0; c < this.cols; c++) {\r\n\t var ipicx = this.mwid * c + gap;\r\n\t var ipicy = this.mhei * r + gap;\r\n\t var npicname = \"pic_\" + c + \"_\" + r;\r\n\t this.sucposData[npicname] = r + \"_\" + c;\r\n\t var selidx = Math.floor(Math.random() * this.picnames.length);\r\n\t var ipicname = this.picnames[selidx];\r\n\t if (r == c && r != this.rows - 1) {\r\n\t while (ipicname == npicname) {\r\n\t selidx = Math.floor(Math.random() * this.picnames.length);\r\n\t ipicname = this.picnames[selidx];\r\n\t }\r\n\t }\r\n\t var ipic = this.picarr[ipicname];\r\n\t this.picnames.splice(selidx, 1);\r\n\t ipic.x = ipicx;\r\n\t ipic.y = ipicy;\r\n\t ipic[\"postr\"] = r + \"_\" + c;\r\n\t ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.touchPic, this);\r\n\t }\r\n\t }\r\n\t };\r\n\t GameView.prototype.pause = function () {\r\n\t this.ingame = false;\r\n\t };\r\n\t GameView.prototype.resume = function () {\r\n\t this.lastframetime = Date.now();\r\n\t this.ingame = true;\r\n\t };\r\n\t GameView.prototype.update = function () {\r\n\t var ntime = Date.now();\r\n\t if (!this.lastframetime) {\r\n\t this.lastframetime = ntime;\r\n\t return;\r\n\t }\r\n\t if (this.ingame) {\r\n\t var passtime = (ntime - this.lastframetime) / 1000;\r\n\t this.passtime += passtime;\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-passtime\", {\r\n\t passtime: this.passtime\r\n\t });\r\n\t var showtime1 = Math.round(this.gametime - this.passtime);\r\n\t if (this.showtime != showtime1) {\r\n\t this.showtime = showtime1;\r\n\t if (this.showtime <= 0) {\r\n\t this.showtime = 0;\r\n\t this.gameover(2);\r\n\t }\r\n\t engine.globalEvent.dispatchEvent(\"pictures-time-update\", {\r\n\t time: this.showtime\r\n\t });\r\n\t }\r\n\t }\r\n\t this.lastframetime = ntime;\r\n\t };\r\n\t GameView.prototype.touchPic = function (e) {\r\n\t if (!this.ingame) {\r\n\t return;\r\n\t }\r\n\t var selectname = e.target.name;\r\n\t var spx = e.target.x;\r\n\t var spy = e.target.y;\r\n\t var gap = 2;\r\n\t if (this.selectImgArr.length == 0) {\r\n\t if (this.nselectimg) {\r\n\t this.blockcont.addChild(this.nselectimg);\r\n\t this.nselectimg.x = spx - gap;\r\n\t this.nselectimg.y = spy - gap;\r\n\t }\r\n\t this.selectImgArr.push(selectname);\r\n\t }\r\n\t else if (this.selectImgArr.length == 1) {\r\n\t if (selectname == this.selectImgArr[0]) {\r\n\t if (this.nselectimg) {\r\n\t this.blockcont.removeChild(this.nselectimg);\r\n\t }\r\n\t this.selectImgArr = new Array();\r\n\t return;\r\n\t }\r\n\t else {\r\n\t this.selectImgArr.push(selectname);\r\n\t this.changeImgPos();\r\n\t }\r\n\t }\r\n\t };\r\n\t GameView.prototype.changeImgPos = function () {\r\n\t var img1name = this.selectImgArr[0];\r\n\t var img2name = this.selectImgArr[1];\r\n\t var img1 = this.dicont.getChildByName(img1name);\r\n\t var img2 = this.dicont.getChildByName(img2name);\r\n\t var imgpos1x = img1.x;\r\n\t var imgpos1y = img1.y;\r\n\t var imgpos2x = img2.x;\r\n\t var imgpos2y = img2.y;\r\n\t var imgpostr1 = img1.postr;\r\n\t var imgpostr2 = img2.postr;\r\n\t img1.x = imgpos2x;\r\n\t img1.y = imgpos2y;\r\n\t img1.postr = imgpostr2;\r\n\t img2.x = imgpos1x;\r\n\t img2.y = imgpos1y;\r\n\t img2.postr = imgpostr1;\r\n\t this.selectImgArr = new Array();\r\n\t this.movesteps += 1;\r\n\t if (this.nselectimg) {\r\n\t this.blockcont.removeChild(this.nselectimg);\r\n\t }\r\n\t var isuc = this.checkSuccess();\r\n\t if (isuc) {\r\n\t this.gameover(1);\r\n\t }\r\n\t };\r\n\t GameView.prototype.checkSuccess = function () {\r\n\t var isuc = true;\r\n\t for (var r = 0; r < this.rows; r++) {\r\n\t for (var c = 0; c < this.cols; c++) {\r\n\t var ipicname = \"pic_\" + c + \"_\" + r;\r\n\t var npicstr = r + \"_\" + c;\r\n\t var ipic = this.dicont.getChildByName(ipicname);\r\n\t var ipostr = ipic.postr;\r\n\t if (npicstr != ipostr) {\r\n\t isuc = false;\r\n\t break;\r\n\t }\r\n\t }\r\n\t }\r\n\t return isuc;\r\n\t };\r\n\t GameView.prototype.gameover = function (reason) {\r\n\t this.ingame = false;\r\n\t this.ticker && clearInterval(this.ticker);\r\n\t var ntime = Date.now();\r\n\t var gametime = ntime - this.startime;\r\n\t engine.globalEvent.dispatchEvent('pictures-game-over', {\r\n\t reason: reason,\r\n\t time: this.passtime,\r\n\t number: this.movesteps,\r\n\t gametime: gametime\r\n\t });\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 _this._gameView = new GameView();\r\n\t _this.addChild(_this._gameView);\r\n\t engine.globalEvent.addEventListener('pictures-initgame', _this.initgame, _this);\r\n\t engine.globalEvent.addEventListener('pictures-start', _this.start, _this);\r\n\t engine.globalEvent.addEventListener('pictures-luanxu', _this.luanxu, _this);\r\n\t engine.globalEvent.addEventListener('pictures-pause', _this.pause, _this);\r\n\t engine.globalEvent.addEventListener('pictures-resume', _this.resume, _this);\r\n\t return _this;\r\n\t }\r\n\t GameWrapper.prototype.initgame = function (event) {\r\n\t injectProps(event.data);\r\n\t this._gameView.initgame();\r\n\t };\r\n\t GameWrapper.prototype.start = function (event) {\r\n\t injectProps(event.data);\r\n\t this._gameView.start();\r\n\t };\r\n\t GameWrapper.prototype.luanxu = function () {\r\n\t this._gameView.luanxu();\r\n\t };\r\n\t GameWrapper.prototype.pause = function (event) {\r\n\t this._gameView.pause();\r\n\t };\r\n\t GameWrapper.prototype.resume = function (event) {\r\n\t this._gameView.resume();\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"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,7 +12,6 @@
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
......@@ -45,7 +44,6 @@
});
});
}
//# sourceMappingURL=utils.js.map
var Tool = (function () {
function Tool() {
......@@ -74,7 +72,6 @@
Tool.picPool = new Array();
return Tool;
}());
//# sourceMappingURL=Tool.js.map
var qietu = (function (url, type1, rows, cols, parent, inshowurl) { return tslib.__awaiter(void 0, void 0, void 0, function () {
var t, t1, setimgwid, mwid1, mhei1, picarr, picnames, startlix, addlix, startliy, addliy, twid1, thei1, r, startx, c, starty, nsprite, isprite, nsp, ispritename, e_1;
......@@ -163,7 +160,6 @@
}
});
}); });
//# sourceMappingURL=qietu.js.map
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
......@@ -620,7 +616,6 @@
};
return GameWrapper;
}(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) {
prepareProps();
......@@ -628,7 +623,6 @@
var instance = new GameWrapper();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
......
{"version":3,"file":"index.js","sources":["src/custom/pintu/src/props.ts","src/custom/pintu/src/game/utils.ts","src/custom/pintu/src/game/Tool.ts","src/custom/pintu/src/game/qietu.ts","src/custom/pintu/src/game/GameView.ts","src/custom/pintu/src/game/GameWrapper.ts","src/custom/pintu/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 2020-01-21.\r\n */\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\n\r\nexport function getTextureByName(name) {\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\n\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\r\n}\r\nexport function createSvga(name, anchorName?) {\r\n\tlet inst = new svga.Svga();\r\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\treturn inst;\r\n}\r\n\r\nexport async function loadImageByUrl(url){\r\n\t// console.log('loadImageByUrl----------:',url);\r\n\ttry{\r\n\t\t// console.log(\"尝试加载44\");\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\tlet t1 = setTimeout(()=>{\r\n\t\t\t\treturn resolve(null);\r\n\t\t\t},2000);\r\n\r\n\t\t\tif (engine.TextureCache[url]) {\r\n\t\t\t\tclearTimeout(t1);\r\n\t\t\t\tresolve(engine.TextureCache[url])\r\n\t\t\t} else {\r\n\t\t\t\tvar t = engine.Texture.from(url);\r\n\t\t\t\tt.addEventListener(\"loaded\", () => { clearTimeout(t1);resolve(t) });\r\n\t\t\t}\r\n\t\t})\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}","export default class Tool{\r\n static picPool:Array<engine.Container> = new Array();\r\n static getOnePic(){\r\n if(this.picPool.length>0){\r\n return this.picPool.shift();\r\n }else{\r\n let ipic = new engine.Container();\r\n \r\n let isprite = new engine.ScrollView();\r\n isprite.name = \"iscrollv\";\r\n let nsp = new engine.Sprite();\r\n nsp.name = \"isprite\";\r\n nsp.texture\r\n\r\n isprite.addChild(nsp);\r\n\r\n ipic.addChild(isprite);\r\n\r\n isprite.mouseEnabled = false;\r\n nsp.mouseEnabled = false;\r\n\r\n return ipic;\r\n }\r\n }\r\n\r\n static repushToPool(icont:engine.Container){\r\n this.picPool.push(icont);\r\n }\r\n}","import { props } from \"../props\";\r\nimport { loadImageByUrl, getTextureByName ,getTexture} from \"./utils\";\r\nimport qietu from \"./qietu\";\r\nimport Tool from \"./Tool\";\r\nconst urls = [];\r\nconst picMap = {};\r\nconst posMap = {};\r\nexport default async(url:any,type1:number, rows:number, cols:number,parent:engine.Container,inshowurl:string) => {\r\n try{\r\n let t:engine.Texture;\r\n if(type1==1){\r\n t = url;\r\n }else if(type1==2){\r\n let t1 = await loadImageByUrl(url);// as engine.Texture;\r\n if(t1){\r\n t = t1 as engine.Texture;\r\n }\r\n }else if(type1==3){\r\n inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n t = await getTextureByName(\"testimg\") as engine.Texture;\r\n }\r\n if(!t){\r\n inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n return qietu(\"testimg\",3,rows,cols,parent,inshowurl);\r\n }\r\n \r\n let setimgwid = 612;\r\n let mwid1 = setimgwid/rows;\r\n let mhei1 = setimgwid/cols;\r\n\r\n // let mwid = t.width;\r\n // let mhei = t.height;\r\n // if(mwid<10||mhei<10){\r\n // await new Promise(res=>{\r\n // setTimeout(function(){\r\n // res();\r\n // },200);\r\n // })\r\n // return qietu(t,1,rows,cols,parent);\r\n // }\r\n // if(mwid>mhei){\r\n // if(mhei<setimgwid){\r\n // mwid = mwid*setimgwid/mhei;\r\n // mhei = setimgwid;\r\n // }\r\n // }else{\r\n // if(mwid<setimgwid){\r\n // mhei = mhei*setimgwid/mwid;\r\n // mwid = setimgwid;\r\n // }\r\n // }\r\n\r\n let picarr = {};\r\n let picnames = [];\r\n\r\n let chax;\r\n let chay;\r\n let startlix = 0;\r\n let addlix = 1/rows;\r\n let startliy = 0;\r\n let addliy = 1/cols;\r\n\r\n let twid1 = setimgwid;\r\n let thei1 = setimgwid;\r\n // if(mwid>mhei){\r\n // chax = (mwid-mhei)/2;\r\n // startlix = chax/mwid;\r\n // addlix = (mhei/cols)/mwid;\r\n\r\n // startliy = 0;\r\n // addliy = 1/rows;\r\n\r\n // twid1 = mwid*setimgwid/mhei;\r\n // thei1 = setimgwid;\r\n // }else{\r\n // startlix = 0;\r\n // addlix = 1/cols;\r\n\r\n // chay = (mhei-mwid)/2;\r\n // startliy = chay/mhei;\r\n // addliy = (mwid/rows)/mhei;\r\n\r\n // thei1 = mhei*setimgwid/mwid;\r\n // twid1 = setimgwid;\r\n // }\r\n \r\n // console.log(\"切图准备\",startlix,addlix,startliy,addliy,mwid,mhei);\r\n // let txt1 = new engine.Label();\r\n // txt1.fillColor = \"red\";\r\n // txt1.size = 24;\r\n // txt1.text = startlix.toFixed(2)+\";\"+addlix.toFixed(2)+\";\"+startliy.toFixed(2)+\";\"+addliy.toFixed(2)+\";\"+mwid.toFixed(2)+\";\"+mhei.toFixed(2)+\";\"\r\n // parent.addChild(txt1);\r\n // txt1.y = -100;\r\n for(let r=0;r<rows;r++){\r\n let startx = startlix+addlix*r;\r\n let endx = startx + addlix;\r\n for(let c=0;c<cols;c++){\r\n let starty = startliy+addliy*c;\r\n let endy = starty+addliy;\r\n\r\n // let uvs = new Float32Array([\r\n // starty,\r\n // startx,\r\n // endy,\r\n // startx,\r\n // endy,\r\n // endx,\r\n // starty,\r\n // endx\r\n // ])\r\n //方案1\r\n // let isprite = new engine.Sprite(t);\r\n // isprite.uvs = uvs;\r\n\r\n //方案2\r\n let nsprite = Tool.getOnePic();\r\n let isprite = nsprite.getChildByName(\"iscrollv\");\r\n let nsp = isprite.getChildByName(\"isprite\");\r\n nsp.texture = t;\r\n\r\n nsp.width = twid1;\r\n nsp.height = thei1;\r\n\r\n // let nsprite = new engine.Container();\r\n\r\n // let isprite = new engine.ScrollView();\r\n // let nsp = new engine.Sprite(t);\r\n // isprite.addChild(nsp);\r\n // nsp.width = twid1;\r\n // nsp.height = thei1;\r\n\r\n // isprite.mouseEnabled = false;\r\n // isprite.mouseChildren = false;\r\n nsp.x = -starty*twid1;\r\n nsp.y = -startx*thei1;\r\n\r\n isprite.width = mwid1;\r\n isprite.height = mhei1;\r\n\r\n // nsprite.addChild(isprite);\r\n nsprite.width = mwid1;\r\n nsprite.height = mhei1;\r\n\r\n let ispritename = \"pic_\"+c+\"_\"+r;\r\n nsprite.name = ispritename;\r\n picarr[ispritename] = nsprite;\r\n picnames.push(ispritename);\r\n }\r\n }\r\n return {\r\n res:true,\r\n picarr:picarr,\r\n mwid:mwid1,\r\n mhei:mhei1,\r\n picnames:picnames,\r\n inshowurl:inshowurl\r\n };\r\n }catch(e){\r\n //获取那图失败\r\n\r\n // return {\r\n // res:false\r\n // };\r\n await new Promise(res=>{\r\n setTimeout(function(){\r\n res();\r\n },200);\r\n })\r\n inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n return qietu(\"testimg\",3,rows,cols,parent,inshowurl);\r\n }\r\n};\r\n","/**\r\n * Created by rockyl on 2018/8/16.\r\n */\r\n\r\nimport { props } from \"../props\";\r\nimport qietu from \"./qietu\";\r\nimport { getTexture, loadImageByUrl,getTextureByName } from \"./utils\";\r\nimport ObjectPool = engine.ObjectPool;\r\nimport Tool from \"./Tool\";\r\n\r\nexport default class GameView extends engine.Container {\r\n rows:number;\r\n cols:number;\r\n\r\n passtime:number;\r\n gametime:number;\r\n showtime:number;\r\n\r\n lastframetime:number;\r\n\r\n ingame:boolean = false;\r\n\r\n ticker;\r\n\r\n selectimg3:engine.Image;\r\n selectimg4:engine.Image;\r\n nselectimg:engine.Image;\r\n\r\n selectImgArr:Array<string> = [];\r\n sucposData:Object = {};\r\n\r\n dicont:engine.Container;\r\n linecont:engine.Container;\r\n blockcont:engine.Container;\r\n\r\n lineShape:engine.Shape;\r\n\r\n mwid:number;\r\n mhei:number;\r\n picnames:Array<string>;\r\n picarr;\r\n\r\n gameUrls:Array<string> = [];\r\n gameTimes:Array<number> = [];\r\n onegamePics:Array<any> = [];\r\n movesteps:number = 0;\r\n startime:number = 0;\r\n constructor() {\r\n super();\r\n this.once(engine.Event.ADDED_TO_STAGE, this.initScene, this);\r\n }\r\n initScene(){\r\n this.lineShape = new engine.Shape();\r\n this.selectimg3 = new engine.Image(getTextureByName(\"框3\"));\r\n this.selectimg4 = new engine.Image(getTextureByName(\"框4\"));\r\n this.selectimg3.mouseEnabled = false;\r\n this.selectimg4.mouseEnabled = false;\r\n //底图\r\n this.dicont = new engine.Container();\r\n //线\r\n this.linecont = new engine.Container();\r\n //亮片\r\n this.blockcont = new engine.Container();\r\n\r\n this.addChild(this.dicont);\r\n this.addChild(this.linecont);\r\n this.addChild(this.blockcont);\r\n \r\n this.linecont.addChild(this.lineShape);\r\n\r\n // console.log(\"拼图初始化完毕--------------\");\r\n engine.globalEvent.dispatchEvent(\"pictures-time-initcomp\",{});\r\n this.removeEventListener(engine.Event.ADDED_TO_STAGE,this.initScene,this);\r\n\r\n // let testsuc = new engine.Label();\r\n // testsuc.text = \"直接成功\";\r\n // testsuc.size = 66;\r\n // testsuc.fillColor = \"red\";\r\n // this.addChild(testsuc);\r\n // testsuc.y = 500;\r\n // testsuc.width = 300;\r\n // testsuc.height = 200;\r\n // testsuc.addEventListener(engine.MouseEvent.CLICK,this.zhijieSuc,this);\r\n }\r\n // //测试直接成功\r\n // zhijieSuc(){\r\n // this.gameover(1);\r\n // }\r\n\r\n async initgame(){\r\n // console.log(\"initgame---------\");\r\n this.gameUrls = props.gameUrls||[\"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/28.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/29.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/30.jpg\"];\r\n this.gameTimes = props.gameTimes||[30,60,60];\r\n \r\n this.onegamePics = new Array();\r\n for(let l=0;l<this.gameUrls.length;l++){\r\n let lurl = this.gameUrls[l];\r\n let lt = await loadImageByUrl(lurl);\r\n // console.log(lt);\r\n if(lt){\r\n lt = lt as engine.Texture\r\n }else{\r\n lt = null;\r\n }\r\n this.onegamePics.push(lt);\r\n if(this.onegamePics.length==1){//第一张图加载完毕,自动填充\r\n this.startfirst();\r\n }\r\n }\r\n this.removeSelectImg();\r\n }\r\n removeSelectImg(){\r\n if(this.selectimg3){\r\n this.blockcont.removeChild(this.selectimg3);\r\n }\r\n if(this.selectimg4){\r\n this.blockcont.removeChild(this.selectimg4);\r\n }\r\n }\r\n removeDiPics(){\r\n let nume = this.dicont.children.length;\r\n for(let i=nume-1;i>=0;i--){\r\n let ichild = this.dicont.getChildAt(i) as engine.Container;\r\n if(ichild){\r\n ichild.removeEventListener(engine.MouseEvent.MOUSE_DOWN,\r\n this.touchPic,this);\r\n this.dicont.removeChild(ichild);\r\n Tool.repushToPool(ichild);\r\n }\r\n }\r\n }\r\n async startfirst(){\r\n // this.dicont.removeChildren();\r\n this.removeDiPics();\r\n\r\n this.movesteps = 0;\r\n this.startime = Date.now();\r\n this.removeSelectImg();\r\n\r\n let actidx = 0;\r\n this.gametime = this.gameTimes[actidx];\r\n this.showtime = this.gameTimes[actidx];\r\n this.passtime = 0;\r\n engine.globalEvent.dispatchEvent(\"pictures-time-update\",{\r\n time:this.showtime,\r\n });\r\n engine.globalEvent.dispatchEvent(\"pictures-time-passtime\",{\r\n passtime:this.passtime\r\n });\r\n // console.log(\"start-----------------\",actidx);\r\n this.rows = 3;\r\n this.cols = 3;\r\n\r\n this.nselectimg = null;\r\n if(this.rows==3){\r\n this.nselectimg = this.selectimg3;\r\n }\r\n if(this.rows==4){\r\n this.nselectimg = this.selectimg4;\r\n }\r\n\r\n \r\n \r\n this.selectImgArr = new Array();\r\n this.sucposData = {};\r\n\r\n let tex:any = this.onegamePics[actidx];\r\n let type1 = 1;\r\n if(!tex){\r\n tex = this.gameUrls[actidx];\r\n type1 = 3;\r\n }\r\n let inshowurl = this.gameUrls[actidx];\r\n // type1 = 3;\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont,inshowurl);\r\n let res = result.res;\r\n if(res){\r\n let picarr = result.picarr;\r\n let mwid = result.mwid;\r\n let mhei = result.mhei;\r\n let picnames = result.picnames;\r\n\r\n let picurl = result.inshowurl;\r\n engine.globalEvent.dispatchEvent(\"pictures-showurl\",{\r\n picurl:picurl\r\n });\r\n // console.error(\"实际显示图片\",picurl);\r\n\r\n this.mwid = mwid;\r\n this.mhei = mhei;\r\n this.picarr = picarr;\r\n this.picnames = picnames;\r\n\r\n let gap = 2;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicx = mwid*c+gap;\r\n let ipicy = mhei*r+gap;\r\n let npicname = \"pic_\"+c+\"_\"+r;\r\n let ipic = picarr[npicname];\r\n this.dicont.addChild(ipic);\r\n ipic.x = ipicx;\r\n ipic.y = ipicy;\r\n }\r\n }\r\n //框线\r\n this.lineShape.clear();\r\n this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);\r\n\r\n this.lineShape.moveTo(0+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,0+gap);\r\n\r\n for(let rl=1;rl<this.rows;rl++){\r\n this.lineShape.moveTo(0+gap,rl*mhei+gap);\r\n this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);\r\n }\r\n for(let cl=1;cl<this.cols;cl++){\r\n this.lineShape.moveTo(cl*mwid+gap,0+gap);\r\n this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);\r\n }\r\n this.lineShape.endStroke();\r\n \r\n engine.globalEvent.dispatchEvent(\"pictures-load-complete\");\r\n this.ticker&&clearInterval(this.ticker);\r\n this.ticker = setInterval(this.update, 10);\r\n }else{\r\n console.error(\"图片处理失败\");\r\n }\r\n }\r\n async start() {\r\n \r\n // this.dicont.removeChildren();\r\n this.removeDiPics();\r\n this.movesteps = 0;\r\n this.startime = Date.now();\r\n this.removeSelectImg();\r\n\r\n let actidx = props.actidx;\r\n this.gametime = this.gameTimes[actidx];\r\n this.showtime = this.gameTimes[actidx];\r\n this.passtime = 0;\r\n engine.globalEvent.dispatchEvent(\"pictures-time-update\",{\r\n time:this.showtime,\r\n });\r\n engine.globalEvent.dispatchEvent(\"pictures-time-passtime\",{\r\n passtime:this.passtime\r\n });\r\n this.rows = props.rows;\r\n this.cols = props.cols;\r\n\r\n this.nselectimg = null;\r\n if(this.rows==3){\r\n this.nselectimg = this.selectimg3;\r\n }\r\n if(this.rows==4){\r\n this.nselectimg = this.selectimg4;\r\n }\r\n\r\n \r\n \r\n this.selectImgArr = new Array();\r\n this.sucposData = {};\r\n\r\n let tex:any = this.onegamePics[actidx];\r\n let type1 = 1;\r\n if(!tex){\r\n tex = this.gameUrls[actidx];\r\n type1 = 3;\r\n }\r\n let inshowurl = this.gameUrls[actidx];\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont,inshowurl);\r\n\r\n let res = result.res;\r\n if(res){\r\n let picarr = result.picarr;\r\n let mwid = result.mwid;\r\n let mhei = result.mhei;\r\n let picnames = result.picnames;\r\n\r\n let picurl = result.inshowurl;\r\n engine.globalEvent.dispatchEvent(\"pictures-showurl\",{\r\n picurl:picurl\r\n });\r\n // console.error(\"实际显示图片\",picurl);\r\n\r\n this.mwid = mwid;\r\n this.mhei = mhei;\r\n this.picarr = picarr;\r\n this.picnames = picnames;\r\n\r\n let gap = 2;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicx = mwid*c+gap;\r\n let ipicy = mhei*r+gap;\r\n let npicname = \"pic_\"+c+\"_\"+r;\r\n\r\n // this.sucposData[npicname] = r+\"_\"+c;\r\n\r\n // let selidx = Math.floor(Math.random()*picnames.length);\r\n // let ipicname:string = picnames[selidx];\r\n // if(r==c&&r!=this.rows-1){\r\n // while(ipicname==npicname){\r\n // selidx = Math.floor(Math.random()*picnames.length);\r\n // ipicname = picnames[selidx];\r\n // }\r\n // }\r\n let ipic = picarr[npicname];\r\n // picnames.splice(selidx,1);\r\n this.dicont.addChild(ipic);\r\n ipic.x = ipicx;\r\n ipic.y = ipicy;\r\n // ipic[\"postr\"] = r+\"_\"+c;\r\n\r\n // ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,\r\n // this.touchPic,this);\r\n }\r\n }\r\n //框线\r\n this.lineShape.clear();\r\n this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);\r\n\r\n this.lineShape.moveTo(0+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,0+gap);\r\n\r\n for(let rl=1;rl<this.rows;rl++){\r\n this.lineShape.moveTo(0+gap,rl*mhei+gap);\r\n this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);\r\n }\r\n for(let cl=1;cl<this.cols;cl++){\r\n this.lineShape.moveTo(cl*mwid+gap,0+gap);\r\n this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);\r\n }\r\n this.lineShape.endStroke();\r\n \r\n this.ticker&&clearInterval(this.ticker);\r\n this.ticker = setInterval(this.update, 10);\r\n }else{\r\n console.error(\"图片处理失败\");\r\n }\r\n }\r\n luanxu(){\r\n let gap = 2;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicx = this.mwid*c+gap;\r\n let ipicy = this.mhei*r+gap;\r\n let npicname = \"pic_\"+c+\"_\"+r;\r\n\r\n this.sucposData[npicname] = r+\"_\"+c;\r\n\r\n let selidx = Math.floor(Math.random()*this.picnames.length);\r\n let ipicname:string = this.picnames[selidx];\r\n if(r==c&&r!=this.rows-1){\r\n while(ipicname==npicname){\r\n selidx = Math.floor(Math.random()*this.picnames.length);\r\n ipicname = this.picnames[selidx];\r\n }\r\n }\r\n let ipic = this.picarr[ipicname];\r\n this.picnames.splice(selidx,1);\r\n ipic.x = ipicx;\r\n ipic.y = ipicy;\r\n ipic[\"postr\"] = r+\"_\"+c;\r\n\r\n ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,\r\n this.touchPic,this);\r\n }\r\n }\r\n }\r\n pause(){\r\n this.ingame = false;\r\n // console.error(\"拼图暂停\");\r\n }\r\n resume(){\r\n this.lastframetime = Date.now();\r\n this.ingame = true;\r\n // console.error(\"拼图继续\");\r\n }\r\n\r\n\r\n update() {\r\n let ntime = Date.now();\r\n if(!this.lastframetime){\r\n this.lastframetime = ntime;\r\n return;\r\n }\r\n if(this.ingame){\r\n let passtime = (ntime - this.lastframetime)/1000;\r\n this.passtime += passtime;\r\n engine.globalEvent.dispatchEvent(\"pictures-time-passtime\",{\r\n passtime:this.passtime\r\n });\r\n let showtime1 = Math.round(this.gametime - this.passtime);\r\n // console.log(passtime,this.passtime,this.gametime,this.showtime);\r\n if(this.showtime!=showtime1){\r\n this.showtime = showtime1;\r\n if(this.showtime<=0){\r\n this.showtime = 0;\r\n this.gameover(2);\r\n }\r\n // console.log(\"倒计时\",this.showtime);\r\n engine.globalEvent.dispatchEvent(\"pictures-time-update\",{\r\n time:this.showtime\r\n });\r\n }\r\n }\r\n this.lastframetime = ntime;\r\n }\r\n\r\n touchPic(e:engine.MouseEvent){\r\n if(!this.ingame){\r\n return;\r\n }\r\n // console.log(e.target.name);\r\n let selectname = e.target.name;\r\n let spx = e.target.x;\r\n let spy = e.target.y;\r\n let gap = 2;\r\n if(this.selectImgArr.length==0){\r\n if(this.nselectimg){\r\n this.blockcont.addChild(this.nselectimg);\r\n this.nselectimg.x = spx-gap;\r\n this.nselectimg.y = spy-gap;\r\n }\r\n this.selectImgArr.push(selectname);\r\n }else if(this.selectImgArr.length==1){\r\n if(selectname==this.selectImgArr[0]){\r\n if(this.nselectimg){\r\n this.blockcont.removeChild(this.nselectimg);\r\n }\r\n this.selectImgArr = new Array();\r\n return;\r\n }else{\r\n this.selectImgArr.push(selectname);\r\n this.changeImgPos();\r\n }\r\n }\r\n }\r\n changeImgPos(){\r\n let img1name = this.selectImgArr[0];\r\n let img2name = this.selectImgArr[1];\r\n\r\n let img1 = this.dicont.getChildByName(img1name);\r\n let img2 = this.dicont.getChildByName(img2name);\r\n\r\n let imgpos1x = img1.x;\r\n let imgpos1y = img1.y;\r\n let imgpos2x = img2.x;\r\n let imgpos2y = img2.y;\r\n\r\n let imgpostr1 = img1.postr;\r\n let imgpostr2 = img2.postr;\r\n\r\n img1.x = imgpos2x;\r\n img1.y = imgpos2y;\r\n img1.postr = imgpostr2;\r\n\r\n img2.x = imgpos1x;\r\n img2.y = imgpos1y;\r\n img2.postr = imgpostr1;\r\n\r\n this.selectImgArr = new Array();\r\n \r\n this.movesteps += 1;\r\n\r\n if(this.nselectimg){\r\n this.blockcont.removeChild(this.nselectimg);\r\n }\r\n let isuc = this.checkSuccess();\r\n if(isuc){\r\n // console.error(\"成功过关\");\r\n this.gameover(1);\r\n }\r\n }\r\n checkSuccess(){\r\n let isuc:boolean = true;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicname = \"pic_\"+c+\"_\"+r;\r\n let npicstr = r+\"_\"+c;\r\n let ipic = this.dicont.getChildByName(ipicname);\r\n let ipostr = ipic.postr;\r\n if(npicstr!=ipostr){\r\n isuc = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return isuc;\r\n\r\n }\r\n /**\r\n * \r\n * @param reason 1成功,2失败\r\n */\r\n private gameover(reason:number) {\r\n this.ingame = false;\r\n this.ticker&&clearInterval(this.ticker);\r\n\r\n let ntime = Date.now();\r\n let gametime = ntime - this.startime;\r\n engine.globalEvent.dispatchEvent('pictures-game-over', {\r\n reason:reason,\r\n time: this.passtime,\r\n number:this.movesteps,\r\n gametime:gametime\r\n });\r\n }\r\n\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\t// private _status;\r\n\tprivate _gameView: GameView;\r\n\r\n\r\n\r\n\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\t//创建实例\r\n\t\tthis._gameView = new GameView();\r\n\t\tthis.addChild(this._gameView);\r\n\r\n\t\tengine.globalEvent.addEventListener('pictures-initgame', this.initgame, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-start', this.start, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-luanxu', this.luanxu, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-pause', this.pause, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-resume', this.resume, this);\r\n\t}\r\n\tinitgame(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\r\n\t\t// this._status = 1;\r\n\r\n\t\tthis._gameView.initgame();\r\n\t}\r\n\tstart(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\r\n\t\t// this._status = 1;\r\n\r\n\t\tthis._gameView.start();\r\n\t}\r\n\tluanxu(){\r\n\t\tthis._gameView.luanxu();\r\n\t}\r\n\tpause(event: engine.Event) {\r\n\t\t\r\n\t\tthis._gameView.pause();\r\n\t}\r\n\tresume(event:engine.Event){\r\n\t\tthis._gameView.resume();\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\t\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;;;UCVe,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AAED,UAAgB,gBAAgB,CAAC,IAAI;KACpC,OAAO,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;AAED,UASsB,cAAc,CAAC,GAAG;;;aAEvC,IAAG;iBAEF,WAAO,IAAI,OAAO,CAAC,UAAC,OAAO;yBAC1B,IAAI,EAAE,GAAG,UAAU,CAAC;6BACnB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;0BACrB,EAAC,IAAI,CAAC,CAAC;yBAER,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;6BAC7B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C,KAAK,EAAE,CAAC;MACvB;KACD,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KACD,2BAAK,GAAL,UAAM,KAAmB;SAExB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KACD,4BAAM,GAAN,UAAO,KAAkB;SACxB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KACF,kBAAC;CAAD,CAAC,CA7CgC,MAAM,CAAC,SAAS,GA6ChD;;;iBC9CwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KAEjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/pintu/src/props.ts","src/custom/pintu/src/game/utils.ts","src/custom/pintu/src/game/Tool.ts","src/custom/pintu/src/game/qietu.ts","src/custom/pintu/src/game/GameView.ts","src/custom/pintu/src/game/GameWrapper.ts","src/custom/pintu/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 2020-01-21.\r\n */\r\n\r\nexport function getTexture(uuid) {\r\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\r\n}\r\n\r\nexport function getTextureByName(name) {\r\n\treturn getTexture(engine.getAssetByName(name).uuid);\r\n}\r\n\r\nexport function playSound(name) {\r\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\r\n}\r\nexport function createSvga(name, anchorName?) {\r\n\tlet inst = new svga.Svga();\r\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\r\n\treturn inst;\r\n}\r\n\r\nexport async function loadImageByUrl(url){\r\n\t// console.log('loadImageByUrl----------:',url);\r\n\ttry{\r\n\t\t// console.log(\"尝试加载44\");\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\tlet t1 = setTimeout(()=>{\r\n\t\t\t\treturn resolve(null);\r\n\t\t\t},2000);\r\n\r\n\t\t\tif (engine.TextureCache[url]) {\r\n\t\t\t\tclearTimeout(t1);\r\n\t\t\t\tresolve(engine.TextureCache[url])\r\n\t\t\t} else {\r\n\t\t\t\tvar t = engine.Texture.from(url);\r\n\t\t\t\tt.addEventListener(\"loaded\", () => { clearTimeout(t1);resolve(t) });\r\n\t\t\t}\r\n\t\t})\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}","export default class Tool{\r\n static picPool:Array<engine.Container> = new Array();\r\n static getOnePic(){\r\n if(this.picPool.length>0){\r\n return this.picPool.shift();\r\n }else{\r\n let ipic = new engine.Container();\r\n \r\n let isprite = new engine.ScrollView();\r\n isprite.name = \"iscrollv\";\r\n let nsp = new engine.Sprite();\r\n nsp.name = \"isprite\";\r\n nsp.texture\r\n\r\n isprite.addChild(nsp);\r\n\r\n ipic.addChild(isprite);\r\n\r\n isprite.mouseEnabled = false;\r\n nsp.mouseEnabled = false;\r\n\r\n return ipic;\r\n }\r\n }\r\n\r\n static repushToPool(icont:engine.Container){\r\n this.picPool.push(icont);\r\n }\r\n}","import { props } from \"../props\";\r\nimport { loadImageByUrl, getTextureByName ,getTexture} from \"./utils\";\r\nimport qietu from \"./qietu\";\r\nimport Tool from \"./Tool\";\r\nconst urls = [];\r\nconst picMap = {};\r\nconst posMap = {};\r\nexport default async(url:any,type1:number, rows:number, cols:number,parent:engine.Container,inshowurl:string) => {\r\n try{\r\n let t:engine.Texture;\r\n if(type1==1){\r\n t = url;\r\n }else if(type1==2){\r\n let t1 = await loadImageByUrl(url);// as engine.Texture;\r\n if(t1){\r\n t = t1 as engine.Texture;\r\n }\r\n }else if(type1==3){\r\n inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n t = await getTextureByName(\"testimg\") as engine.Texture;\r\n }\r\n if(!t){\r\n inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n return qietu(\"testimg\",3,rows,cols,parent,inshowurl);\r\n }\r\n \r\n let setimgwid = 612;\r\n let mwid1 = setimgwid/rows;\r\n let mhei1 = setimgwid/cols;\r\n\r\n // let mwid = t.width;\r\n // let mhei = t.height;\r\n // if(mwid<10||mhei<10){\r\n // await new Promise(res=>{\r\n // setTimeout(function(){\r\n // res();\r\n // },200);\r\n // })\r\n // return qietu(t,1,rows,cols,parent);\r\n // }\r\n // if(mwid>mhei){\r\n // if(mhei<setimgwid){\r\n // mwid = mwid*setimgwid/mhei;\r\n // mhei = setimgwid;\r\n // }\r\n // }else{\r\n // if(mwid<setimgwid){\r\n // mhei = mhei*setimgwid/mwid;\r\n // mwid = setimgwid;\r\n // }\r\n // }\r\n\r\n let picarr = {};\r\n let picnames = [];\r\n\r\n let chax;\r\n let chay;\r\n let startlix = 0;\r\n let addlix = 1/rows;\r\n let startliy = 0;\r\n let addliy = 1/cols;\r\n\r\n let twid1 = setimgwid;\r\n let thei1 = setimgwid;\r\n // if(mwid>mhei){\r\n // chax = (mwid-mhei)/2;\r\n // startlix = chax/mwid;\r\n // addlix = (mhei/cols)/mwid;\r\n\r\n // startliy = 0;\r\n // addliy = 1/rows;\r\n\r\n // twid1 = mwid*setimgwid/mhei;\r\n // thei1 = setimgwid;\r\n // }else{\r\n // startlix = 0;\r\n // addlix = 1/cols;\r\n\r\n // chay = (mhei-mwid)/2;\r\n // startliy = chay/mhei;\r\n // addliy = (mwid/rows)/mhei;\r\n\r\n // thei1 = mhei*setimgwid/mwid;\r\n // twid1 = setimgwid;\r\n // }\r\n \r\n // console.log(\"切图准备\",startlix,addlix,startliy,addliy,mwid,mhei);\r\n // let txt1 = new engine.Label();\r\n // txt1.fillColor = \"red\";\r\n // txt1.size = 24;\r\n // txt1.text = startlix.toFixed(2)+\";\"+addlix.toFixed(2)+\";\"+startliy.toFixed(2)+\";\"+addliy.toFixed(2)+\";\"+mwid.toFixed(2)+\";\"+mhei.toFixed(2)+\";\"\r\n // parent.addChild(txt1);\r\n // txt1.y = -100;\r\n for(let r=0;r<rows;r++){\r\n let startx = startlix+addlix*r;\r\n let endx = startx + addlix;\r\n for(let c=0;c<cols;c++){\r\n let starty = startliy+addliy*c;\r\n let endy = starty+addliy;\r\n\r\n // let uvs = new Float32Array([\r\n // starty,\r\n // startx,\r\n // endy,\r\n // startx,\r\n // endy,\r\n // endx,\r\n // starty,\r\n // endx\r\n // ])\r\n //方案1\r\n // let isprite = new engine.Sprite(t);\r\n // isprite.uvs = uvs;\r\n\r\n //方案2\r\n let nsprite = Tool.getOnePic();\r\n let isprite = nsprite.getChildByName(\"iscrollv\");\r\n let nsp = isprite.getChildByName(\"isprite\");\r\n nsp.texture = t;\r\n\r\n nsp.width = twid1;\r\n nsp.height = thei1;\r\n\r\n // let nsprite = new engine.Container();\r\n\r\n // let isprite = new engine.ScrollView();\r\n // let nsp = new engine.Sprite(t);\r\n // isprite.addChild(nsp);\r\n // nsp.width = twid1;\r\n // nsp.height = thei1;\r\n\r\n // isprite.mouseEnabled = false;\r\n // isprite.mouseChildren = false;\r\n nsp.x = -starty*twid1;\r\n nsp.y = -startx*thei1;\r\n\r\n isprite.width = mwid1;\r\n isprite.height = mhei1;\r\n\r\n // nsprite.addChild(isprite);\r\n nsprite.width = mwid1;\r\n nsprite.height = mhei1;\r\n\r\n let ispritename = \"pic_\"+c+\"_\"+r;\r\n nsprite.name = ispritename;\r\n picarr[ispritename] = nsprite;\r\n picnames.push(ispritename);\r\n }\r\n }\r\n return {\r\n res:true,\r\n picarr:picarr,\r\n mwid:mwid1,\r\n mhei:mhei1,\r\n picnames:picnames,\r\n inshowurl:inshowurl\r\n };\r\n }catch(e){\r\n //获取那图失败\r\n\r\n // return {\r\n // res:false\r\n // };\r\n await new Promise(res=>{\r\n setTimeout(function(){\r\n res();\r\n },200);\r\n })\r\n inshowurl = \"https://yun.duiba.com.cn/aurora/assets/2628186c60c3b80013ae3178ff21a73ffbe71d43.jpg\";\r\n return qietu(\"testimg\",3,rows,cols,parent,inshowurl);\r\n }\r\n};\r\n","/**\r\n * Created by rockyl on 2018/8/16.\r\n */\r\n\r\nimport { props } from \"../props\";\r\nimport qietu from \"./qietu\";\r\nimport { getTexture, loadImageByUrl,getTextureByName } from \"./utils\";\r\nimport ObjectPool = engine.ObjectPool;\r\nimport Tool from \"./Tool\";\r\n\r\nexport default class GameView extends engine.Container {\r\n rows:number;\r\n cols:number;\r\n\r\n passtime:number;\r\n gametime:number;\r\n showtime:number;\r\n\r\n lastframetime:number;\r\n\r\n ingame:boolean = false;\r\n\r\n ticker;\r\n\r\n selectimg3:engine.Image;\r\n selectimg4:engine.Image;\r\n nselectimg:engine.Image;\r\n\r\n selectImgArr:Array<string> = [];\r\n sucposData:Object = {};\r\n\r\n dicont:engine.Container;\r\n linecont:engine.Container;\r\n blockcont:engine.Container;\r\n\r\n lineShape:engine.Shape;\r\n\r\n mwid:number;\r\n mhei:number;\r\n picnames:Array<string>;\r\n picarr;\r\n\r\n gameUrls:Array<string> = [];\r\n gameTimes:Array<number> = [];\r\n onegamePics:Array<any> = [];\r\n movesteps:number = 0;\r\n startime:number = 0;\r\n constructor() {\r\n super();\r\n this.once(engine.Event.ADDED_TO_STAGE, this.initScene, this);\r\n }\r\n initScene(){\r\n this.lineShape = new engine.Shape();\r\n this.selectimg3 = new engine.Image(getTextureByName(\"框3\"));\r\n this.selectimg4 = new engine.Image(getTextureByName(\"框4\"));\r\n this.selectimg3.mouseEnabled = false;\r\n this.selectimg4.mouseEnabled = false;\r\n //底图\r\n this.dicont = new engine.Container();\r\n //线\r\n this.linecont = new engine.Container();\r\n //亮片\r\n this.blockcont = new engine.Container();\r\n\r\n this.addChild(this.dicont);\r\n this.addChild(this.linecont);\r\n this.addChild(this.blockcont);\r\n \r\n this.linecont.addChild(this.lineShape);\r\n\r\n // console.log(\"拼图初始化完毕--------------\");\r\n engine.globalEvent.dispatchEvent(\"pictures-time-initcomp\",{});\r\n this.removeEventListener(engine.Event.ADDED_TO_STAGE,this.initScene,this);\r\n\r\n // let testsuc = new engine.Label();\r\n // testsuc.text = \"直接成功\";\r\n // testsuc.size = 66;\r\n // testsuc.fillColor = \"red\";\r\n // this.addChild(testsuc);\r\n // testsuc.y = 500;\r\n // testsuc.width = 300;\r\n // testsuc.height = 200;\r\n // testsuc.addEventListener(engine.MouseEvent.CLICK,this.zhijieSuc,this);\r\n }\r\n // //测试直接成功\r\n // zhijieSuc(){\r\n // this.gameover(1);\r\n // }\r\n\r\n async initgame(){\r\n // console.log(\"initgame---------\");\r\n this.gameUrls = props.gameUrls||[\"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/28.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/29.jpg\", \"https://yun.duiba.com.cn/db_games/activity/game/1596074071/resource/assets/ptimgs/30.jpg\"];\r\n this.gameTimes = props.gameTimes||[30,60,60];\r\n \r\n this.onegamePics = new Array();\r\n for(let l=0;l<this.gameUrls.length;l++){\r\n let lurl = this.gameUrls[l];\r\n let lt = await loadImageByUrl(lurl);\r\n // console.log(lt);\r\n if(lt){\r\n lt = lt as engine.Texture\r\n }else{\r\n lt = null;\r\n }\r\n this.onegamePics.push(lt);\r\n if(this.onegamePics.length==1){//第一张图加载完毕,自动填充\r\n this.startfirst();\r\n }\r\n }\r\n this.removeSelectImg();\r\n }\r\n removeSelectImg(){\r\n if(this.selectimg3){\r\n this.blockcont.removeChild(this.selectimg3);\r\n }\r\n if(this.selectimg4){\r\n this.blockcont.removeChild(this.selectimg4);\r\n }\r\n }\r\n removeDiPics(){\r\n let nume = this.dicont.children.length;\r\n for(let i=nume-1;i>=0;i--){\r\n let ichild = this.dicont.getChildAt(i) as engine.Container;\r\n if(ichild){\r\n ichild.removeEventListener(engine.MouseEvent.MOUSE_DOWN,\r\n this.touchPic,this);\r\n this.dicont.removeChild(ichild);\r\n Tool.repushToPool(ichild);\r\n }\r\n }\r\n }\r\n async startfirst(){\r\n // this.dicont.removeChildren();\r\n this.removeDiPics();\r\n\r\n this.movesteps = 0;\r\n this.startime = Date.now();\r\n this.removeSelectImg();\r\n\r\n let actidx = 0;\r\n this.gametime = this.gameTimes[actidx];\r\n this.showtime = this.gameTimes[actidx];\r\n this.passtime = 0;\r\n engine.globalEvent.dispatchEvent(\"pictures-time-update\",{\r\n time:this.showtime,\r\n });\r\n engine.globalEvent.dispatchEvent(\"pictures-time-passtime\",{\r\n passtime:this.passtime\r\n });\r\n // console.log(\"start-----------------\",actidx);\r\n this.rows = 3;\r\n this.cols = 3;\r\n\r\n this.nselectimg = null;\r\n if(this.rows==3){\r\n this.nselectimg = this.selectimg3;\r\n }\r\n if(this.rows==4){\r\n this.nselectimg = this.selectimg4;\r\n }\r\n\r\n \r\n \r\n this.selectImgArr = new Array();\r\n this.sucposData = {};\r\n\r\n let tex:any = this.onegamePics[actidx];\r\n let type1 = 1;\r\n if(!tex){\r\n tex = this.gameUrls[actidx];\r\n type1 = 3;\r\n }\r\n let inshowurl = this.gameUrls[actidx];\r\n // type1 = 3;\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont,inshowurl);\r\n let res = result.res;\r\n if(res){\r\n let picarr = result.picarr;\r\n let mwid = result.mwid;\r\n let mhei = result.mhei;\r\n let picnames = result.picnames;\r\n\r\n let picurl = result.inshowurl;\r\n engine.globalEvent.dispatchEvent(\"pictures-showurl\",{\r\n picurl:picurl\r\n });\r\n // console.error(\"实际显示图片\",picurl);\r\n\r\n this.mwid = mwid;\r\n this.mhei = mhei;\r\n this.picarr = picarr;\r\n this.picnames = picnames;\r\n\r\n let gap = 2;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicx = mwid*c+gap;\r\n let ipicy = mhei*r+gap;\r\n let npicname = \"pic_\"+c+\"_\"+r;\r\n let ipic = picarr[npicname];\r\n this.dicont.addChild(ipic);\r\n ipic.x = ipicx;\r\n ipic.y = ipicy;\r\n }\r\n }\r\n //框线\r\n this.lineShape.clear();\r\n this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);\r\n\r\n this.lineShape.moveTo(0+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,0+gap);\r\n\r\n for(let rl=1;rl<this.rows;rl++){\r\n this.lineShape.moveTo(0+gap,rl*mhei+gap);\r\n this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);\r\n }\r\n for(let cl=1;cl<this.cols;cl++){\r\n this.lineShape.moveTo(cl*mwid+gap,0+gap);\r\n this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);\r\n }\r\n this.lineShape.endStroke();\r\n \r\n engine.globalEvent.dispatchEvent(\"pictures-load-complete\");\r\n this.ticker&&clearInterval(this.ticker);\r\n this.ticker = setInterval(this.update, 10);\r\n }else{\r\n console.error(\"图片处理失败\");\r\n }\r\n }\r\n async start() {\r\n \r\n // this.dicont.removeChildren();\r\n this.removeDiPics();\r\n this.movesteps = 0;\r\n this.startime = Date.now();\r\n this.removeSelectImg();\r\n\r\n let actidx = props.actidx;\r\n this.gametime = this.gameTimes[actidx];\r\n this.showtime = this.gameTimes[actidx];\r\n this.passtime = 0;\r\n engine.globalEvent.dispatchEvent(\"pictures-time-update\",{\r\n time:this.showtime,\r\n });\r\n engine.globalEvent.dispatchEvent(\"pictures-time-passtime\",{\r\n passtime:this.passtime\r\n });\r\n this.rows = props.rows;\r\n this.cols = props.cols;\r\n\r\n this.nselectimg = null;\r\n if(this.rows==3){\r\n this.nselectimg = this.selectimg3;\r\n }\r\n if(this.rows==4){\r\n this.nselectimg = this.selectimg4;\r\n }\r\n\r\n \r\n \r\n this.selectImgArr = new Array();\r\n this.sucposData = {};\r\n\r\n let tex:any = this.onegamePics[actidx];\r\n let type1 = 1;\r\n if(!tex){\r\n tex = this.gameUrls[actidx];\r\n type1 = 3;\r\n }\r\n let inshowurl = this.gameUrls[actidx];\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont,inshowurl);\r\n\r\n let res = result.res;\r\n if(res){\r\n let picarr = result.picarr;\r\n let mwid = result.mwid;\r\n let mhei = result.mhei;\r\n let picnames = result.picnames;\r\n\r\n let picurl = result.inshowurl;\r\n engine.globalEvent.dispatchEvent(\"pictures-showurl\",{\r\n picurl:picurl\r\n });\r\n // console.error(\"实际显示图片\",picurl);\r\n\r\n this.mwid = mwid;\r\n this.mhei = mhei;\r\n this.picarr = picarr;\r\n this.picnames = picnames;\r\n\r\n let gap = 2;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicx = mwid*c+gap;\r\n let ipicy = mhei*r+gap;\r\n let npicname = \"pic_\"+c+\"_\"+r;\r\n\r\n // this.sucposData[npicname] = r+\"_\"+c;\r\n\r\n // let selidx = Math.floor(Math.random()*picnames.length);\r\n // let ipicname:string = picnames[selidx];\r\n // if(r==c&&r!=this.rows-1){\r\n // while(ipicname==npicname){\r\n // selidx = Math.floor(Math.random()*picnames.length);\r\n // ipicname = picnames[selidx];\r\n // }\r\n // }\r\n let ipic = picarr[npicname];\r\n // picnames.splice(selidx,1);\r\n this.dicont.addChild(ipic);\r\n ipic.x = ipicx;\r\n ipic.y = ipicy;\r\n // ipic[\"postr\"] = r+\"_\"+c;\r\n\r\n // ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,\r\n // this.touchPic,this);\r\n }\r\n }\r\n //框线\r\n this.lineShape.clear();\r\n this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);\r\n\r\n this.lineShape.moveTo(0+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,0+gap);\r\n this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,mwid*this.rows+gap);\r\n this.lineShape.lineTo(0+gap,0+gap);\r\n\r\n for(let rl=1;rl<this.rows;rl++){\r\n this.lineShape.moveTo(0+gap,rl*mhei+gap);\r\n this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);\r\n }\r\n for(let cl=1;cl<this.cols;cl++){\r\n this.lineShape.moveTo(cl*mwid+gap,0+gap);\r\n this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);\r\n }\r\n this.lineShape.endStroke();\r\n \r\n this.ticker&&clearInterval(this.ticker);\r\n this.ticker = setInterval(this.update, 10);\r\n }else{\r\n console.error(\"图片处理失败\");\r\n }\r\n }\r\n luanxu(){\r\n let gap = 2;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicx = this.mwid*c+gap;\r\n let ipicy = this.mhei*r+gap;\r\n let npicname = \"pic_\"+c+\"_\"+r;\r\n\r\n this.sucposData[npicname] = r+\"_\"+c;\r\n\r\n let selidx = Math.floor(Math.random()*this.picnames.length);\r\n let ipicname:string = this.picnames[selidx];\r\n if(r==c&&r!=this.rows-1){\r\n while(ipicname==npicname){\r\n selidx = Math.floor(Math.random()*this.picnames.length);\r\n ipicname = this.picnames[selidx];\r\n }\r\n }\r\n let ipic = this.picarr[ipicname];\r\n this.picnames.splice(selidx,1);\r\n ipic.x = ipicx;\r\n ipic.y = ipicy;\r\n ipic[\"postr\"] = r+\"_\"+c;\r\n\r\n ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,\r\n this.touchPic,this);\r\n }\r\n }\r\n }\r\n pause(){\r\n this.ingame = false;\r\n // console.error(\"拼图暂停\");\r\n }\r\n resume(){\r\n this.lastframetime = Date.now();\r\n this.ingame = true;\r\n // console.error(\"拼图继续\");\r\n }\r\n\r\n\r\n update() {\r\n let ntime = Date.now();\r\n if(!this.lastframetime){\r\n this.lastframetime = ntime;\r\n return;\r\n }\r\n if(this.ingame){\r\n let passtime = (ntime - this.lastframetime)/1000;\r\n this.passtime += passtime;\r\n engine.globalEvent.dispatchEvent(\"pictures-time-passtime\",{\r\n passtime:this.passtime\r\n });\r\n let showtime1 = Math.round(this.gametime - this.passtime);\r\n // console.log(passtime,this.passtime,this.gametime,this.showtime);\r\n if(this.showtime!=showtime1){\r\n this.showtime = showtime1;\r\n if(this.showtime<=0){\r\n this.showtime = 0;\r\n this.gameover(2);\r\n }\r\n // console.log(\"倒计时\",this.showtime);\r\n engine.globalEvent.dispatchEvent(\"pictures-time-update\",{\r\n time:this.showtime\r\n });\r\n }\r\n }\r\n this.lastframetime = ntime;\r\n }\r\n\r\n touchPic(e:engine.MouseEvent){\r\n if(!this.ingame){\r\n return;\r\n }\r\n // console.log(e.target.name);\r\n let selectname = e.target.name;\r\n let spx = e.target.x;\r\n let spy = e.target.y;\r\n let gap = 2;\r\n if(this.selectImgArr.length==0){\r\n if(this.nselectimg){\r\n this.blockcont.addChild(this.nselectimg);\r\n this.nselectimg.x = spx-gap;\r\n this.nselectimg.y = spy-gap;\r\n }\r\n this.selectImgArr.push(selectname);\r\n }else if(this.selectImgArr.length==1){\r\n if(selectname==this.selectImgArr[0]){\r\n if(this.nselectimg){\r\n this.blockcont.removeChild(this.nselectimg);\r\n }\r\n this.selectImgArr = new Array();\r\n return;\r\n }else{\r\n this.selectImgArr.push(selectname);\r\n this.changeImgPos();\r\n }\r\n }\r\n }\r\n changeImgPos(){\r\n let img1name = this.selectImgArr[0];\r\n let img2name = this.selectImgArr[1];\r\n\r\n let img1 = this.dicont.getChildByName(img1name);\r\n let img2 = this.dicont.getChildByName(img2name);\r\n\r\n let imgpos1x = img1.x;\r\n let imgpos1y = img1.y;\r\n let imgpos2x = img2.x;\r\n let imgpos2y = img2.y;\r\n\r\n let imgpostr1 = img1.postr;\r\n let imgpostr2 = img2.postr;\r\n\r\n img1.x = imgpos2x;\r\n img1.y = imgpos2y;\r\n img1.postr = imgpostr2;\r\n\r\n img2.x = imgpos1x;\r\n img2.y = imgpos1y;\r\n img2.postr = imgpostr1;\r\n\r\n this.selectImgArr = new Array();\r\n \r\n this.movesteps += 1;\r\n\r\n if(this.nselectimg){\r\n this.blockcont.removeChild(this.nselectimg);\r\n }\r\n let isuc = this.checkSuccess();\r\n if(isuc){\r\n // console.error(\"成功过关\");\r\n this.gameover(1);\r\n }\r\n }\r\n checkSuccess(){\r\n let isuc:boolean = true;\r\n for(let r=0;r<this.rows;r++){\r\n for(let c=0;c<this.cols;c++){\r\n let ipicname = \"pic_\"+c+\"_\"+r;\r\n let npicstr = r+\"_\"+c;\r\n let ipic = this.dicont.getChildByName(ipicname);\r\n let ipostr = ipic.postr;\r\n if(npicstr!=ipostr){\r\n isuc = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return isuc;\r\n\r\n }\r\n /**\r\n * \r\n * @param reason 1成功,2失败\r\n */\r\n private gameover(reason:number) {\r\n this.ingame = false;\r\n this.ticker&&clearInterval(this.ticker);\r\n\r\n let ntime = Date.now();\r\n let gametime = ntime - this.startime;\r\n engine.globalEvent.dispatchEvent('pictures-game-over', {\r\n reason:reason,\r\n time: this.passtime,\r\n number:this.movesteps,\r\n gametime:gametime\r\n });\r\n }\r\n\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\t// private _status;\r\n\tprivate _gameView: GameView;\r\n\r\n\r\n\r\n\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\t//创建实例\r\n\t\tthis._gameView = new GameView();\r\n\t\tthis.addChild(this._gameView);\r\n\r\n\t\tengine.globalEvent.addEventListener('pictures-initgame', this.initgame, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-start', this.start, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-luanxu', this.luanxu, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-pause', this.pause, this);\r\n\t\tengine.globalEvent.addEventListener('pictures-resume', this.resume, this);\r\n\t}\r\n\tinitgame(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\r\n\t\t// this._status = 1;\r\n\r\n\t\tthis._gameView.initgame();\r\n\t}\r\n\tstart(event: engine.Event) {\r\n\t\tinjectProps(event.data);\r\n\r\n\t\t// this._status = 1;\r\n\r\n\t\tthis._gameView.start();\r\n\t}\r\n\tluanxu(){\r\n\t\tthis._gameView.luanxu();\r\n\t}\r\n\tpause(event: engine.Event) {\r\n\t\t\r\n\t\tthis._gameView.pause();\r\n\t}\r\n\tresume(event:engine.Event){\r\n\t\tthis._gameView.resume();\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\t\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;;UCVe,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CA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,CAAC,gBAAgB,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,CAAC;SACxE,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,KAAI,CAAC,MAAM,EAAE,KAAI,CAAC,CAAC;;MAC1E;KACD,8BAAQ,GAAR,UAAS,KAAmB;SAC3B,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAIxB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;MAC1B;KACD,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAIxB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KACD,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KACD,2BAAK,GAAL,UAAM,KAAmB;SAExB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KACD,4BAAM,GAAN,UAAO,KAAkB;SACxB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KACF,kBAAC;CAAD,CAAC,CA7CgC,MAAM,CAAC,SAAS,GA6ChD;;iBC9CwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KAEjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;"}
\ No newline at end of file
......@@ -505,6 +505,7 @@
_this._seq = 1;
_this.sptime = Date.now();
_this.useBoom = false;
_this.haveffect = true;
_this._score = 0;
_this.inEliminate = false;
_this.newSelect = false;
......@@ -627,14 +628,17 @@
};
GameView.prototype.playComp = function () {
};
GameView.prototype.init = function (time, level, mode, mute) {
GameView.prototype.init = function (time, level, mode, mute, haveffect) {
if (mute === void 0) { mute = 1; }
if (haveffect === void 0) { haveffect = true; }
this.score = 0;
this.gametime = time;
this.seq = 1;
this.level = level;
this.ingameover = false;
this.mute = mute;
this.haveffect = haveffect;
console.log("动效播放", haveffect);
this.changeHomeShow(mode);
this.initContainer();
this.sptime = Date.now();
......@@ -1215,11 +1219,13 @@
_this.container.removeChild(rcele);
MapData.recoverEle(rcele, rcetype);
});
var oneffect = this.getOneEffect();
oneffect.x = rcelex;
oneffect.y = rceley;
this.anicontainer.addChild(oneffect);
oneffect.play(1);
if ((this.haveffect + "") == "true") {
var oneffect = this.getOneEffect();
oneffect.x = rcelex;
oneffect.y = rceley;
this.anicontainer.addChild(oneffect);
oneffect.play(1);
}
};
GameView.prototype.goDisplayAni = function (ielitype, ielix, ieliy) {
var _this = this;
......@@ -2033,7 +2039,8 @@
var level = event.data.level;
var mode = event.data.mode;
var mute = event.data.mute;
this._gameView.init(time, level, mode, mute);
var playeffect = event.data.playeffect;
this._gameView.init(time, level, mode, mute, playeffect);
};
GameWrapper.prototype.reset = function (event) {
var time = event.data.time;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -292,14 +292,16 @@ export default class GameView extends engine.Container {
// this.homeimgday.stop(1);
// this.homeimgnight.stop(1);
}
init(time,level,mode,mute=1){
haveffect = true;
init(time,level,mode,mute=1,haveffect=true){
this.score = 0;
this.gametime = time;
this.seq = 1;
this.level = level;
this.ingameover = false;
this.mute = mute;
this.haveffect = haveffect;
console.log("动效播放",haveffect);
this.changeHomeShow(mode);
this.initContainer();
......@@ -960,11 +962,13 @@ export default class GameView extends engine.Container {
MapData.recoverEle(rcele,rcetype);
})
let oneffect = this.getOneEffect();
oneffect.x = rcelex;
oneffect.y = rceley;
this.anicontainer.addChild(oneffect);
oneffect.play(1);
if((this.haveffect+"")=="true"){
let oneffect = this.getOneEffect();
oneffect.x = rcelex;
oneffect.y = rceley;
this.anicontainer.addChild(oneffect);
oneffect.play(1);
}
}
//原地消失
goDisplayAni(ielitype,ielix,ieliy){
......
......@@ -30,7 +30,8 @@ export class GameWrapper extends engine.Container {
let level = event.data.level;
let mode = event.data.mode;
let mute = event.data.mute;
this._gameView.init(time,level,mode,mute);
let playeffect = event.data.playeffect;
this._gameView.init(time,level,mode,mute,playeffect);
}
reset(event:engine.Event){
// console.log("gamewrapper-reset",event);
......
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