Commit 29b14f01 authored by zjz1994's avatar zjz1994

代码暂存

parent 4efdedb5
......@@ -177,6 +177,12 @@
"url": "//yun.duiba.com.cn/aurora/assets/57ad75aa036c04e13abcf32c464ff5ae37419495",
"uuid": "xiache",
"ext": ".svga"
},
{
"name": "ganzi",
"url": "//yun.duiba.com.cn/aurora/assets/501972d5960c29b7db1e476422e6fd3cb3a92c8f.png",
"uuid": "ganzi",
"ext": ".png"
}
],
"events": {
......@@ -218,9 +224,15 @@
"data": {
"score": 0
}
},
"bjxd-game-inmove": {
"alias": "游戏进行状态",
"data": {
"canstop": false
}
}
}
},
"id": "bjxd-game",
"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['bjxd-game'] = factory(global.tslib));\n}(this, (function (tslib) { 'use strict';\n\n\tvar props = {};\r\n\tfunction prepareProps() {\r\n\t var metaProps = getProps();\r\n\t engine.injectProp(props, metaProps);\r\n\t}\r\n\tfunction injectProps(p) {\r\n\t engine.injectProp(props, p);\r\n\t}\r\n\t//# sourceMappingURL=props.js.map\n\n\tvar ObjectPool = engine.ObjectPool;\r\n\tvar Road = (function (_super) {\r\n\t tslib.__extends(Road, _super);\r\n\t function Road() {\r\n\t return _super !== null && _super.apply(this, arguments) || this;\r\n\t }\r\n\t Road.prototype.setup = function () {\r\n\t this.lastPos = 0;\r\n\t this.addPier();\r\n\t };\r\n\t Road.prototype.getFristPier = function () {\r\n\t return this.getChildAt(0).width;\r\n\t };\r\n\t Road.prototype.getDistance = function () {\r\n\t var distance = [];\r\n\t var pier1 = this.getChildAt(0);\r\n\t var pier2 = this.getChildAt(1);\r\n\t distance.push(pier2.x - pier1.x);\r\n\t distance.push(pier2.width);\r\n\t return distance;\r\n\t };\r\n\t Road.prototype.addPier = function () {\r\n\t while (this.children.length < props.pierCount + 1) {\r\n\t var childrenNum = this.children.length;\r\n\t var randomPos = this.makeRandomFloat(props.pierMaxDistance, props.pierMinDistance);\r\n\t var pier = ObjectPool.getObject('pier');\r\n\t this.addChild(pier);\r\n\t pier.changeBg();\r\n\t if (childrenNum == 0) {\r\n\t pier.x = 0;\r\n\t }\r\n\t else {\r\n\t pier.x = this.lastPos + randomPos;\r\n\t }\r\n\t this.lastPos = pier.x;\r\n\t }\r\n\t };\r\n\t Road.prototype.changeBg = function () {\r\n\t var nume = this.children.length;\r\n\t for (var i = 0; i < nume; i++) {\r\n\t var ipier = this.getChildAt(i);\r\n\t ipier.changeBg();\r\n\t }\r\n\t };\r\n\t Road.prototype.moveAddPier = function () {\r\n\t var randomPos = this.makeRandomFloat(props.pierMaxDistance, props.pierMinDistance);\r\n\t var pier = ObjectPool.getObject('pier');\r\n\t var lastChild = this.getChildAt(this.children.length - 1);\r\n\t pier.x = lastChild.x + randomPos;\r\n\t this.addChild(pier);\r\n\t pier.changeBg();\r\n\t };\r\n\t Road.prototype.makeRandomFloat = function (max, min) {\r\n\t if (min === void 0) { min = 0; }\r\n\t return Math.random() * (max - min) + min;\r\n\t };\r\n\t Road.prototype.setViewport = function () {\r\n\t var _this = this;\r\n\t var tmpMovepos = this.getMovePos();\r\n\t this.children.forEach(function (item, index) {\r\n\t _this.playTween(item, index, tmpMovepos);\r\n\t });\r\n\t };\r\n\t Road.prototype.getMovePos = function () {\r\n\t var movePos = this.getChildAt(1);\r\n\t return movePos.x;\r\n\t };\r\n\t Road.prototype.playTween = function (item, index, tmpMovepos) {\r\n\t var _this = this;\r\n\t engine.Tween.get(item, { loop: false })\r\n\t .to({ x: item.x - tmpMovepos }, props.pierMoveTime)\r\n\t .call(function () {\r\n\t if (_this.getChildIndex(item) == 0) {\r\n\t engine.Tween.removeTweens(item);\r\n\t _this.removeChild(item);\r\n\t ObjectPool.recycleObject('pier', item);\r\n\t }\r\n\t if (index == 0) {\r\n\t _this.moveAddPier();\r\n\t }\r\n\t });\r\n\t };\r\n\t Road.prototype.getStartGold = function (index, isClose) {\r\n\t if (isClose === void 0) { isClose = true; }\r\n\t var tmpNode = this.getChildAt(index);\r\n\t var haveGold = tmpNode.haveGold;\r\n\t if (haveGold && isClose) {\r\n\t tmpNode.closeGold();\r\n\t }\r\n\t return haveGold;\r\n\t };\r\n\t Road.prototype.setGuide = function () {\r\n\t var tmpNode = this.getChildAt(1);\r\n\t if (!tmpNode.haveGold) {\r\n\t tmpNode.children.forEach(function (item) {\r\n\t if (item.name == 'gold') {\r\n\t item.visible = true;\r\n\t }\r\n\t });\r\n\t tmpNode.haveGold = true;\r\n\t }\r\n\t };\r\n\t return Road;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Road.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 getStage() {\r\n\t return engine.gameStage.stage;\r\n\t}\r\n\tfunction createSvga(name) {\r\n\t var inst = new svga.Svga();\r\n\t inst.source = engine.getAssetByName(name).uuid;\r\n\t return inst;\r\n\t}\r\n\t//# sourceMappingURL=utils.js.map\n\n\tvar GuideLayer = (function (_super) {\r\n\t tslib.__extends(GuideLayer, _super);\r\n\t function GuideLayer() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.setup();\r\n\t return _this;\r\n\t }\r\n\t GuideLayer.prototype.setup = function () {\r\n\t };\r\n\t GuideLayer.prototype.show = function (id, options, callback) {\r\n\t this.visible = true;\r\n\t this._callBack = callback ? callback : null;\r\n\t if (!this.guideMask) {\r\n\t var _a = this.stage, width = _a.width, height = _a.height;\r\n\t this.guideMask = new engine.Container();\r\n\t this.addChild(this.guideMask);\r\n\t this.guideImg = new engine.Image();\r\n\t this.guideMask.addChild(this.guideImg);\r\n\t this.shouzhi = new engine.Image(getTextureByName(\"shouzhi\"));\r\n\t this.guideMask.addChild(this.shouzhi);\r\n\t }\r\n\t this.guideImg.texture = getTextureByName(\"yindao\" + id);\r\n\t this.guideStep(id);\r\n\t this.once(engine.MouseEvent.CLICK, function () {\r\n\t this.visible = false;\r\n\t if (this._callBack) {\r\n\t this._callBack();\r\n\t }\r\n\t }, this);\r\n\t };\r\n\t GuideLayer.prototype.guideStep = function (id) {\r\n\t if (id == 1) {\r\n\t this.shouzhi.x = 244;\r\n\t this.shouzhi.y = 812;\r\n\t }\r\n\t if (id == 2) {\r\n\t this.shouzhi.x = 346;\r\n\t this.shouzhi.y = 1108;\r\n\t }\r\n\t };\r\n\t return GuideLayer;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=GuideLayer.js.map\n\n\tvar LoopComponent = (function (_super) {\r\n\t tslib.__extends(LoopComponent, _super);\r\n\t function LoopComponent() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.onceInfo = { width: 0, height: 0, count: 0 };\r\n\t _this.loopInfo = { width: 0, height: 0, count: 0 };\r\n\t _this.parts = [];\r\n\t return _this;\r\n\t }\r\n\t LoopComponent.prototype.setup = function (parts, info) {\r\n\t var _this = this;\r\n\t parts.forEach(function (item, index) {\r\n\t var part;\r\n\t if (typeof item == 'string') {\r\n\t if (item.length > 0) {\r\n\t part = new engine.Sprite(getTextureByName(item));\r\n\t }\r\n\t else {\r\n\t part = new engine.Sprite();\r\n\t }\r\n\t }\r\n\t else if (item instanceof engine.Texture) {\r\n\t part = new engine.Sprite(item);\r\n\t }\r\n\t else {\r\n\t part = item;\r\n\t }\r\n\t _this.addChild(part);\r\n\t _this.parts.push(part);\r\n\t if (index == 0) {\r\n\t info.width = part.width;\r\n\t info.height = part.height;\r\n\t }\r\n\t });\r\n\t info.count = parts.length;\r\n\t this.setViewport(0, 0);\r\n\t };\r\n\t LoopComponent.prototype.changeBg = function (changName) {\r\n\t this.parts.forEach(function (item, index) {\r\n\t if (changName && changName.length > 0) {\r\n\t item.texture = getTextureByName(changName);\r\n\t }\r\n\t });\r\n\t };\r\n\t LoopComponent.prototype.setupLoop = function (resArr) {\r\n\t this.setup(resArr, this.loopInfo);\r\n\t };\r\n\t LoopComponent.prototype.setViewport = function (x, y) {\r\n\t if (y === void 0) { y = 0; }\r\n\t var sizeField = y == 0 ? 'width' : 'height';\r\n\t var posField = y == 0 ? 'x' : 'y';\r\n\t var pos = y == 0 ? x : y;\r\n\t var index;\r\n\t var onceSize = this.onceInfo[sizeField];\r\n\t var onceCount = this.onceInfo.count;\r\n\t var loopCount = this.loopInfo.count;\r\n\t var loopSize = this.loopInfo[sizeField];\r\n\t index = onceSize == 0 ? -1 : Math.floor(pos / onceSize);\r\n\t if (index < 0 || index >= onceCount) {\r\n\t var loopIndex = Math.floor((pos - onceCount * onceSize) / this.loopInfo[sizeField]);\r\n\t index = onceCount + loopIndex;\r\n\t }\r\n\t var formerIndex = index < onceCount ? index : (index) % loopCount + onceCount;\r\n\t var latterIndex = index < onceCount ? index + 1 : (index - onceCount + 1) % loopCount + onceCount;\r\n\t var former = this.parts[formerIndex];\r\n\t var latter = this.parts[latterIndex];\r\n\t if (!former || !latter) {\r\n\t console.log(formerIndex, latterIndex);\r\n\t }\r\n\t former[posField] = -(pos - loopSize * (index < onceCount ? index : index - onceCount) - (index < onceCount ? 0 : onceCount * onceSize));\r\n\t latter[posField] = former.x + (index < onceCount ? onceSize : loopSize);\r\n\t };\r\n\t return LoopComponent;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=LoopComponent.js.map\n\n\tvar Background = (function (_super) {\r\n\t tslib.__extends(Background, _super);\r\n\t function Background() {\r\n\t var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\t _this.partResHHL = ['bg1', ''];\r\n\t _this.partResHB = ['bg2', ''];\r\n\t _this.partResWH = ['bg3', ''];\r\n\t _this.speeds = [];\r\n\t _this.resArray = [];\r\n\t _this.frameMovePos = 0;\r\n\t return _this;\r\n\t }\r\n\t Background.prototype.initBg = function () {\r\n\t this.sumMovePos = 0;\r\n\t this.speeds.push(props.afterBGMoveSpeed);\r\n\t this.speeds.push(props.frontBGMoveSpeed);\r\n\t var bottomBg = new engine.Rect();\r\n\t bottomBg.x = 0;\r\n\t bottomBg.y = 0;\r\n\t bottomBg.width = getStage().width;\r\n\t bottomBg.height = 0;\r\n\t bottomBg.fillColor = 0x75c9f5;\r\n\t this.addChild(bottomBg);\r\n\t this.resArray.push(this.partResHHL);\r\n\t this.resArray.push(this.partResHB);\r\n\t this.resArray.push(this.partResWH);\r\n\t var parts = [];\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var part = new LoopComponent();\r\n\t part.setupLoop([\r\n\t this.resArray[0][i],\r\n\t this.resArray[0][i],\r\n\t ]);\r\n\t parts.push(part);\r\n\t this.addChild(part);\r\n\t }\r\n\t parts[1].y = 200;\r\n\t };\r\n\t Background.prototype.setViewport = function (pos) {\r\n\t this.needFrameSum = (props.pierMoveTime / 1000) * 60;\r\n\t this.frameMovePos = pos / this.needFrameSum;\r\n\t this.frameIndex = 0;\r\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.frameBack, this);\r\n\t };\r\n\t Background.prototype.frameBack = function () {\r\n\t if (this.frameIndex < this.needFrameSum) {\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var part = this.getChildAt(i + 1);\r\n\t var speed = this.speeds[i];\r\n\t var tmpPos = ((this.frameMovePos * this.frameIndex) + this.sumMovePos) * speed;\r\n\t part.setViewport(tmpPos);\r\n\t }\r\n\t this.frameIndex++;\r\n\t }\r\n\t else {\r\n\t this.sumMovePos += this.frameMovePos * this.needFrameSum;\r\n\t this.frameIndex = 0;\r\n\t this.removeEventListener(engine.Event.ENTER_FRAME, this.frameBack, this);\r\n\t }\r\n\t };\r\n\t Background.prototype.changeBg = function (index) {\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var part = this.getChildAt(i + 1);\r\n\t part.changeBg(this.resArray[index][i]);\r\n\t if (i == 1 && index == 1) {\r\n\t part.y = 400;\r\n\t }\r\n\t if (i == 1 && index == 2) {\r\n\t part.y = 250;\r\n\t }\r\n\t }\r\n\t };\r\n\t return Background;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Background.js.map\n\n\tvar Pier = (function (_super) {\r\n\t tslib.__extends(Pier, _super);\r\n\t function Pier() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.part1tex = \"zhuzi1\";\r\n\t _this.part2tex = \"zhuzi2\";\r\n\t _this.part3tex = \"zhuzi3\";\r\n\t _this.texname = \"\";\r\n\t _this.zhuy = 1006;\r\n\t _this.bmp = new engine.Sprite();\r\n\t _this.addChild(_this.bmp);\r\n\t return _this;\r\n\t }\r\n\t Pier.prototype.init = function () {\r\n\t var bmp = this.bmp;\r\n\t bmp.alpha = 1;\r\n\t this.changeBg();\r\n\t bmp.x = 0;\r\n\t bmp.y = this.zhuy;\r\n\t };\r\n\t Pier.prototype.changeBg = function () {\r\n\t var texstr;\r\n\t if (GameView.bgIndex == 0) {\r\n\t texstr = this.part1tex;\r\n\t }\r\n\t else if (GameView.bgIndex == 1) {\r\n\t texstr = this.part2tex;\r\n\t }\r\n\t else {\r\n\t texstr = this.part3tex;\r\n\t }\r\n\t if (this.texname != texstr) {\r\n\t this.texname = texstr;\r\n\t this.bmp.texture = getTextureByName(texstr);\r\n\t }\r\n\t };\r\n\t Pier.prototype.setShowGold = function () {\r\n\t var nodeGold = this.getChildByName('gold');\r\n\t var randomWard = Math.random();\r\n\t nodeGold.alpha = 1;\r\n\t var isShow = randomWard < props.reward ? true : false;\r\n\t nodeGold.visible = isShow;\r\n\t this.haveGold = isShow;\r\n\t };\r\n\t Pier.prototype.setGoldPosX = function (bmp) {\r\n\t var nodeGold = this.getChildByName('gold');\r\n\t var pos = bmp.width / 2 - nodeGold.width / 2;\r\n\t nodeGold.x = pos;\r\n\t nodeGold.y = this.zhuy - nodeGold.height - 50;\r\n\t nodeGold.visible = false;\r\n\t };\r\n\t Pier.prototype.closeGold = function () {\r\n\t var _this = this;\r\n\t this.children.forEach(function (item) {\r\n\t if (item.name == 'gold') {\r\n\t item.anchorX = item.width / 2;\r\n\t item.anchorY = item.height / 2;\r\n\t engine.Tween.get(item, { loop: false })\r\n\t .to({ scaleX: 2.5, scaleY: 2.5 }, 200, engine.Ease.cubicOut)\r\n\t .to({ scaleX: 1, scaleY: 1, alpha: 0 }, 200, engine.Ease.cubicIn)\r\n\t .call(function () {\r\n\t item.visible = false;\r\n\t _this.haveGold = false;\r\n\t });\r\n\t }\r\n\t });\r\n\t };\r\n\t return Pier;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Pier.js.map\n\n\tvar Player = (function (_super) {\r\n\t tslib.__extends(Player, _super);\r\n\t function Player() {\r\n\t var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\t _this.playery = 878;\r\n\t return _this;\r\n\t }\r\n\t Player.prototype.initPlayer = function (pierWidth) {\r\n\t this.pierWidth = pierWidth;\r\n\t this._container = new engine.Container();\r\n\t this.addChild(this._container);\r\n\t this.playerNode = createSvga('walk');\r\n\t this._container.addChild(this.playerNode);\r\n\t this.playerNode.y = this.playery;\r\n\t this.playerNode.x = pierWidth / 2 - 50;\r\n\t this.playerNode.play();\r\n\t this._container.visible = false;\r\n\t };\r\n\t Player.prototype.revive = function () {\r\n\t this._container.x = 0;\r\n\t this._container.y = 0;\r\n\t this.playerNode.x = this.pierWidth / 2 - 50;\r\n\t this.playerNode.y = this.playery;\r\n\t };\r\n\t Player.prototype.setViewport = function (pos, callBack, pierWidth) {\r\n\t var tmpPos = 0;\r\n\t var isSuccess = false;\r\n\t if (!pierWidth) {\r\n\t tmpPos = pos;\r\n\t isSuccess = true;\r\n\t }\r\n\t else {\r\n\t tmpPos = pierWidth - this.playerNode.x + pos - 60;\r\n\t }\r\n\t this.playGoTween(tmpPos, callBack, isSuccess);\r\n\t };\r\n\t Player.prototype.playGoTween = function (pos, callBack, isSuccess) {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._container, { loop: false })\r\n\t .to({ x: pos }, props.playerMoveSpeed)\r\n\t .call(function () {\r\n\t engine.Tween.removeTweens(_this._container);\r\n\t if (isSuccess) {\r\n\t if (callBack) {\r\n\t callBack();\r\n\t }\r\n\t }\r\n\t else {\r\n\t _this.playDropTween(callBack);\r\n\t }\r\n\t });\r\n\t };\r\n\t Player.prototype.playDropTween = function (callBack) {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._container, { loop: false })\r\n\t .to({ y: 2000 }, 1000)\r\n\t .call(function () {\r\n\t engine.Tween.removeTweens(_this._container);\r\n\t if (callBack) {\r\n\t callBack();\r\n\t }\r\n\t });\r\n\t };\r\n\t Player.prototype.setBackViewport = function (callBack) {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._container, { loop: false })\r\n\t .to({ x: 0 }, props.pierMoveTime)\r\n\t .call(function () {\r\n\t engine.Tween.removeTweens(_this._container);\r\n\t if (callBack) {\r\n\t callBack();\r\n\t }\r\n\t });\r\n\t };\r\n\t return Player;\r\n\t}(engine.Container));\n\n\tvar Strut = (function (_super) {\r\n\t tslib.__extends(Strut, _super);\r\n\t function Strut() {\r\n\t var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\t _this.gany = 1005;\r\n\t return _this;\r\n\t }\r\n\t Strut.prototype.init = function () {\r\n\t this._strut = new engine.Rect();\r\n\t this.addChild(this._strut);\r\n\t this._strut.width = props.strutWidth;\r\n\t this._strut.y = this.gany;\r\n\t this._strut.fillColor = props.strutColor;\r\n\t this._strut.rotation = 180;\r\n\t };\r\n\t Strut.prototype.onMouseDown = function (pierWidth, distance, callBack) {\r\n\t var paddingx = 20;\r\n\t if (GameView.bgIndex == 0) {\r\n\t paddingx = 20;\r\n\t }\r\n\t else if (GameView.bgIndex == 1) {\r\n\t paddingx = 30;\r\n\t }\r\n\t else if (GameView.bgIndex == 2) {\r\n\t paddingx = 20;\r\n\t }\r\n\t this._strut.x = pierWidth - paddingx;\r\n\t this._distance = distance;\r\n\t this._callBack = callBack;\r\n\t this._strut.visible = true;\r\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.frameStrut, this);\r\n\t };\r\n\t Strut.prototype.onMouseUp = function () {\r\n\t var _this = this;\r\n\t this.removeEventListener(engine.Event.ENTER_FRAME, this.frameStrut, this);\r\n\t setTimeout(function () {\r\n\t _this.strutRotation();\r\n\t }, 200);\r\n\t };\r\n\t Strut.prototype.strutRotation = function () {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._strut, { loop: false })\r\n\t .to({ rotation: 270 }, props.strutRotationSpeed)\r\n\t .call(function () {\r\n\t _this.judgeResult();\r\n\t engine.Tween.removeTweens(_this._strut);\r\n\t });\r\n\t };\r\n\t Strut.prototype.judgeResult = function () {\r\n\t var isSuccess = false;\r\n\t var paddingx = 20;\r\n\t var chax = 20;\r\n\t if (GameView.bgIndex == 0) {\r\n\t paddingx = 20;\r\n\t chax = 20;\r\n\t }\r\n\t else if (GameView.bgIndex == 1) {\r\n\t paddingx = 3;\r\n\t chax = 39;\r\n\t }\r\n\t else if (GameView.bgIndex == 2) {\r\n\t paddingx = 20;\r\n\t chax = 20;\r\n\t }\r\n\t var mindis = this._distance[0] - this._distance[1] + chax;\r\n\t var maxdis = this._distance[0] + paddingx;\r\n\t if (mindis <= this._strut.height && this._strut.height <= maxdis) {\r\n\t isSuccess = true;\r\n\t }\r\n\t if (this._callBack) {\r\n\t this._callBack(isSuccess);\r\n\t }\r\n\t };\r\n\t Strut.prototype.frameStrut = function () {\r\n\t var maxdis = 700;\r\n\t if (this._strut.height < maxdis) {\r\n\t if (this._strut.height + GameView.speed > maxdis) {\r\n\t this._strut.height = maxdis;\r\n\t }\r\n\t else {\r\n\t this._strut.height += GameView.speed;\r\n\t }\r\n\t }\r\n\t };\r\n\t Strut.prototype.rest = function () {\r\n\t this._strut.width = props.strutWidth;\r\n\t this._strut.y = this.gany;\r\n\t this._strut.fillColor = props.strutColor;\r\n\t this._strut.rotation = 180;\r\n\t this._strut.height = 0;\r\n\t this._strut.visible = false;\r\n\t };\r\n\t Strut.prototype.getStrutHeight = function () {\r\n\t var distance = this._strut.height > 1000 ? 1000 : this._strut.height;\r\n\t return distance;\r\n\t };\r\n\t return Strut;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Strut.js.map\n\n\tvar ObjectPool$1 = engine.ObjectPool;\r\n\tvar PoolName = 'pier';\r\n\tObjectPool$1.registerPool(PoolName, function () {\r\n\t return new Pier();\r\n\t}, function (item, data) {\r\n\t item.init();\r\n\t});\r\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.moveX = 0;\r\n\t _this.playery = 878;\r\n\t _this.inani = true;\r\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\r\n\t return _this;\r\n\t }\r\n\t GameView.prototype.setup = function () {\r\n\t if (this._hasSetup) {\r\n\t return;\r\n\t }\r\n\t this._hasSetup = true;\r\n\t this._backgroud = new Background();\r\n\t this.addChild(this._backgroud);\r\n\t this._backgroud.initBg();\r\n\t var road = this._road = new Road();\r\n\t this.addChild(road);\r\n\t road.setup();\r\n\t var pierWidth = this._road.getFristPier();\r\n\t var player = this._player = new Player();\r\n\t this.addChild(player);\r\n\t player.initPlayer(pierWidth);\r\n\t this.pierWidth = pierWidth;\r\n\t this.xiacheNode = createSvga(\"xiache\");\r\n\t this.addChild(this.xiacheNode);\r\n\t this.xiacheNode.y = this.playery - 35;\r\n\t this.xiacheNode.x = this.pierWidth / 2 - 100;\r\n\t this.xiacheNode.stop();\r\n\t this.xiacheNode.name = \"xiacheanm\";\r\n\t console.log(\"下车动画帧数\", this.xiacheNode.totalFrames, this.xiacheNode);\r\n\t this.xiacheNode.visible = false;\r\n\t var strut = this._strut = new Strut();\r\n\t this.addChild(strut);\r\n\t strut.init();\r\n\t };\r\n\t GameView.prototype.playComp = function () {\r\n\t var curframe = this.xiacheNode.currentFrame;\r\n\t if (curframe == this.xiacheNode.totalFrames) {\r\n\t this.inani = false;\r\n\t this.xiacheNode.stop();\r\n\t this.xiacheNode.removeEventListener(engine.Event.ENTER_FRAME, this.playComp, this);\r\n\t for (var i = 0; i < 15; i++) {\r\n\t if (i < 12) {\r\n\t this.xiacheNode.getChildAt(i).visible = false;\r\n\t }\r\n\t }\r\n\t this._player._container.visible = true;\r\n\t }\r\n\t };\r\n\t GameView.prototype.start = function (guide) {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var initScore;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t this._isTouchLayer = true;\r\n\t this._sumScore = 0;\r\n\t this._isMouseDown = false;\r\n\t this._guide = guide;\r\n\t this._player.revive();\r\n\t this.closeStrut();\r\n\t initScore = 0;\r\n\t this.updateScore(initScore);\r\n\t if (this.xiacheNode.x < this.pierWidth / 2 - 105) {\r\n\t this.startAnm();\r\n\t }\r\n\t if (this._guide == '1') {\r\n\t this.setGuide();\r\n\t }\r\n\t else {\r\n\t this.initTouch();\r\n\t this.registerEvent();\r\n\t }\r\n\t return [2];\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.startAnm = function () {\r\n\t this.inani = true;\r\n\t this.xiacheNode.visible = true;\r\n\t for (var i = 0; i < 15; i++) {\r\n\t if (i < 12) {\r\n\t this.xiacheNode.getChildAt(i).visible = true;\r\n\t }\r\n\t }\r\n\t this.xiacheNode.x = this.pierWidth / 2 - 100;\r\n\t this._player._container.visible = false;\r\n\t this.xiacheNode.gotoAndPlay(1);\r\n\t this.xiacheNode.addEventListener(engine.Event.ENTER_FRAME, this.playComp, this);\r\n\t };\r\n\t GameView.prototype.reset = function () {\r\n\t this._sumScore = 0;\r\n\t engine.globalEvent.dispatchEvent('bjxd-game-score', { score: this._sumScore });\r\n\t this._player.revive();\r\n\t this.closeStrut();\r\n\t this.changeBg(GameView.bgIndex);\r\n\t this.startAnm();\r\n\t };\r\n\t GameView.prototype.revive = function () {\r\n\t this._player.revive();\r\n\t this.startAnm();\r\n\t this._isTouchLayer = true;\r\n\t this.closeStrut();\r\n\t };\r\n\t GameView.prototype.setGuide = function () {\r\n\t var _this = this;\r\n\t this._road.setGuide();\r\n\t var guideLayer = this.guideLayer = new GuideLayer();\r\n\t this.addChild(guideLayer);\r\n\t this.guideLayer.show(1, { x: 20, y: 650, guideText: props.guideText1 }, function () {\r\n\t var posX = _this._road.getMovePos();\r\n\t _this.guideLayer.show(2, { x: posX + 20, y: 620, guideText: props.guideText2 }, function () {\r\n\t _this.initTouch();\r\n\t _this.registerEvent();\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.initLabScore = function () {\r\n\t };\r\n\t GameView.prototype.registerEvent = function () {\r\n\t this.removeListener();\r\n\t this.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);\r\n\t this.addEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);\r\n\t };\r\n\t GameView.prototype.removeListener = function () {\r\n\t this.removeEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);\r\n\t this.removeEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);\r\n\t };\r\n\t GameView.prototype.initTouch = function () {\r\n\t };\r\n\t GameView.prototype.setScoreShow = function () {\r\n\t };\r\n\t GameView.prototype.onMouseDown = function () {\r\n\t if (this._isTouchLayer && !this.inani) {\r\n\t this._isMouseDown = true;\r\n\t this._strut.onMouseDown(this._road.getFristPier(), this._road.getDistance(), this.goCallBcak.bind(this));\r\n\t }\r\n\t };\r\n\t GameView.prototype.onMouseUp = function () {\r\n\t if (this._isTouchLayer && this._isMouseDown) {\r\n\t this._strut.onMouseUp();\r\n\t this._isMouseDown = false;\r\n\t this._isTouchLayer = false;\r\n\t }\r\n\t };\r\n\t GameView.prototype.goCallBcak = function (isSuccess) {\r\n\t var _this = this;\r\n\t if (isSuccess) {\r\n\t var movePos = this._road.getMovePos();\r\n\t if (this._road.getStartGold(1, false)) {\r\n\t this.updateScore(props.singleScore + props.goldScore);\r\n\t }\r\n\t else {\r\n\t this.updateScore(props.singleScore);\r\n\t }\r\n\t this._player.setViewport(movePos, this.complete.bind(this));\r\n\t }\r\n\t else {\r\n\t this._player.setViewport(this._strut.getStrutHeight(), function () {\r\n\t engine.globalEvent.dispatchEvent('bjxd-game-over', { score: _this._sumScore });\r\n\t }, this._road.getFristPier());\r\n\t }\r\n\t };\r\n\t GameView.prototype.complete = function () {\r\n\t var _this = this;\r\n\t this._road.getStartGold(1);\r\n\t var movePos = this._road.getMovePos();\r\n\t this._road.setViewport();\r\n\t this._backgroud.setViewport(movePos);\r\n\t this._player.setBackViewport(function () {\r\n\t _this._isTouchLayer = true;\r\n\t });\r\n\t var carx = this.xiacheNode.x;\r\n\t if (carx > -200) {\r\n\t carx -= movePos;\r\n\t engine.Tween.get(this.xiacheNode, { loop: false })\r\n\t .to({\r\n\t x: carx\r\n\t }, props.pierMoveTime);\r\n\t }\r\n\t this.closeStrut();\r\n\t };\r\n\t GameView.prototype.closeStrut = function () {\r\n\t this._strut.rest();\r\n\t };\r\n\t GameView.prototype.updateScore = function (score) {\r\n\t this._sumScore += score;\r\n\t engine.globalEvent.dispatchEvent('bjxd-game-score', { score: this._sumScore });\r\n\t };\r\n\t GameView.prototype.getScore = function () {\r\n\t return this._sumScore;\r\n\t };\r\n\t GameView.prototype.changeBg = function (index) {\r\n\t if (GameView.bgIndex != index) {\r\n\t GameView.bgIndex = index;\r\n\t this._backgroud.changeBg(index);\r\n\t this._road.changeBg();\r\n\t }\r\n\t };\r\n\t GameView.prototype.changeSpeed = function (speed) {\r\n\t if (GameView.speed != speed) {\r\n\t GameView.speed = speed;\r\n\t }\r\n\t };\r\n\t GameView.bgIndex = 0;\r\n\t GameView.speed = 10;\r\n\t return GameView;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=GameView.js.map\n\n\tvar GameWrapper = (function (_super) {\r\n\t tslib.__extends(GameWrapper, _super);\r\n\t function GameWrapper() {\r\n\t var _this = _super.call(this) || this;\r\n\t engine.globalEvent.addEventListener('bjxd-game-start', _this.start, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-reset', _this.reset, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-revive', _this.revive, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-change', _this.change, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-speed', _this.speed, _this);\r\n\t var gameView = _this._gameView = new GameView();\r\n\t _this.addChild(gameView);\r\n\t return _this;\r\n\t }\r\n\t GameWrapper.prototype.start = function (event) {\r\n\t this._gameView.start(event.data.guide);\r\n\t };\r\n\t GameWrapper.prototype.reset = function () {\r\n\t this._gameView.reset();\r\n\t };\r\n\t GameWrapper.prototype.revive = function () {\r\n\t this._gameView.revive();\r\n\t };\r\n\t GameWrapper.prototype.change = function (event) {\r\n\t this._gameView.changeBg(event.data.index);\r\n\t };\r\n\t GameWrapper.prototype.speed = function (event) {\r\n\t this._gameView.changeSpeed(event.data.speed);\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['bjxd-game'] = factory(global.tslib));\n}(this, (function (tslib) { 'use strict';\n\n\tvar props = {};\r\n\tfunction prepareProps() {\r\n\t var metaProps = getProps();\r\n\t engine.injectProp(props, metaProps);\r\n\t}\r\n\tfunction injectProps(p) {\r\n\t engine.injectProp(props, p);\r\n\t}\r\n\t//# sourceMappingURL=props.js.map\n\n\tvar ObjectPool = engine.ObjectPool;\r\n\tvar Road = (function (_super) {\r\n\t tslib.__extends(Road, _super);\r\n\t function Road() {\r\n\t return _super !== null && _super.apply(this, arguments) || this;\r\n\t }\r\n\t Road.prototype.setup = function () {\r\n\t this.lastPos = 0;\r\n\t this.addPier();\r\n\t };\r\n\t Road.prototype.getFristPier = function () {\r\n\t return this.getChildAt(0).width;\r\n\t };\r\n\t Road.prototype.getDistance = function () {\r\n\t var distance = [];\r\n\t var pier1 = this.getChildAt(0);\r\n\t var pier2 = this.getChildAt(1);\r\n\t distance.push(pier2.x - pier1.x);\r\n\t distance.push(pier2.width);\r\n\t return distance;\r\n\t };\r\n\t Road.prototype.addPier = function () {\r\n\t while (this.children.length < props.pierCount + 1) {\r\n\t var childrenNum = this.children.length;\r\n\t var randomPos = this.makeRandomFloat(props.pierMaxDistance, props.pierMinDistance);\r\n\t var pier = ObjectPool.getObject('pier');\r\n\t this.addChild(pier);\r\n\t pier.changeBg();\r\n\t if (childrenNum == 0) {\r\n\t pier.x = 0;\r\n\t }\r\n\t else {\r\n\t pier.x = this.lastPos + randomPos;\r\n\t }\r\n\t this.lastPos = pier.x;\r\n\t }\r\n\t };\r\n\t Road.prototype.changeBg = function () {\r\n\t var nume = this.children.length;\r\n\t for (var i = 0; i < nume; i++) {\r\n\t var ipier = this.getChildAt(i);\r\n\t ipier.changeBg();\r\n\t }\r\n\t };\r\n\t Road.prototype.moveAddPier = function () {\r\n\t var randomPos = this.makeRandomFloat(props.pierMaxDistance, props.pierMinDistance);\r\n\t var pier = ObjectPool.getObject('pier');\r\n\t var lastChild = this.getChildAt(this.children.length - 1);\r\n\t pier.x = lastChild.x + randomPos;\r\n\t this.addChild(pier);\r\n\t pier.changeBg();\r\n\t };\r\n\t Road.prototype.makeRandomFloat = function (max, min) {\r\n\t if (min === void 0) { min = 0; }\r\n\t return Math.random() * (max - min) + min;\r\n\t };\r\n\t Road.prototype.setViewport = function () {\r\n\t var _this = this;\r\n\t var tmpMovepos = this.getMovePos();\r\n\t this.children.forEach(function (item, index) {\r\n\t _this.playTween(item, index, tmpMovepos);\r\n\t });\r\n\t };\r\n\t Road.prototype.getMovePos = function () {\r\n\t var movePos = this.getChildAt(1);\r\n\t return movePos.x;\r\n\t };\r\n\t Road.prototype.playTween = function (item, index, tmpMovepos) {\r\n\t var _this = this;\r\n\t engine.Tween.get(item, { loop: false })\r\n\t .to({ x: item.x - tmpMovepos }, props.pierMoveTime)\r\n\t .call(function () {\r\n\t if (_this.getChildIndex(item) == 0) {\r\n\t engine.Tween.removeTweens(item);\r\n\t _this.removeChild(item);\r\n\t ObjectPool.recycleObject('pier', item);\r\n\t }\r\n\t if (index == 0) {\r\n\t _this.moveAddPier();\r\n\t }\r\n\t });\r\n\t };\r\n\t Road.prototype.getStartGold = function (index, isClose) {\r\n\t if (isClose === void 0) { isClose = true; }\r\n\t var tmpNode = this.getChildAt(index);\r\n\t var haveGold = tmpNode.haveGold;\r\n\t if (haveGold && isClose) {\r\n\t tmpNode.closeGold();\r\n\t }\r\n\t return haveGold;\r\n\t };\r\n\t Road.prototype.setGuide = function () {\r\n\t var tmpNode = this.getChildAt(1);\r\n\t if (!tmpNode.haveGold) {\r\n\t tmpNode.children.forEach(function (item) {\r\n\t if (item.name == 'gold') {\r\n\t item.visible = true;\r\n\t }\r\n\t });\r\n\t tmpNode.haveGold = true;\r\n\t }\r\n\t };\r\n\t return Road;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Road.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 getStage() {\r\n\t return engine.gameStage.stage;\r\n\t}\r\n\tfunction createSvga(name) {\r\n\t var inst = new svga.Svga();\r\n\t inst.source = engine.getAssetByName(name).uuid;\r\n\t return inst;\r\n\t}\r\n\t//# sourceMappingURL=utils.js.map\n\n\tvar GuideLayer = (function (_super) {\r\n\t tslib.__extends(GuideLayer, _super);\r\n\t function GuideLayer() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.setup();\r\n\t return _this;\r\n\t }\r\n\t GuideLayer.prototype.setup = function () {\r\n\t };\r\n\t GuideLayer.prototype.show = function (id, options, callback) {\r\n\t this.visible = true;\r\n\t this._callBack = callback ? callback : null;\r\n\t if (!this.guideMask) {\r\n\t var _a = this.stage, width = _a.width, height = _a.height;\r\n\t this.guideMask = new engine.Container();\r\n\t this.addChild(this.guideMask);\r\n\t this.guideImg = new engine.Image();\r\n\t this.guideMask.addChild(this.guideImg);\r\n\t this.shouzhi = new engine.Image(getTextureByName(\"shouzhi\"));\r\n\t this.guideMask.addChild(this.shouzhi);\r\n\t }\r\n\t this.guideImg.texture = getTextureByName(\"yindao\" + id);\r\n\t this.guideStep(id);\r\n\t this.once(engine.MouseEvent.CLICK, function () {\r\n\t this.visible = false;\r\n\t if (this._callBack) {\r\n\t this._callBack();\r\n\t }\r\n\t }, this);\r\n\t };\r\n\t GuideLayer.prototype.guideStep = function (id) {\r\n\t if (id == 1) {\r\n\t this.shouzhi.x = 244;\r\n\t this.shouzhi.y = 812;\r\n\t }\r\n\t if (id == 2) {\r\n\t this.shouzhi.x = 346;\r\n\t this.shouzhi.y = 1108;\r\n\t }\r\n\t };\r\n\t return GuideLayer;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=GuideLayer.js.map\n\n\tvar LoopComponent = (function (_super) {\r\n\t tslib.__extends(LoopComponent, _super);\r\n\t function LoopComponent() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.onceInfo = { width: 0, height: 0, count: 0 };\r\n\t _this.loopInfo = { width: 0, height: 0, count: 0 };\r\n\t _this.parts = [];\r\n\t return _this;\r\n\t }\r\n\t LoopComponent.prototype.setup = function (parts, info) {\r\n\t var _this = this;\r\n\t parts.forEach(function (item, index) {\r\n\t var part;\r\n\t if (typeof item == 'string') {\r\n\t if (item.length > 0) {\r\n\t part = new engine.Sprite(getTextureByName(item));\r\n\t }\r\n\t else {\r\n\t part = new engine.Sprite();\r\n\t }\r\n\t }\r\n\t else if (item instanceof engine.Texture) {\r\n\t part = new engine.Sprite(item);\r\n\t }\r\n\t else {\r\n\t part = item;\r\n\t }\r\n\t _this.addChild(part);\r\n\t _this.parts.push(part);\r\n\t if (index == 0) {\r\n\t info.width = part.width;\r\n\t info.height = part.height;\r\n\t }\r\n\t });\r\n\t info.count = parts.length;\r\n\t this.setViewport(0, 0);\r\n\t };\r\n\t LoopComponent.prototype.changeBg = function (changName) {\r\n\t this.parts.forEach(function (item, index) {\r\n\t if (changName && changName.length > 0) {\r\n\t item.texture = getTextureByName(changName);\r\n\t }\r\n\t });\r\n\t };\r\n\t LoopComponent.prototype.setupLoop = function (resArr) {\r\n\t this.setup(resArr, this.loopInfo);\r\n\t };\r\n\t LoopComponent.prototype.setViewport = function (x, y) {\r\n\t if (y === void 0) { y = 0; }\r\n\t var sizeField = y == 0 ? 'width' : 'height';\r\n\t var posField = y == 0 ? 'x' : 'y';\r\n\t var pos = y == 0 ? x : y;\r\n\t var index;\r\n\t var onceSize = this.onceInfo[sizeField];\r\n\t var onceCount = this.onceInfo.count;\r\n\t var loopCount = this.loopInfo.count;\r\n\t var loopSize = this.loopInfo[sizeField];\r\n\t index = onceSize == 0 ? -1 : Math.floor(pos / onceSize);\r\n\t if (index < 0 || index >= onceCount) {\r\n\t var loopIndex = Math.floor((pos - onceCount * onceSize) / this.loopInfo[sizeField]);\r\n\t index = onceCount + loopIndex;\r\n\t }\r\n\t var formerIndex = index < onceCount ? index : (index) % loopCount + onceCount;\r\n\t var latterIndex = index < onceCount ? index + 1 : (index - onceCount + 1) % loopCount + onceCount;\r\n\t var former = this.parts[formerIndex];\r\n\t var latter = this.parts[latterIndex];\r\n\t if (!former || !latter) {\r\n\t console.log(formerIndex, latterIndex);\r\n\t }\r\n\t former[posField] = -(pos - loopSize * (index < onceCount ? index : index - onceCount) - (index < onceCount ? 0 : onceCount * onceSize));\r\n\t latter[posField] = former.x + (index < onceCount ? onceSize : loopSize);\r\n\t };\r\n\t return LoopComponent;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=LoopComponent.js.map\n\n\tvar Background = (function (_super) {\r\n\t tslib.__extends(Background, _super);\r\n\t function Background() {\r\n\t var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\t _this.partResHHL = ['bg1', ''];\r\n\t _this.partResHB = ['bg2', ''];\r\n\t _this.partResWH = ['bg3', ''];\r\n\t _this.speeds = [];\r\n\t _this.resArray = [];\r\n\t _this.frameMovePos = 0;\r\n\t return _this;\r\n\t }\r\n\t Background.prototype.initBg = function () {\r\n\t this.sumMovePos = 0;\r\n\t this.speeds.push(props.afterBGMoveSpeed);\r\n\t this.speeds.push(props.frontBGMoveSpeed);\r\n\t var bottomBg = new engine.Rect();\r\n\t bottomBg.x = 0;\r\n\t bottomBg.y = 0;\r\n\t bottomBg.width = getStage().width;\r\n\t bottomBg.height = 0;\r\n\t bottomBg.fillColor = 0x75c9f5;\r\n\t this.addChild(bottomBg);\r\n\t this.resArray.push(this.partResHHL);\r\n\t this.resArray.push(this.partResHB);\r\n\t this.resArray.push(this.partResWH);\r\n\t var parts = [];\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var part = new LoopComponent();\r\n\t part.setupLoop([\r\n\t this.resArray[0][i],\r\n\t this.resArray[0][i],\r\n\t ]);\r\n\t parts.push(part);\r\n\t this.addChild(part);\r\n\t }\r\n\t parts[1].y = 200;\r\n\t };\r\n\t Background.prototype.setViewport = function (pos) {\r\n\t this.needFrameSum = (props.pierMoveTime / 1000) * 60;\r\n\t this.frameMovePos = pos / this.needFrameSum;\r\n\t this.frameIndex = 0;\r\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.frameBack, this);\r\n\t };\r\n\t Background.prototype.frameBack = function () {\r\n\t if (this.frameIndex < this.needFrameSum) {\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var part = this.getChildAt(i + 1);\r\n\t var speed = this.speeds[i];\r\n\t var tmpPos = ((this.frameMovePos * this.frameIndex) + this.sumMovePos) * speed;\r\n\t part.setViewport(tmpPos);\r\n\t }\r\n\t this.frameIndex++;\r\n\t }\r\n\t else {\r\n\t this.sumMovePos += this.frameMovePos * this.needFrameSum;\r\n\t this.frameIndex = 0;\r\n\t this.removeEventListener(engine.Event.ENTER_FRAME, this.frameBack, this);\r\n\t }\r\n\t };\r\n\t Background.prototype.changeBg = function (index) {\r\n\t for (var i = 0; i < 2; i++) {\r\n\t var part = this.getChildAt(i + 1);\r\n\t part.changeBg(this.resArray[index][i]);\r\n\t if (i == 1 && index == 1) {\r\n\t part.y = 400;\r\n\t }\r\n\t if (i == 1 && index == 2) {\r\n\t part.y = 250;\r\n\t }\r\n\t }\r\n\t };\r\n\t return Background;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Background.js.map\n\n\tvar Pier = (function (_super) {\r\n\t tslib.__extends(Pier, _super);\r\n\t function Pier() {\r\n\t var _this = _super.call(this) || this;\r\n\t _this.part1tex = \"zhuzi1\";\r\n\t _this.part2tex = \"zhuzi2\";\r\n\t _this.part3tex = \"zhuzi3\";\r\n\t _this.texname = \"\";\r\n\t _this.zhuy = 1006;\r\n\t _this.bmp = new engine.Sprite();\r\n\t _this.addChild(_this.bmp);\r\n\t return _this;\r\n\t }\r\n\t Pier.prototype.init = function () {\r\n\t var bmp = this.bmp;\r\n\t bmp.alpha = 1;\r\n\t this.changeBg();\r\n\t bmp.x = 0;\r\n\t bmp.y = this.zhuy;\r\n\t };\r\n\t Pier.prototype.changeBg = function () {\r\n\t var texstr;\r\n\t if (GameView.bgIndex == 0) {\r\n\t texstr = this.part1tex;\r\n\t }\r\n\t else if (GameView.bgIndex == 1) {\r\n\t texstr = this.part2tex;\r\n\t }\r\n\t else {\r\n\t texstr = this.part3tex;\r\n\t }\r\n\t if (this.texname != texstr) {\r\n\t this.texname = texstr;\r\n\t this.bmp.texture = getTextureByName(texstr);\r\n\t }\r\n\t };\r\n\t Pier.prototype.setShowGold = function () {\r\n\t var nodeGold = this.getChildByName('gold');\r\n\t var randomWard = Math.random();\r\n\t nodeGold.alpha = 1;\r\n\t var isShow = randomWard < props.reward ? true : false;\r\n\t nodeGold.visible = isShow;\r\n\t this.haveGold = isShow;\r\n\t };\r\n\t Pier.prototype.setGoldPosX = function (bmp) {\r\n\t var nodeGold = this.getChildByName('gold');\r\n\t var pos = bmp.width / 2 - nodeGold.width / 2;\r\n\t nodeGold.x = pos;\r\n\t nodeGold.y = this.zhuy - nodeGold.height - 50;\r\n\t nodeGold.visible = false;\r\n\t };\r\n\t Pier.prototype.closeGold = function () {\r\n\t var _this = this;\r\n\t this.children.forEach(function (item) {\r\n\t if (item.name == 'gold') {\r\n\t item.anchorX = item.width / 2;\r\n\t item.anchorY = item.height / 2;\r\n\t engine.Tween.get(item, { loop: false })\r\n\t .to({ scaleX: 2.5, scaleY: 2.5 }, 200, engine.Ease.cubicOut)\r\n\t .to({ scaleX: 1, scaleY: 1, alpha: 0 }, 200, engine.Ease.cubicIn)\r\n\t .call(function () {\r\n\t item.visible = false;\r\n\t _this.haveGold = false;\r\n\t });\r\n\t }\r\n\t });\r\n\t };\r\n\t return Pier;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Pier.js.map\n\n\tvar Player = (function (_super) {\r\n\t tslib.__extends(Player, _super);\r\n\t function Player() {\r\n\t var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\t _this.playery = 878;\r\n\t return _this;\r\n\t }\r\n\t Player.prototype.initPlayer = function (pierWidth) {\r\n\t this.pierWidth = pierWidth;\r\n\t this._container = new engine.Container();\r\n\t this.addChild(this._container);\r\n\t this.playerNode = createSvga('walk');\r\n\t this._container.addChild(this.playerNode);\r\n\t this.playerNode.y = this.playery;\r\n\t this.playerNode.x = pierWidth / 2 - 50;\r\n\t this.playerNode.play();\r\n\t this._container.visible = false;\r\n\t };\r\n\t Player.prototype.revive = function () {\r\n\t this._container.x = 0;\r\n\t this._container.y = 0;\r\n\t this.playerNode.x = this.pierWidth / 2 - 50;\r\n\t this.playerNode.y = this.playery;\r\n\t };\r\n\t Player.prototype.setViewport = function (pos, callBack, pierWidth) {\r\n\t var tmpPos = 0;\r\n\t var isSuccess = false;\r\n\t if (!pierWidth) {\r\n\t tmpPos = pos;\r\n\t isSuccess = true;\r\n\t }\r\n\t else {\r\n\t tmpPos = pierWidth - this.playerNode.x + pos - 60;\r\n\t }\r\n\t this.playGoTween(tmpPos, callBack, isSuccess);\r\n\t };\r\n\t Player.prototype.playGoTween = function (pos, callBack, isSuccess) {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._container, { loop: false })\r\n\t .to({ x: pos }, props.playerMoveSpeed)\r\n\t .call(function () {\r\n\t engine.Tween.removeTweens(_this._container);\r\n\t if (isSuccess) {\r\n\t if (callBack) {\r\n\t callBack();\r\n\t }\r\n\t }\r\n\t else {\r\n\t _this.playDropTween(callBack);\r\n\t }\r\n\t });\r\n\t };\r\n\t Player.prototype.playDropTween = function (callBack) {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._container, { loop: false })\r\n\t .to({ y: 2000 }, 1000)\r\n\t .call(function () {\r\n\t engine.Tween.removeTweens(_this._container);\r\n\t if (callBack) {\r\n\t callBack();\r\n\t }\r\n\t });\r\n\t };\r\n\t Player.prototype.setBackViewport = function (callBack) {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._container, { loop: false })\r\n\t .to({ x: 0 }, props.pierMoveTime)\r\n\t .call(function () {\r\n\t engine.Tween.removeTweens(_this._container);\r\n\t if (callBack) {\r\n\t callBack();\r\n\t }\r\n\t });\r\n\t };\r\n\t return Player;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Player.js.map\n\n\tvar Strut = (function (_super) {\r\n\t tslib.__extends(Strut, _super);\r\n\t function Strut() {\r\n\t var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\t _this.gany = 1005;\r\n\t return _this;\r\n\t }\r\n\t Strut.prototype.init = function () {\r\n\t this._strut = new engine.Image(getTextureByName(\"ganzi\"));\r\n\t this.addChild(this._strut);\r\n\t this._strut.y = this.gany;\r\n\t this._strut.rotation = 180;\r\n\t };\r\n\t Strut.prototype.onMouseDown = function (pierWidth, distance, callBack) {\r\n\t var paddingx = 20;\r\n\t if (GameView.bgIndex == 0) {\r\n\t paddingx = 20;\r\n\t }\r\n\t else if (GameView.bgIndex == 1) {\r\n\t paddingx = 30;\r\n\t }\r\n\t else if (GameView.bgIndex == 2) {\r\n\t paddingx = 20;\r\n\t }\r\n\t this._strut.x = pierWidth - paddingx;\r\n\t this._distance = distance;\r\n\t this._callBack = callBack;\r\n\t this._strut.visible = true;\r\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.frameStrut, this);\r\n\t };\r\n\t Strut.prototype.onMouseUp = function () {\r\n\t var _this = this;\r\n\t this.removeEventListener(engine.Event.ENTER_FRAME, this.frameStrut, this);\r\n\t setTimeout(function () {\r\n\t _this.strutRotation();\r\n\t }, 200);\r\n\t };\r\n\t Strut.prototype.strutRotation = function () {\r\n\t var _this = this;\r\n\t engine.Tween.get(this._strut, { loop: false })\r\n\t .to({ rotation: 270 }, props.strutRotationSpeed)\r\n\t .call(function () {\r\n\t _this.judgeResult();\r\n\t engine.Tween.removeTweens(_this._strut);\r\n\t });\r\n\t };\r\n\t Strut.prototype.judgeResult = function () {\r\n\t var isSuccess = false;\r\n\t var paddingx = 20;\r\n\t var chax = 20;\r\n\t if (GameView.bgIndex == 0) {\r\n\t paddingx = 20;\r\n\t chax = 20;\r\n\t }\r\n\t else if (GameView.bgIndex == 1) {\r\n\t paddingx = 3;\r\n\t chax = 39;\r\n\t }\r\n\t else if (GameView.bgIndex == 2) {\r\n\t paddingx = 20;\r\n\t chax = 20;\r\n\t }\r\n\t var mindis = this._distance[0] - this._distance[1] + chax;\r\n\t var maxdis = this._distance[0] + paddingx;\r\n\t if (mindis <= this._strut.height && this._strut.height <= maxdis) {\r\n\t isSuccess = true;\r\n\t }\r\n\t if (this._callBack) {\r\n\t this._callBack(isSuccess);\r\n\t }\r\n\t };\r\n\t Strut.prototype.frameStrut = function () {\r\n\t var maxdis = 700;\r\n\t if (this._strut.height < maxdis) {\r\n\t if (this._strut.height + GameView.speed > maxdis) {\r\n\t this._strut.height = maxdis;\r\n\t }\r\n\t else {\r\n\t this._strut.height += GameView.speed;\r\n\t }\r\n\t }\r\n\t };\r\n\t Strut.prototype.rest = function () {\r\n\t this._strut.y = this.gany;\r\n\t this._strut.rotation = 180;\r\n\t this._strut.height = 0;\r\n\t this._strut.visible = false;\r\n\t };\r\n\t Strut.prototype.getStrutHeight = function () {\r\n\t var distance = this._strut.height > 1000 ? 1000 : this._strut.height;\r\n\t return distance;\r\n\t };\r\n\t return Strut;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=Strut.js.map\n\n\tvar ObjectPool$1 = engine.ObjectPool;\r\n\tvar PoolName = 'pier';\r\n\tObjectPool$1.registerPool(PoolName, function () {\r\n\t return new Pier();\r\n\t}, function (item, data) {\r\n\t item.init();\r\n\t});\r\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.moveX = 0;\r\n\t _this.playery = 878;\r\n\t _this.inani = true;\r\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\r\n\t return _this;\r\n\t }\r\n\t GameView.prototype.setup = function () {\r\n\t if (this._hasSetup) {\r\n\t return;\r\n\t }\r\n\t this._hasSetup = true;\r\n\t this._backgroud = new Background();\r\n\t this.addChild(this._backgroud);\r\n\t this._backgroud.initBg();\r\n\t var road = this._road = new Road();\r\n\t this.addChild(road);\r\n\t road.setup();\r\n\t var pierWidth = this._road.getFristPier();\r\n\t var player = this._player = new Player();\r\n\t this.addChild(player);\r\n\t player.initPlayer(pierWidth);\r\n\t this.pierWidth = pierWidth;\r\n\t this.xiacheNode = createSvga(\"xiache\");\r\n\t this.addChild(this.xiacheNode);\r\n\t this.xiacheNode.y = this.playery - 35;\r\n\t this.xiacheNode.x = this.pierWidth / 2 - 100;\r\n\t this.xiacheNode.stop();\r\n\t this.xiacheNode.name = \"xiacheanm\";\r\n\t console.log(\"下车动画帧数\", this.xiacheNode.totalFrames, this.xiacheNode);\r\n\t this.xiacheNode.visible = false;\r\n\t var strut = this._strut = new Strut();\r\n\t this.addChild(strut);\r\n\t strut.init();\r\n\t };\r\n\t GameView.prototype.playComp = function () {\r\n\t var curframe = this.xiacheNode.currentFrame;\r\n\t if (curframe == this.xiacheNode.totalFrames) {\r\n\t this.inani = false;\r\n\t this.xiacheNode.stop();\r\n\t this.xiacheNode.removeEventListener(engine.Event.ENTER_FRAME, this.playComp, this);\r\n\t for (var i = 0; i < 15; i++) {\r\n\t if (i < 12) {\r\n\t this.xiacheNode.getChildAt(i).visible = false;\r\n\t }\r\n\t }\r\n\t this._player._container.visible = true;\r\n\t }\r\n\t };\r\n\t GameView.prototype.start = function (guide) {\r\n\t return tslib.__awaiter(this, void 0, void 0, function () {\r\n\t var initScore;\r\n\t return tslib.__generator(this, function (_a) {\r\n\t this._isTouchLayer = true;\r\n\t this._sumScore = 0;\r\n\t this._isMouseDown = false;\r\n\t this._guide = guide;\r\n\t this._player.revive();\r\n\t this.closeStrut();\r\n\t initScore = 0;\r\n\t this.updateScore(initScore);\r\n\t if (this.xiacheNode.x < this.pierWidth / 2 - 105) {\r\n\t this.startAnm();\r\n\t }\r\n\t if (this._guide == '1') {\r\n\t this.setGuide();\r\n\t }\r\n\t else {\r\n\t this.initTouch();\r\n\t this.registerEvent();\r\n\t }\r\n\t engine.globalEvent.dispatchEvent(\"bjxd-game-inmove\", {\r\n\t \"canstop\": true\r\n\t });\r\n\t return [2];\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.startAnm = function () {\r\n\t this.inani = true;\r\n\t this.xiacheNode.visible = true;\r\n\t for (var i = 0; i < 15; i++) {\r\n\t if (i < 12) {\r\n\t this.xiacheNode.getChildAt(i).visible = true;\r\n\t }\r\n\t }\r\n\t this.xiacheNode.x = this.pierWidth / 2 - 100;\r\n\t this._player._container.visible = false;\r\n\t this.xiacheNode.gotoAndPlay(1);\r\n\t this.xiacheNode.addEventListener(engine.Event.ENTER_FRAME, this.playComp, this);\r\n\t };\r\n\t GameView.prototype.reset = function () {\r\n\t this._sumScore = 0;\r\n\t engine.globalEvent.dispatchEvent('bjxd-game-score', { score: this._sumScore });\r\n\t this._player.revive();\r\n\t this.closeStrut();\r\n\t this.changeBg(GameView.bgIndex);\r\n\t this.startAnm();\r\n\t engine.globalEvent.dispatchEvent(\"bjxd-game-inmove\", {\r\n\t \"canstop\": true\r\n\t });\r\n\t };\r\n\t GameView.prototype.revive = function () {\r\n\t this._player.revive();\r\n\t this.startAnm();\r\n\t this._isTouchLayer = true;\r\n\t this.closeStrut();\r\n\t engine.globalEvent.dispatchEvent(\"bjxd-game-inmove\", {\r\n\t \"canstop\": true\r\n\t });\r\n\t };\r\n\t GameView.prototype.setGuide = function () {\r\n\t var _this = this;\r\n\t this._road.setGuide();\r\n\t var guideLayer = this.guideLayer = new GuideLayer();\r\n\t this.addChild(guideLayer);\r\n\t this.guideLayer.show(1, { x: 20, y: 650, guideText: props.guideText1 }, function () {\r\n\t var posX = _this._road.getMovePos();\r\n\t _this.guideLayer.show(2, { x: posX + 20, y: 620, guideText: props.guideText2 }, function () {\r\n\t _this.initTouch();\r\n\t _this.registerEvent();\r\n\t });\r\n\t });\r\n\t };\r\n\t GameView.prototype.initLabScore = function () {\r\n\t };\r\n\t GameView.prototype.registerEvent = function () {\r\n\t this.removeListener();\r\n\t this.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);\r\n\t this.addEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);\r\n\t };\r\n\t GameView.prototype.removeListener = function () {\r\n\t this.removeEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);\r\n\t this.removeEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);\r\n\t };\r\n\t GameView.prototype.initTouch = function () {\r\n\t };\r\n\t GameView.prototype.setScoreShow = function () {\r\n\t };\r\n\t GameView.prototype.onMouseDown = function () {\r\n\t if (this._isTouchLayer && !this.inani) {\r\n\t engine.globalEvent.dispatchEvent(\"bjxd-game-inmove\", {\r\n\t \"canstop\": false\r\n\t });\r\n\t this._isMouseDown = true;\r\n\t this._strut.onMouseDown(this._road.getFristPier(), this._road.getDistance(), this.goCallBcak.bind(this));\r\n\t }\r\n\t };\r\n\t GameView.prototype.onMouseUp = function () {\r\n\t if (this._isTouchLayer && this._isMouseDown) {\r\n\t this._strut.onMouseUp();\r\n\t this._isMouseDown = false;\r\n\t this._isTouchLayer = false;\r\n\t }\r\n\t };\r\n\t GameView.prototype.goCallBcak = function (isSuccess) {\r\n\t var _this = this;\r\n\t if (isSuccess) {\r\n\t var movePos = this._road.getMovePos();\r\n\t if (this._road.getStartGold(1, false)) {\r\n\t this.updateScore(props.singleScore + props.goldScore);\r\n\t }\r\n\t else {\r\n\t this.updateScore(props.singleScore);\r\n\t }\r\n\t this._player.setViewport(movePos, this.complete.bind(this));\r\n\t }\r\n\t else {\r\n\t this._player.setViewport(this._strut.getStrutHeight(), function () {\r\n\t engine.globalEvent.dispatchEvent('bjxd-game-over', { score: _this._sumScore });\r\n\t }, this._road.getFristPier());\r\n\t }\r\n\t };\r\n\t GameView.prototype.complete = function () {\r\n\t var _this = this;\r\n\t this._road.getStartGold(1);\r\n\t var movePos = this._road.getMovePos();\r\n\t this._road.setViewport();\r\n\t this._backgroud.setViewport(movePos);\r\n\t this._player.setBackViewport(function () {\r\n\t _this._isTouchLayer = true;\r\n\t });\r\n\t var carx = this.xiacheNode.x;\r\n\t if (carx > -200) {\r\n\t carx -= movePos;\r\n\t engine.Tween.get(this.xiacheNode, { loop: false })\r\n\t .to({\r\n\t x: carx\r\n\t }, props.pierMoveTime);\r\n\t }\r\n\t engine.globalEvent.dispatchEvent(\"bjxd-game-inmove\", {\r\n\t \"canstop\": true\r\n\t });\r\n\t this.closeStrut();\r\n\t };\r\n\t GameView.prototype.closeStrut = function () {\r\n\t this._strut.rest();\r\n\t };\r\n\t GameView.prototype.updateScore = function (score) {\r\n\t this._sumScore += score;\r\n\t engine.globalEvent.dispatchEvent('bjxd-game-score', { score: this._sumScore });\r\n\t };\r\n\t GameView.prototype.getScore = function () {\r\n\t return this._sumScore;\r\n\t };\r\n\t GameView.prototype.changeBg = function (index) {\r\n\t if (GameView.bgIndex != index) {\r\n\t GameView.bgIndex = index;\r\n\t this._backgroud.changeBg(index);\r\n\t this._road.changeBg();\r\n\t }\r\n\t };\r\n\t GameView.prototype.changeSpeed = function (speed) {\r\n\t if (GameView.speed != speed) {\r\n\t GameView.speed = speed;\r\n\t }\r\n\t };\r\n\t GameView.bgIndex = 0;\r\n\t GameView.speed = 20;\r\n\t return GameView;\r\n\t}(engine.Container));\r\n\t//# sourceMappingURL=GameView.js.map\n\n\tvar GameWrapper = (function (_super) {\r\n\t tslib.__extends(GameWrapper, _super);\r\n\t function GameWrapper() {\r\n\t var _this = _super.call(this) || this;\r\n\t engine.globalEvent.addEventListener('bjxd-game-start', _this.start, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-reset', _this.reset, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-revive', _this.revive, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-change', _this.change, _this);\r\n\t engine.globalEvent.addEventListener('bjxd-game-speed', _this.speed, _this);\r\n\t var gameView = _this._gameView = new GameView();\r\n\t _this.addChild(gameView);\r\n\t return _this;\r\n\t }\r\n\t GameWrapper.prototype.start = function (event) {\r\n\t this._gameView.start(event.data.guide);\r\n\t };\r\n\t GameWrapper.prototype.reset = function () {\r\n\t this._gameView.reset();\r\n\t };\r\n\t GameWrapper.prototype.revive = function () {\r\n\t this._gameView.revive();\r\n\t };\r\n\t GameWrapper.prototype.change = function (event) {\r\n\t this._gameView.changeBg(event.data.index);\r\n\t };\r\n\t GameWrapper.prototype.speed = function (event) {\r\n\t this._gameView.changeSpeed(event.data.speed);\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"
}
......@@ -128,5 +128,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 console.log('loadImageByUrl----------:', url);\r\n\t return [2, new Promise(function (resolve) {\r\n\t if (engine.TextureCache[url]) {\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 () { resolve(t); });\r\n\t }\r\n\t })];\r\n\t });\r\n\t });\r\n\t}\r\n\t//# sourceMappingURL=utils.js.map\n\n\tvar qietu = (function (url, type1, rows, cols, parent) { return tslib.__awaiter(void 0, void 0, void 0, function () {\r\n\t var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, r, startx, endx, c, starty, endy, uvs, isprite, 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, , 7]);\r\n\t t = void 0;\r\n\t if (!(type1 == 1)) return [3, 1];\r\n\t console.log(\"直接使用已加载的tex\");\r\n\t t = url;\r\n\t return [3, 3];\r\n\t case 1: return [4, loadImageByUrl(url)];\r\n\t case 2:\r\n\t t = (_a.sent());\r\n\t _a.label = 3;\r\n\t case 3:\r\n\t setimgwid = 612;\r\n\t mwid1 = setimgwid / rows;\r\n\t mhei1 = setimgwid / cols;\r\n\t mwid = t.width;\r\n\t mhei = t.height;\r\n\t if (!(mwid < 10 || mhei < 10)) return [3, 5];\r\n\t console.log(\"调整222222222222\");\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 4:\r\n\t _a.sent();\r\n\t return [2, qietu(t, 1, rows, cols)];\r\n\t case 5:\r\n\t console.log('图片', t);\r\n\t console.log(\"图片获取尺寸\", mwid, mhei);\r\n\t if (mwid > mhei) {\r\n\t if (mhei < setimgwid) {\r\n\t mwid = mwid * setimgwid / mhei;\r\n\t mhei = setimgwid;\r\n\t }\r\n\t }\r\n\t else {\r\n\t if (mwid < setimgwid) {\r\n\t mhei = mhei * setimgwid / mwid;\r\n\t mwid = setimgwid;\r\n\t }\r\n\t }\r\n\t console.log(\"适配后的图片尺寸\", mwid, mhei);\r\n\t picarr = {};\r\n\t picnames = [];\r\n\t chax = void 0;\r\n\t chay = void 0;\r\n\t startlix = void 0;\r\n\t addlix = void 0;\r\n\t startliy = void 0;\r\n\t addliy = void 0;\r\n\t if (mwid > mhei) {\r\n\t chax = (mwid - mhei) / 2;\r\n\t startlix = chax / mwid;\r\n\t addlix = (mhei / cols) / mwid;\r\n\t startliy = 0;\r\n\t addliy = 1 / rows;\r\n\t }\r\n\t else {\r\n\t startlix = 0;\r\n\t addlix = 1 / cols;\r\n\t chay = (mhei - mwid) / 2;\r\n\t startliy = chay / mhei;\r\n\t addliy = (mwid / rows) / mhei;\r\n\t }\r\n\t for (r = 0; r < rows; r++) {\r\n\t startx = startlix + addlix * r;\r\n\t endx = startx + addlix;\r\n\t for (c = 0; c < cols; c++) {\r\n\t starty = startliy + addliy * c;\r\n\t endy = starty + addliy;\r\n\t uvs = new Float32Array([\r\n\t starty,\r\n\t startx,\r\n\t endy,\r\n\t startx,\r\n\t endy,\r\n\t endx,\r\n\t starty,\r\n\t endx\r\n\t ]);\r\n\t isprite = new engine.Sprite(t);\r\n\t isprite.uvs = uvs;\r\n\t isprite.width = mwid1;\r\n\t isprite.height = mhei1;\r\n\t ispritename = \"pic_\" + c + \"_\" + r;\r\n\t isprite.name = ispritename;\r\n\t picarr[ispritename] = isprite;\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 }];\r\n\t case 6:\r\n\t e_1 = _a.sent();\r\n\t console.error(\"图片加载失败\", e_1);\r\n\t console.log(url, rows, cols);\r\n\t return [2, {\r\n\t res: false\r\n\t }];\r\n\t case 7: 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 console.log(\"拼图初始化完毕--------------\");\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 console.log(\"initgame---------\");\r\n\t this.gameUrls = props.gameUrls;\r\n\t this.gameTimes = props.gameTimes;\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 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: return [2];\r\n\t }\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, result, res, picarr, mwid, mhei, picnames, 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.dicont.removeChildren();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\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 console.log(\"start-----------------\", actidx);\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 = 2;\r\n\t }\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];\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 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, result, res, picarr, mwid, mhei, picnames, 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.dicont.removeChildren();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\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 console.log(\"start-----------------\", actidx);\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 = 2;\r\n\t }\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];\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 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 console.error(\"拼图暂停\");\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 console.error(\"拼图继续\");\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 console.error(\"成功过关\");\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}\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 console.log('loadImageByUrl----------:', url);\r\n\t return [2, new Promise(function (resolve) {\r\n\t if (engine.TextureCache[url]) {\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 () { resolve(t); });\r\n\t }\r\n\t })];\r\n\t });\r\n\t });\r\n\t}\r\n\t//# sourceMappingURL=utils.js.map\n\n\tvar qietu = (function (url, type1, rows, cols, parent) { return tslib.__awaiter(void 0, void 0, void 0, function () {\r\n\t var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, txt1, r, startx, endx, c, starty, endy, uvs, isprite, 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, , 7]);\r\n\t t = void 0;\r\n\t if (!(type1 == 1)) return [3, 1];\r\n\t console.log(\"直接使用已加载的tex\");\r\n\t t = url;\r\n\t return [3, 3];\r\n\t case 1: return [4, loadImageByUrl(url)];\r\n\t case 2:\r\n\t t = (_a.sent());\r\n\t _a.label = 3;\r\n\t case 3:\r\n\t setimgwid = 612;\r\n\t mwid1 = setimgwid / rows;\r\n\t mhei1 = setimgwid / cols;\r\n\t mwid = t.width;\r\n\t mhei = t.height;\r\n\t if (!(mwid < 10 || mhei < 10)) return [3, 5];\r\n\t console.log(\"调整222222222222\");\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 4:\r\n\t _a.sent();\r\n\t return [2, qietu(t, 1, rows, cols, parent)];\r\n\t case 5:\r\n\t console.log('图片', t);\r\n\t console.log(\"图片获取尺寸\", mwid, mhei);\r\n\t if (mwid > mhei) {\r\n\t if (mhei < setimgwid) {\r\n\t mwid = mwid * setimgwid / mhei;\r\n\t mhei = setimgwid;\r\n\t }\r\n\t }\r\n\t else {\r\n\t if (mwid < setimgwid) {\r\n\t mhei = mhei * setimgwid / mwid;\r\n\t mwid = setimgwid;\r\n\t }\r\n\t }\r\n\t console.log(\"适配后的图片尺寸\", mwid, mhei);\r\n\t picarr = {};\r\n\t picnames = [];\r\n\t chax = void 0;\r\n\t chay = void 0;\r\n\t startlix = void 0;\r\n\t addlix = void 0;\r\n\t startliy = void 0;\r\n\t addliy = void 0;\r\n\t if (mwid > mhei) {\r\n\t chax = (mwid - mhei) / 2;\r\n\t startlix = chax / mwid;\r\n\t addlix = (mhei / cols) / mwid;\r\n\t startliy = 0;\r\n\t addliy = 1 / rows;\r\n\t }\r\n\t else {\r\n\t startlix = 0;\r\n\t addlix = 1 / cols;\r\n\t chay = (mhei - mwid) / 2;\r\n\t startliy = chay / mhei;\r\n\t addliy = (mwid / rows) / mhei;\r\n\t }\r\n\t console.log(\"切图准备\", startlix, addlix, startliy, addliy, mwid, mhei);\r\n\t txt1 = new engine.Label();\r\n\t txt1.fillColor = \"red\";\r\n\t txt1.size = 24;\r\n\t txt1.text = startlix.toFixed(2) + \";\" + addlix.toFixed(2) + \";\" + startliy.toFixed(2) + \";\" + addliy.toFixed(2) + \";\" + mwid.toFixed(2) + \";\" + mhei.toFixed(2) + \";\";\r\n\t parent.addChild(txt1);\r\n\t txt1.y = -100;\r\n\t for (r = 0; r < rows; r++) {\r\n\t startx = startlix + addlix * r;\r\n\t endx = startx + addlix;\r\n\t for (c = 0; c < cols; c++) {\r\n\t starty = startliy + addliy * c;\r\n\t endy = starty + addliy;\r\n\t uvs = new Float32Array([\r\n\t starty,\r\n\t startx,\r\n\t endy,\r\n\t startx,\r\n\t endy,\r\n\t endx,\r\n\t starty,\r\n\t endx\r\n\t ]);\r\n\t isprite = new engine.Sprite(t);\r\n\t isprite.uvs = uvs;\r\n\t isprite.width = mwid1;\r\n\t isprite.height = mhei1;\r\n\t ispritename = \"pic_\" + c + \"_\" + r;\r\n\t isprite.name = ispritename;\r\n\t picarr[ispritename] = isprite;\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 }];\r\n\t case 6:\r\n\t e_1 = _a.sent();\r\n\t console.error(\"图片加载失败\", e_1);\r\n\t console.log(url, rows, cols);\r\n\t return [2, {\r\n\t res: false\r\n\t }];\r\n\t case 7: 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 console.log(\"拼图初始化完毕--------------\");\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 console.log(\"initgame---------\");\r\n\t this.gameUrls = props.gameUrls;\r\n\t this.gameTimes = props.gameTimes;\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 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: return [2];\r\n\t }\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, result, res, picarr, mwid, mhei, picnames, 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.dicont.removeChildren();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\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 console.log(\"start-----------------\", actidx);\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 = 2;\r\n\t }\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];\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 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, result, res, picarr, mwid, mhei, picnames, 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.dicont.removeChildren();\r\n\t this.movesteps = 0;\r\n\t this.startime = Date.now();\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 console.log(\"start-----------------\", actidx);\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 = 2;\r\n\t }\r\n\t return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];\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 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 console.error(\"拼图暂停\");\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 console.error(\"拼图继续\");\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 console.error(\"成功过关\");\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));\r\n\t//# sourceMappingURL=GameView.js.map\n\n\tvar GameWrapper = (function (_super) {\r\n\t tslib.__extends(GameWrapper, _super);\r\n\t function GameWrapper() {\r\n\t var _this = _super.call(this) || this;\r\n\t _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"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -479,6 +479,7 @@
};
return Player;
}(engine.Container));
//# sourceMappingURL=Player.js.map
var Strut = (function (_super) {
tslib.__extends(Strut, _super);
......@@ -488,11 +489,9 @@
return _this;
}
Strut.prototype.init = function () {
this._strut = new engine.Rect();
this._strut = new engine.Image(getTextureByName("ganzi"));
this.addChild(this._strut);
this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
};
Strut.prototype.onMouseDown = function (pierWidth, distance, callBack) {
......@@ -565,9 +564,7 @@
}
};
Strut.prototype.rest = function () {
this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
this._strut.height = 0;
this._strut.visible = false;
......@@ -661,6 +658,9 @@
this.initTouch();
this.registerEvent();
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
return [2];
});
});
......@@ -685,12 +685,18 @@
this.closeStrut();
this.changeBg(GameView.bgIndex);
this.startAnm();
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
};
GameView.prototype.revive = function () {
this._player.revive();
this.startAnm();
this._isTouchLayer = true;
this.closeStrut();
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
};
GameView.prototype.setGuide = function () {
var _this = this;
......@@ -722,6 +728,9 @@
};
GameView.prototype.onMouseDown = function () {
if (this._isTouchLayer && !this.inani) {
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": false
});
this._isMouseDown = true;
this._strut.onMouseDown(this._road.getFristPier(), this._road.getDistance(), this.goCallBcak.bind(this));
}
......@@ -768,6 +777,9 @@
x: carx
}, props.pierMoveTime);
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
this.closeStrut();
};
GameView.prototype.closeStrut = function () {
......@@ -793,7 +805,7 @@
}
};
GameView.bgIndex = 0;
GameView.speed = 10;
GameView.speed = 20;
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -178,6 +178,12 @@
"url": "//yun.duiba.com.cn/aurora/assets/57ad75aa036c04e13abcf32c464ff5ae37419495",
"uuid": "xiache",
"ext": ".svga"
},
{
"name": "ganzi",
"url": "//yun.duiba.com.cn/aurora/assets/501972d5960c29b7db1e476422e6fd3cb3a92c8f.png",
"uuid": "ganzi",
"ext": ".png"
}
],
"events": {
......@@ -222,6 +228,12 @@
"data": {
"score":0
}
},
"bjxd-game-inmove": {
"alias": "游戏进行状态",
"data": {
"canstop":false
}
}
}
}
......
......@@ -131,6 +131,9 @@ export default class GameView extends engine.Container {
this.initTouch();
this.registerEvent();
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
}
startAnm(){
this.inani = true;
......@@ -153,6 +156,9 @@ export default class GameView extends engine.Container {
this.closeStrut();
this.changeBg(GameView.bgIndex);
this.startAnm();
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
}
//复活
revive(){
......@@ -161,6 +167,9 @@ export default class GameView extends engine.Container {
this.startAnm();
this._isTouchLayer = true;
this.closeStrut();
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
}
//新手引导
setGuide(){
......@@ -243,6 +252,9 @@ export default class GameView extends engine.Container {
//鼠标事件
onMouseDown(){
if(this._isTouchLayer&&!this.inani){
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":false
});
this._isMouseDown = true;
this._strut.onMouseDown(this._road.getFristPier(),this._road.getDistance(),this.goCallBcak.bind(this));
}
......@@ -294,9 +306,11 @@ export default class GameView extends engine.Container {
engine.Tween.get(this.xiacheNode,{loop:false})
.to({
x:carx
},props.pierMoveTime);
},props.pierMoveTime)
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
this.closeStrut();
}
......@@ -331,7 +345,7 @@ export default class GameView extends engine.Container {
this._road.changeBg();
}
}
static speed = 10;
static speed = 20;
changeSpeed(speed){
if(GameView.speed!=speed){
GameView.speed = speed;
......
import { props } from "../props";
import GameView from "./GameView";
import {getTextureByName} from "./utils";
export class Strut extends engine.Container{
_strut: engine.Rect;
_strut: engine.Image;
_distance;
_callBack;
gany = 1005;
init(){
this._strut = new engine.Rect();
this._strut = new engine.Image(getTextureByName("ganzi"));
this.addChild(this._strut);
this._strut.width = props.strutWidth;
// this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
// this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
}
onMouseDown(pierWidth,distance,callBack){
......@@ -99,9 +99,9 @@ export class Strut extends engine.Container{
}
}
rest(){
this._strut.width = props.strutWidth;
// this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
// this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
this._strut.height = 0;
this._strut.visible = false;
......
......@@ -39,7 +39,7 @@
//# sourceMappingURL=utils.js.map
var qietu = (function (url, type1, rows, cols, parent) { return tslib.__awaiter(void 0, void 0, void 0, function () {
var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, r, startx, endx, c, starty, endy, uvs, isprite, ispritename, e_1;
var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, txt1, r, startx, endx, c, starty, endy, uvs, isprite, ispritename, e_1;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -68,7 +68,7 @@
})];
case 4:
_a.sent();
return [2, qietu(t, 1, rows, cols)];
return [2, qietu(t, 1, rows, cols, parent)];
case 5:
console.log('图片', t);
console.log("图片获取尺寸", mwid, mhei);
......@@ -107,6 +107,13 @@
startliy = chay / mhei;
addliy = (mwid / rows) / mhei;
}
console.log("切图准备", startlix, addlix, startliy, addliy, mwid, mhei);
txt1 = new engine.Label();
txt1.fillColor = "red";
txt1.size = 24;
txt1.text = startlix.toFixed(2) + ";" + addlix.toFixed(2) + ";" + startliy.toFixed(2) + ";" + addliy.toFixed(2) + ";" + mwid.toFixed(2) + ";" + mhei.toFixed(2) + ";";
parent.addChild(txt1);
txt1.y = -100;
for (r = 0; r < rows; r++) {
startx = startlix + addlix * r;
endx = startx + addlix;
......@@ -151,7 +158,6 @@
}
});
}); });
//# sourceMappingURL=qietu.js.map
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
......@@ -543,6 +549,7 @@
};
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
......
{"version":3,"file":"index.js","sources":["src/custom/pintu/src/props.ts","src/custom/pintu/src/game/utils.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\tconsole.log('loadImageByUrl----------:',url);\r\n\treturn new Promise((resolve) => {\r\n\t\tif (engine.TextureCache[url]) {\r\n\t\t\tresolve(engine.TextureCache[url])\r\n\t\t} else {\r\n\t\t\tvar t = engine.Texture.from(url);\r\n\t\t\tt.addEventListener(\"loaded\", () => { resolve(t) })\r\n\t\t}\r\n\t})\r\n}","import { props } from \"../props\";\r\nimport { loadImageByUrl } from \"./utils\";\r\nimport qietu from \"./qietu\";\r\nconst urls = [];\r\nconst picMap = {};\r\nconst posMap = {};\r\nexport default async(url:any,type1:number, rows:number, cols:number,parent:engine.Container) => {\r\n try{\r\n let t:engine.Texture;\r\n if(type1==1){\r\n console.log(\"直接使用已加载的tex\");\r\n t = url;\r\n }else{\r\n t = await loadImageByUrl(url) as engine.Texture;\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 console.log(\"调整222222222222\");\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 console.log('图片',t);\r\n console.log(\"图片获取尺寸\",mwid,mhei);\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 console.log(\"适配后的图片尺寸\",mwid,mhei);\r\n\r\n let picarr = {};\r\n let picnames = [];\r\n\r\n let chax;\r\n let chay;\r\n let startlix;\r\n let addlix;\r\n let startliy;\r\n let addliy;\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 }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 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 let isprite = new engine.Sprite(t);\r\n isprite.uvs = uvs;\r\n\r\n isprite.width = mwid1;\r\n isprite.height = mhei1;\r\n\r\n let ispritename = \"pic_\"+c+\"_\"+r;\r\n isprite.name = ispritename;\r\n picarr[ispritename] = isprite;\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 };\r\n }catch(e){\r\n console.error(\"图片加载失败\",e);\r\n console.log(url,rows,cols);\r\n return {\r\n res:false\r\n };\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\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<engine.Texture> = [];\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 async initgame(){\r\n console.log(\"initgame---------\");\r\n this.gameUrls = props.gameUrls;\r\n this.gameTimes = props.gameTimes;\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) as engine.Texture;\r\n this.onegamePics.push(lt);\r\n if(this.onegamePics.length==1){//第一张图加载完毕,自动填充\r\n this.startfirst();\r\n\r\n }\r\n }\r\n }\r\n async startfirst(){\r\n this.dicont.removeChildren();\r\n this.movesteps = 0;\r\n this.startime = Date.now();\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 = 2;\r\n }\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);\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 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.movesteps = 0;\r\n this.startime = Date.now();\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 console.log(\"start-----------------\",actidx);\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 = 2;\r\n }\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);\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 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,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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
{"version":3,"file":"index.js","sources":["src/custom/pintu/src/props.ts","src/custom/pintu/src/game/utils.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\tconsole.log('loadImageByUrl----------:',url);\r\n\treturn new Promise((resolve) => {\r\n\t\tif (engine.TextureCache[url]) {\r\n\t\t\tresolve(engine.TextureCache[url])\r\n\t\t} else {\r\n\t\t\tvar t = engine.Texture.from(url);\r\n\t\t\tt.addEventListener(\"loaded\", () => { resolve(t) })\r\n\t\t}\r\n\t})\r\n}","import { props } from \"../props\";\r\nimport { loadImageByUrl } from \"./utils\";\r\nimport qietu from \"./qietu\";\r\nconst urls = [];\r\nconst picMap = {};\r\nconst posMap = {};\r\nexport default async(url:any,type1:number, rows:number, cols:number,parent:engine.Container) => {\r\n try{\r\n let t:engine.Texture;\r\n if(type1==1){\r\n console.log(\"直接使用已加载的tex\");\r\n t = url;\r\n }else{\r\n t = await loadImageByUrl(url) as engine.Texture;\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 console.log(\"调整222222222222\");\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 console.log('图片',t);\r\n console.log(\"图片获取尺寸\",mwid,mhei);\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 console.log(\"适配后的图片尺寸\",mwid,mhei);\r\n\r\n let picarr = {};\r\n let picnames = [];\r\n\r\n let chax;\r\n let chay;\r\n let startlix;\r\n let addlix;\r\n let startliy;\r\n let addliy;\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 }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 \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 let isprite = new engine.Sprite(t);\r\n \r\n isprite.uvs = uvs;\r\n\r\n isprite.width = mwid1;\r\n isprite.height = mhei1;\r\n\r\n let ispritename = \"pic_\"+c+\"_\"+r;\r\n isprite.name = ispritename;\r\n picarr[ispritename] = isprite;\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 };\r\n }catch(e){\r\n console.error(\"图片加载失败\",e);\r\n console.log(url,rows,cols);\r\n return {\r\n res:false\r\n };\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\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<engine.Texture> = [];\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 async initgame(){\r\n console.log(\"initgame---------\");\r\n this.gameUrls = props.gameUrls;\r\n this.gameTimes = props.gameTimes;\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) as engine.Texture;\r\n this.onegamePics.push(lt);\r\n if(this.onegamePics.length==1){//第一张图加载完毕,自动填充\r\n this.startfirst();\r\n\r\n }\r\n }\r\n }\r\n async startfirst(){\r\n this.dicont.removeChildren();\r\n this.movesteps = 0;\r\n this.startime = Date.now();\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 = 2;\r\n }\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);\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 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.movesteps = 0;\r\n this.startime = Date.now();\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 console.log(\"start-----------------\",actidx);\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 = 2;\r\n }\r\n let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);\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 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;;;aACvC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAC,GAAG,CAAC,CA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number, rows:number, cols:number,parent:engin
startliy = chay/mhei;
addliy = (mwid/rows)/mhei;
}
console.log("切图准备",startlix,addlix,startliy,addliy,mwid,mhei);
let txt1 = new engine.Label();
txt1.fillColor = "red";
txt1.size = 24;
txt1.text = startlix.toFixed(2)+";"+addlix.toFixed(2)+";"+startliy.toFixed(2)+";"+addliy.toFixed(2)+";"+mwid.toFixed(2)+";"+mhei.toFixed(2)+";"
parent.addChild(txt1);
txt1.y = -100;
for(let r=0;r<rows;r++){
let startx = startlix+addlix*r;
let endx = startx + addlix;
......@@ -86,6 +94,7 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
endx
])
let isprite = new engine.Sprite(t);
isprite.uvs = uvs;
isprite.width = mwid1;
......
......@@ -564,7 +564,7 @@
var ntime = Date.now();
if (this.gamestat == 1) {
var passtime = ntime - this.lastframeTime;
if (ntime - this.lastatime >= 2000 && !this.ination && this.canation && this.selectArr.length == 0) {
if (ntime - this.lastatime >= 5000 && !this.ination && this.canation && this.selectArr.length == 0) {
this.attionEliShow();
}
if (this.gametime && this.gametime > 0) {
......@@ -602,11 +602,11 @@
this.lattices = {};
}
var testdata = [
[1, 2, 1, 4, 1],
[3, 1, 4, 5, 4],
[1, 2, 5, 3, 4],
[3, 1, 5, 4, 5],
[2, 5, 3, 5, 1],
[5, 4, 1, 2, 3],
[4, 1, 3, 1, 2],
[5, 4, 5, 2, 3],
[4, 1, 5, 5, 2],
];
this.levelData = testdata;
for (var r = 0; r < testdata.length; r++) {
......@@ -633,7 +633,7 @@
else {
this.selectArr = new Array();
var isdiedata = this.attionEliminate();
if (isdiedata && isdiedata.length == 2) {
if (isdiedata && isdiedata.length == 3) {
this.changeEnable(true);
}
else {
......@@ -660,6 +660,7 @@
var atname2 = this.lattices[arrcidx2];
var atnode1 = this.container.getChildByName(atname1);
var atnode2 = this.container.getChildByName(atname2);
var aboutnames = this.attiondata[2];
if (!atnode1 || !atnode2) {
this.attiondata = new Array();
return;
......@@ -672,6 +673,17 @@
atnode1.y = atpos1[1];
atnode2.x = atpos2[0];
atnode2.y = atpos2[1];
for (var i = 0; i < aboutnames.length; i++) {
var ircidx = aboutnames[i];
var iname1 = this.lattices[ircidx];
var inode1 = this.container.getChildByName(iname1);
if (inode1) {
engine.Tween.removeTweens(inode1);
var ipos1 = MapData.getRCPos(ircidx.split("_")[0], ircidx.split("_")[1]);
inode1.x = ipos1[0];
inode1.y = ipos1[1];
}
}
this.anicontainer.removeChild(this.jiantoucont);
}
};
......@@ -942,7 +954,7 @@
else {
this.selectArr = new Array();
isdiedata = this.attionEliminate();
if (isdiedata && isdiedata.length == 2) {
if (isdiedata && isdiedata.length == 3) {
this.inEliminate = false;
this.checkGameOver();
this.recordGame();
......@@ -1022,11 +1034,12 @@
};
GameView.prototype.attionEliShow = function () {
var attiondata = this.attionEliminate();
if (attiondata && attiondata.length == 2) {
if (attiondata && attiondata.length == 3) {
this.ination = true;
this.attiondata = [attiondata[0], attiondata[1]];
this.attiondata = [attiondata[0], attiondata[1], attiondata[2]];
var atname1 = this.lattices[attiondata[0]];
var atname2 = this.lattices[attiondata[1]];
var aboutnames = attiondata[2];
var atnode1 = this.container.getChildByName(atname1);
var atnode2 = this.container.getChildByName(atname2);
if (!atnode1 || !atnode2) {
......@@ -1038,7 +1051,6 @@
var aty2 = atnode2.y;
var lerpnum = 0.1;
var atpos1 = [(atx2 - atx1) * lerpnum + atx1, (aty2 - aty1) * lerpnum + aty1];
var atpos2 = [(atx1 - atx2) * lerpnum + atx2, (aty1 - aty2) * lerpnum + aty2];
engine.Tween.removeTweens(atnode1);
engine.Tween.removeTweens(atnode2);
engine.Tween.get(atnode1, {
......@@ -1051,28 +1063,39 @@
x: atx1,
y: aty1
}, 500);
engine.Tween.get(atnode2, { loop: true })
.to({
x: atpos2[0],
y: atpos2[1]
}, 500)
.to({
x: atx2,
y: aty2
}, 500);
var jtx = (atx2 - atx1) * 0.5 + atx1;
var jty = (aty2 - aty1) * 0.5 + aty1 + this.conty;
var chax1 = atx1 - atpos1[0];
var chay1 = aty1 - atpos1[1];
var roa1 = 0;
var movex1 = 0;
var movey1 = 0;
if (Math.abs(chax1) > Math.abs(chay1)) {
jty += 25;
console.log("横向移动");
movex1 = chax1;
}
else {
jtx += MapData.itemsize;
roa1 = 90;
console.log("竖向移动");
movey1 = chay1;
}
for (var i = 0; i < aboutnames.length; i++) {
var iname1 = this.lattices[aboutnames[i]];
var inode1 = this.container.getChildByName(iname1);
engine.Tween.removeTweens(inode1);
var iatx1 = inode1.x;
var iaty1 = inode1.y;
if (inode1) {
engine.Tween.get(inode1, { loop: true })
.to({
x: iatx1 + movex1,
y: iaty1 + movey1
}, 500)
.to({
x: iatx1,
y: iaty1
}, 500);
}
}
this.anicontainer.addChild(this.jiantoucont);
this.jiantoucont.x = jtx;
......@@ -1132,7 +1155,7 @@
this.lattices[key] = changeval;
}
var isdiedata = this.attionEliminate();
if (isdiedata && isdiedata.length == 2) {
if (isdiedata && isdiedata.length == 3) {
console.error("可以复活了,转移位置");
this.changeToFuHuoPos(type);
}
......@@ -1195,7 +1218,7 @@
GameView.prototype.attionEliminate = function () {
var attiondata;
for (var r = MapData.row - 1; r > -1; r--) {
if (attiondata && attiondata.length == 2) {
if (attiondata && attiondata.length == 3) {
break;
}
for (var c = MapData.col - 1; c > -1; c--) {
......@@ -1204,7 +1227,6 @@
var edatacol = this.getEliminateCol(r, c);
if (edatarow.length > 2 || edatacol.length > 2) ;
if (edatarow.length == 2) {
console.log("横向查找", edatarow, checktype);
var releidx1 = edatarow[0];
var releidx2 = edatarow[1];
var relerow1 = Number(releidx1.split("_")[0]);
......@@ -1220,14 +1242,14 @@
if (rightcol < MapData.col) {
var nexttype = this.getEleTypeByRc(downrow, rightcol);
if (nexttype == checktype) {
attiondata = [downrow + "_" + relecol, downrow + "_" + rightcol];
attiondata = [downrow + "_" + rightcol, downrow + "_" + relecol, edatarow];
break;
}
}
if (leftcol > -1) {
var nexttype = this.getEleTypeByRc(downrow, leftcol);
if (nexttype == checktype) {
attiondata = [downrow + "_" + relecol, downrow + "_" + leftcol];
attiondata = [downrow + "_" + leftcol, downrow + "_" + relecol, edatarow];
break;
}
}
......@@ -1236,14 +1258,14 @@
if (rightcol < MapData.col) {
var nexttype = this.getEleTypeByRc(uprow, rightcol);
if (nexttype == checktype) {
attiondata = [uprow + "_" + relecol, uprow + "_" + rightcol];
attiondata = [uprow + "_" + rightcol, uprow + "_" + relecol, edatarow];
break;
}
}
if (leftcol > -1) {
var nexttype = this.getEleTypeByRc(uprow, leftcol);
if (nexttype == checktype) {
attiondata = [uprow + "_" + relecol, uprow + "_" + leftcol];
attiondata = [uprow + "_" + leftcol, uprow + "_" + relecol, edatarow];
break;
}
}
......@@ -1251,20 +1273,19 @@
if (uprow1 > -1) {
var nexttype = this.getEleTypeByRc(uprow1, relecol);
if (nexttype == checktype) {
attiondata = [uprow + "_" + relecol, uprow1 + "_" + relecol];
attiondata = [uprow1 + "_" + relecol, uprow + "_" + relecol, edatarow];
break;
}
}
if (downrow1 < MapData.row) {
var nexttype = this.getEleTypeByRc(downrow1, relecol);
if (nexttype == checktype) {
attiondata = [downrow1 + "_" + relecol, downrow + "_" + relecol];
attiondata = [downrow1 + "_" + relecol, downrow + "_" + relecol, edatarow];
break;
}
}
}
if (edatacol.length == 2) {
console.log("竖向查找", edatacol, checktype);
var releidx1 = edatacol[0];
var releidx2 = edatacol[1];
var relerow = Number(releidx1.split("_")[0]);
......@@ -1280,14 +1301,14 @@
if (uprow > -1) {
var nexttype = this.getEleTypeByRc(uprow, leftcol);
if (nexttype == checktype) {
attiondata = [relerow + "_" + leftcol, uprow + "_" + leftcol];
attiondata = [uprow + "_" + leftcol, relerow + "_" + leftcol, edatacol];
break;
}
}
if (downrow < MapData.row) {
var nexttype = this.getEleTypeByRc(downrow, leftcol);
if (nexttype == checktype) {
attiondata = [relerow + "_" + leftcol, downrow + "_" + leftcol];
attiondata = [downrow + "_" + leftcol, relerow + "_" + leftcol, edatacol];
break;
}
}
......@@ -1296,14 +1317,14 @@
if (uprow > -1) {
var nexttype = this.getEleTypeByRc(uprow, rightcol);
if (nexttype == checktype) {
attiondata = [relerow + "_" + rightcol, uprow + "_" + rightcol];
attiondata = [uprow + "_" + rightcol, relerow + "_" + rightcol, edatacol];
break;
}
}
if (downrow < MapData.row) {
var nexttype = this.getEleTypeByRc(downrow, rightcol);
if (nexttype == checktype) {
attiondata = [relerow + "_" + rightcol, downrow + "_" + rightcol];
attiondata = [downrow + "_" + rightcol, relerow + "_" + rightcol, edatacol];
break;
}
}
......@@ -1311,28 +1332,27 @@
if (rightcol1 < MapData.col) {
var nexttype = this.getEleTypeByRc(relerow, rightcol1);
if (nexttype == checktype) {
attiondata = [relerow + "_" + rightcol1, relerow + "_" + rightcol];
attiondata = [relerow + "_" + rightcol1, relerow + "_" + rightcol, edatacol];
break;
}
}
if (leftcol1 > -1) {
var nexttype = this.getEleTypeByRc(relerow, leftcol1);
if (nexttype == checktype) {
attiondata = [relerow + "_" + leftcol1, relerow + "_" + leftcol];
attiondata = [relerow + "_" + leftcol1, relerow + "_" + leftcol, edatacol];
break;
}
}
}
var jianrow = this.getEliminateRowR(r, c);
if (jianrow.length == 2) {
console.log("中间插入33", jianrow);
var jianr = Number(jianrow[0].split("_")[0]) - 1;
var jianc = Number(jianrow[0].split("_")[1]);
var ljianc = jianc - 1;
if (ljianc > -1) {
var nexttype = this.getEleTypeByRc(jianr, ljianc);
if (nexttype == checktype) {
attiondata = [jianr + "_" + ljianc, jianr + "_" + jianc];
attiondata = [jianr + "_" + ljianc, jianr + "_" + jianc, jianrow];
break;
}
}
......@@ -1340,21 +1360,20 @@
if (rjianc < MapData.col) {
var nexttype = this.getEleTypeByRc(jianr, rjianc);
if (nexttype == checktype) {
attiondata = [jianr + "_" + rjianc, jianr + "_" + jianc];
attiondata = [jianr + "_" + rjianc, jianr + "_" + jianc, jianrow];
break;
}
}
}
var jiancol = this.getEliminateRowC(r, c);
if (jiancol.length == 2) {
console.log("中间插入44", jiancol);
var jianr = Number(jiancol[0].split("_")[0]);
var jianc = Number(jianrow[0].split("_")[1]) - 1;
var ujianr = jianr - 1;
if (ujianr > -1) {
var nexttype = this.getEleTypeByRc(ujianr, jianc);
if (nexttype == checktype) {
attiondata = [ujianr + "_" + jianc, jianr + "_" + jianc];
attiondata = [ujianr + "_" + jianc, jianr + "_" + jianc, jiancol];
break;
}
}
......@@ -1362,7 +1381,7 @@
if (djianr < MapData.row) {
var nexttype = this.getEleTypeByRc(djianr, jianc);
if (nexttype == checktype) {
attiondata = [djianr + "_" + jianc, jianr + "_" + jianc];
attiondata = [djianr + "_" + jianc, jianr + "_" + jianc, jiancol];
break;
}
}
......@@ -1602,6 +1621,7 @@
};
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -317,7 +317,7 @@ export default class GameView extends engine.Container {
let ntime = Date.now();
if(this.gamestat==1){
let passtime = ntime - this.lastframeTime;
if(ntime-this.lastatime>=2000&&!this.ination&&this.canation&&this.selectArr.length==0){
if(ntime-this.lastatime>=5000&&!this.ination&&this.canation&&this.selectArr.length==0){
this.attionEliShow();
}
if(this.gametime&&this.gametime>0){
......@@ -355,20 +355,20 @@ export default class GameView extends engine.Container {
this.lattices = {};
}
// let testdata = [
// [1,2,5,3,4],
// [3,1,5,4,5],
// [2,5,3,5,1],
// [5,4,5,2,3],
// [4,1,5,5,2],
// ];
let testdata = [
[1,2,1,4,1],
[3,1,4,5,4],
[1,2,5,3,4],
[3,1,5,4,5],
[2,5,3,5,1],
[5,4,1,2,3],
[4,1,3,1,2],
[5,4,5,2,3],
[4,1,5,5,2],
];
// let testdata = [
// [1,2,1,4,1],
// [3,1,4,5,4],
// [2,5,3,5,1],
// [5,4,1,2,3],
// [4,1,3,1,2],
// ];
this.levelData = testdata;
for(let r=0;r<testdata.length;r++){
......@@ -398,7 +398,7 @@ export default class GameView extends engine.Container {
}else{//一次操作完毕
this.selectArr = new Array();
let isdiedata = this.attionEliminate();
if(isdiedata&&isdiedata.length==2){//没死
if(isdiedata&&isdiedata.length==3){//没死
this.changeEnable(true);
}else{//死图处理
this.solveDieMap();
......@@ -427,6 +427,8 @@ export default class GameView extends engine.Container {
let atname2 = this.lattices[arrcidx2];
let atnode1:Element = this.container.getChildByName(atname1);
let atnode2:Element = this.container.getChildByName(atname2);
let aboutnames = this.attiondata[2];
if(!atnode1||!atnode2){
this.attiondata = new Array();
return;
......@@ -444,6 +446,20 @@ export default class GameView extends engine.Container {
atnode2.x = atpos2[0];
atnode2.y = atpos2[1];
for(let i=0;i<aboutnames.length;i++){
let ircidx = aboutnames[i];
let iname1 = this.lattices[ircidx];
let inode1:Element = this.container.getChildByName(iname1);
if(inode1){
engine.Tween.removeTweens(inode1);
let ipos1 = MapData.getRCPos(ircidx.split("_")[0],ircidx.split("_")[1]);
inode1.x = ipos1[0];
inode1.y = ipos1[1];
}
}
this.anicontainer.removeChild(this.jiantoucont);
}
}
......@@ -725,7 +741,7 @@ export default class GameView extends engine.Container {
this.selectArr = new Array();
let isdiedata = this.attionEliminate();
if(isdiedata&&isdiedata.length==2){//没死
if(isdiedata&&isdiedata.length==3){//没死
this.inEliminate = false;
this.checkGameOver();
this.recordGame();
......@@ -814,11 +830,13 @@ export default class GameView extends engine.Container {
//相邻显性提示
attionEliShow(){
let attiondata = this.attionEliminate();
if(attiondata&&attiondata.length==2){
// console.log("测试333",attiondata);
if(attiondata&&attiondata.length==3){
this.ination = true;
this.attiondata = [attiondata[0],attiondata[1]];
this.attiondata = [attiondata[0],attiondata[1],attiondata[2]];
let atname1 = this.lattices[attiondata[0]];
let atname2 = this.lattices[attiondata[1]];
let aboutnames = attiondata[2];
let atnode1:Element = this.container.getChildByName(atname1);
let atnode2:Element = this.container.getChildByName(atname2);
......@@ -850,15 +868,6 @@ export default class GameView extends engine.Container {
y:aty1
},500);
engine.Tween.get(atnode2,{loop:true})
.to({
x:atpos2[0],
y:atpos2[1]
},500)
.to({
x:atx2,
y:aty2
},500);
//箭头动画
let jtx = (atx2-atx1)*0.5+atx1;
......@@ -866,16 +875,49 @@ export default class GameView extends engine.Container {
let chax1 = atx1-atpos1[0];
let chay1 = aty1-atpos1[1];
let roa1 = 0;
let movex1 = 0;
let movey1 = 0;
if(Math.abs(chax1)>Math.abs(chay1)){
jty += 25;
console.log("横向移动");
// console.log("横向移动");
movex1 = chax1;
}else{
jtx += MapData.itemsize;
roa1 = 90;
console.log("竖向移动");
movey1 = chay1;
// console.log("竖向移动");
}
// console.log("位移llll",aboutnames);
for(let i=0;i<aboutnames.length;i++){
let iname1 = this.lattices[aboutnames[i]];
let inode1:Element = this.container.getChildByName(iname1);
engine.Tween.removeTweens(inode1);
let iatx1 = inode1.x;
let iaty1 = inode1.y;
if(inode1){
engine.Tween.get(inode1,{loop:true})
.to({
x:iatx1+movex1,
y:iaty1+movey1
},500)
.to({
x:iatx1,
y:iaty1
},500)
}
}
// engine.Tween.get(atnode2,{loop:true})
// .to({
// x:atpos2[0],
// y:atpos2[1]
// },500)
// .to({
// x:atx2,
// y:aty2
// },500);
this.anicontainer.addChild(this.jiantoucont);
this.jiantoucont.x = jtx;
......@@ -945,7 +987,7 @@ export default class GameView extends engine.Container {
this.lattices[key] = changeval;
}
let isdiedata = this.attionEliminate();
if(isdiedata&&isdiedata.length==2){
if(isdiedata&&isdiedata.length==3){
console.error("可以复活了,转移位置");
this.changeToFuHuoPos(type);
}else{
......@@ -1006,7 +1048,7 @@ export default class GameView extends engine.Container {
attionEliminate(){
let attiondata;
for(let r=MapData.row-1;r>-1;r--){
if(attiondata&&attiondata.length==2){
if(attiondata&&attiondata.length==3){
break;
}
for(let c=MapData.col-1;c>-1;c--){
......@@ -1019,7 +1061,7 @@ export default class GameView extends engine.Container {
// console.error("啥情况,检查----------------");
}
if(edatarow.length==2){
console.log("横向查找",edatarow,checktype);
// console.log("横向查找",edatarow,checktype);
let releidx1 = edatarow[0];
let releidx2 = edatarow[1];
......@@ -1039,7 +1081,7 @@ export default class GameView extends engine.Container {
if(rightcol<MapData.col){
let nexttype = this.getEleTypeByRc(downrow,rightcol);
if(nexttype==checktype){
attiondata = [downrow+"_"+relecol,downrow+"_"+rightcol];
attiondata = [downrow+"_"+rightcol,downrow+"_"+relecol,edatarow];
break;
}
}
......@@ -1047,7 +1089,7 @@ export default class GameView extends engine.Container {
if(leftcol>-1){
let nexttype = this.getEleTypeByRc(downrow,leftcol);
if(nexttype==checktype){
attiondata = [downrow+"_"+relecol,downrow+"_"+leftcol];
attiondata = [downrow+"_"+leftcol,downrow+"_"+relecol,edatarow];
break;
}
}
......@@ -1056,7 +1098,7 @@ export default class GameView extends engine.Container {
if(rightcol<MapData.col){
let nexttype = this.getEleTypeByRc(uprow,rightcol);
if(nexttype==checktype){
attiondata = [uprow+"_"+relecol,uprow+"_"+rightcol];
attiondata = [uprow+"_"+rightcol,uprow+"_"+relecol,edatarow];
break;
}
}
......@@ -1064,7 +1106,7 @@ export default class GameView extends engine.Container {
if(leftcol>-1){
let nexttype = this.getEleTypeByRc(uprow,leftcol);
if(nexttype==checktype){
attiondata = [uprow+"_"+relecol,uprow+"_"+leftcol];
attiondata = [uprow+"_"+leftcol,uprow+"_"+relecol,edatarow];
break;
}
}
......@@ -1072,20 +1114,20 @@ export default class GameView extends engine.Container {
if(uprow1>-1){
let nexttype = this.getEleTypeByRc(uprow1,relecol);
if(nexttype==checktype){
attiondata = [uprow+"_"+relecol,uprow1+"_"+relecol];
attiondata = [uprow1+"_"+relecol,uprow+"_"+relecol,edatarow];
break;
}
}
if(downrow1<MapData.row){
let nexttype = this.getEleTypeByRc(downrow1,relecol);
if(nexttype==checktype){
attiondata = [downrow1+"_"+relecol,downrow+"_"+relecol];
attiondata = [downrow1+"_"+relecol,downrow+"_"+relecol,edatarow];
break;
}
}
}
if(edatacol.length==2){
console.log("竖向查找",edatacol,checktype);
// console.log("竖向查找",edatacol,checktype);
let releidx1 = edatacol[0];
let releidx2 = edatacol[1];
......@@ -1105,14 +1147,14 @@ export default class GameView extends engine.Container {
if(uprow>-1){
let nexttype = this.getEleTypeByRc(uprow,leftcol);
if(nexttype==checktype){
attiondata = [relerow+"_"+leftcol,uprow+"_"+leftcol];
attiondata = [uprow+"_"+leftcol,relerow+"_"+leftcol,edatacol];
break;
}
}
if(downrow<MapData.row){
let nexttype = this.getEleTypeByRc(downrow,leftcol);
if(nexttype==checktype){
attiondata = [relerow+"_"+leftcol,downrow+"_"+leftcol];
attiondata = [downrow+"_"+leftcol,relerow+"_"+leftcol,edatacol];
break;
}
}
......@@ -1121,14 +1163,14 @@ export default class GameView extends engine.Container {
if(uprow>-1){
let nexttype = this.getEleTypeByRc(uprow,rightcol);
if(nexttype==checktype){
attiondata = [relerow+"_"+rightcol,uprow+"_"+rightcol];
attiondata = [uprow+"_"+rightcol,relerow+"_"+rightcol,edatacol];
break;
}
}
if(downrow<MapData.row){
let nexttype = this.getEleTypeByRc(downrow,rightcol);
if(nexttype==checktype){
attiondata = [relerow+"_"+rightcol,downrow+"_"+rightcol];
attiondata = [downrow+"_"+rightcol,relerow+"_"+rightcol,edatacol];
break;
}
}
......@@ -1136,14 +1178,14 @@ export default class GameView extends engine.Container {
if(rightcol1<MapData.col){
let nexttype = this.getEleTypeByRc(relerow,rightcol1);
if(nexttype==checktype){
attiondata = [relerow+"_"+rightcol1,relerow+"_"+rightcol];
attiondata = [relerow+"_"+rightcol1,relerow+"_"+rightcol,edatacol];
break;
}
}
if(leftcol1>-1){
let nexttype = this.getEleTypeByRc(relerow,leftcol1);
if(nexttype==checktype){
attiondata = [relerow+"_"+leftcol1,relerow+"_"+leftcol];
attiondata = [relerow+"_"+leftcol1,relerow+"_"+leftcol,edatacol];
break;
}
}
......@@ -1153,7 +1195,7 @@ export default class GameView extends engine.Container {
//中间插的,俩边一样的这种
let jianrow = this.getEliminateRowR(r,c);
if(jianrow.length==2){
console.log("中间插入33",jianrow);
// console.log("中间插入33",jianrow);
let jianr = Number(jianrow[0].split("_")[0])-1;
let jianc = Number(jianrow[0].split("_")[1]);
......@@ -1161,7 +1203,7 @@ export default class GameView extends engine.Container {
if(ljianc>-1){
let nexttype = this.getEleTypeByRc(jianr,ljianc);
if(nexttype==checktype){
attiondata = [jianr+"_"+ljianc,jianr+"_"+jianc];
attiondata = [jianr+"_"+ljianc,jianr+"_"+jianc,jianrow];
break;
}
}
......@@ -1169,7 +1211,7 @@ export default class GameView extends engine.Container {
if(rjianc<MapData.col){
let nexttype = this.getEleTypeByRc(jianr,rjianc);
if(nexttype==checktype){
attiondata = [jianr+"_"+rjianc,jianr+"_"+jianc];
attiondata = [jianr+"_"+rjianc,jianr+"_"+jianc,jianrow];
break;
}
}
......@@ -1177,7 +1219,7 @@ export default class GameView extends engine.Container {
let jiancol = this.getEliminateRowC(r,c);
if(jiancol.length==2){
console.log("中间插入44",jiancol);
// console.log("中间插入44",jiancol);
let jianr = Number(jiancol[0].split("_")[0]);
let jianc = Number(jianrow[0].split("_")[1])-1;
......@@ -1185,7 +1227,7 @@ export default class GameView extends engine.Container {
if(ujianr>-1){
let nexttype = this.getEleTypeByRc(ujianr,jianc);
if(nexttype==checktype){
attiondata = [ujianr+"_"+jianc,jianr+"_"+jianc];
attiondata = [ujianr+"_"+jianc,jianr+"_"+jianc,jiancol];
break;
}
}
......@@ -1193,7 +1235,7 @@ export default class GameView extends engine.Container {
if(djianr<MapData.row){
let nexttype = this.getEleTypeByRc(djianr,jianc);
if(nexttype==checktype){
attiondata = [djianr+"_"+jianc,jianr+"_"+jianc];
attiondata = [djianr+"_"+jianc,jianr+"_"+jianc,jiancol];
break;
}
}
......
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