Commit 2f353245 authored by rockyl's avatar rockyl

提交一波

parent e4726a61
......@@ -30,8 +30,9 @@
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<!--script src="http://localhost:4002/debug/engine.js"></script-->
<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>
<script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script>
......
{
"name": "叠叠高",
"desc": "叠叠高模块",
"props": {
"guideText": {
"alias": "引导文本",
"type": "string",
"default": "点击屏幕跳跃躲避飞来的钞票"
},
"guideFlagKey": {
"alias": "引导标识名",
"type": "string",
"default": "test"
},
"scoreWeights": {
"alias": "分值权重(完美,仅中央,正常,边缘,福袋)",
"type": "array<number>",
"default": "4,2,1,1,5"
},
"goldBagScoreMultiple": {
"alias": "出现钱袋的分数倍数",
"type": "number",
"default": 30
},
"goldBagScoreSubtraction": {
"alias": "出现钱袋的分数补偿",
"type": "number",
"default": 5
},
"goldBagDistance": {
"alias": "出现钱袋的距离",
"type": "number",
"default": 10
},
"goldBagJumpSubtraction": {
"alias": "跳起触碰钱袋高度偏差",
"type": "number",
"default": 6
},
"blockAssets": {
"alias": "方块素材组",
"type": "array<string>",
"default": "方块素材0"
},
"blockDurationRange": {
"alias": "方块进入时间范围",
"type": "array<number>",
"default": "500,1500"
},
"blockDurationRandom": {
"alias": "方块进入时间随机系数",
"type": "number",
"default": 0.2
},
"blockDurationStep": {
"alias": "方块进入时间递减",
"type": "number",
"default": 20
},
"gravity": {
"alias": "下落加速度",
"type": "number",
"default": 1.8
},
"scoreThreshold": {
"alias": "分数阈值数组",
"type": "number",
"default": 130
},
"blockWidth": {
"alias": "方块宽度",
"type": "number",
"default": 396
},
"blockHitWidth": {
"alias": "方块碰撞宽度",
"type": "number",
"default": 312
},
"blockHitHeight": {
"alias": "方块碰撞高度",
"type": "number",
"default": 66
},
"blockPaddingTop": {
"alias": "方块上边距",
"type": "number",
"default": 100
},
"blockPaddingBottom": {
"alias": "方块下边距",
"type": "number",
"default": 64
},
"minScale": {
"alias": "最小缩放比例",
"type": "number",
"default": 0.4
},
"maxScale": {
"alias": "最大缩放比例",
"type": "number",
"default": 0.7
},
"baseOffset": {
"alias": "底座偏移",
"type": "number",
"default": 500
},
"playerOffset": {
"alias": "角色偏移",
"type": "number",
"default": 120
},
"initBlockCount": {
"alias": "初始方块数量",
"type": "number",
"default": 1
},
"playerWidth": {
"alias": "角色宽度",
"type": "number",
"default": 100
},
"parachuteDistance": {
"alias": "降落距离",
"type": "number",
"default": 250
},
"jumpSpeed": {
"alias": "挑起速度",
"type": "number",
"default": 30
},
"parachuteDuration": {
"alias": "降落时间",
"type": "number",
"default": 3000
},
"hitAwayDistance": {
"alias": "撞开距离",
"type": "vector2",
"default": "250,50"
},
"hitAwayDuration": {
"alias": "撞开时间",
"type": "number",
"default": 1000
},
"playerReadyAnchor": {
"alias": "角色准备锚点",
"type": "vector2",
"default": "167,242"
},
"playerJumpAnchor": {
"alias": "角色跳起锚点",
"type": "vector2",
"default": "150,190"
},
"playerFallAnchor": {
"alias": "角色下落锚点",
"type": "vector2",
"default": "150,190"
},
"playerHitAnchor": {
"alias": "角色撞开锚点",
"type": "vector2",
"default": "200,290"
},
"playerParachuteAnchor": {
"alias": "角色降落锚点",
"type": "vector2",
"default": "160,310"
},
"playerLandNormalAnchor": {
"alias": "角色正常落地锚点",
"type": "vector2",
"default": "155,245"
},
"playerLandEffectAnchor": {
"alias": "角色落地特效锚点",
"type": "vector2",
"default": "310,100"
},
"playerLandSideAnchor": {
"alias": "角色边缘落地锚点",
"type": "vector2",
"default": "155,245"
},
"playerLandPrefectAnchor": {
"alias": "角色完美落地锚点",
"type": "vector2",
"default": "225,900"
},
"hitEffectAnchor": {
"alias": "被撞烟雾锚点",
"type": "vector2",
"default": "200,300"
},
"goldPackAnchor": {
"alias": "钱袋锚点",
"type": "vector2",
"default": "375,300"
},
"goldPackAvatarAnchor": {
"alias": "静态钱袋锚点",
"type": "vector2",
"default": "850,598"
}
},
"assets": [
{
"name": "背景图",
"url": "//yun.duiba.com.cn/aurora/assets/e6df446ccda45e3e6b6af8471dd1d27b4b3ea016.jpg",
"uuid": "43618417-f27f-429c-bba3-e0715e552ca2",
"ext": ".jpg"
},
{
"name": "底座",
"url": "//yun.duiba.com.cn/aurora/assets/1c0ba12a718076601b24ff63e5ab7ee59462deaa.png",
"uuid": "a6b3f654-2c26-434a-a873-aabc12cd1d80",
"ext": ".png"
},
{
"name": "引导遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/75cc4ea91654fd1e9900d071cac5ca5296b1bd19.png",
"uuid": "6879e370-59c1-453c-8d61-cd3d724ea650",
"ext": ".png"
},
{
"name": "准备立正",
"url": "//yun.duiba.com.cn/aurora/assets/883c41459f1700a17dd20a75b49717fc1b732030.svga",
"uuid": "25dc07d0-b223-4bab-8ea6-2f3282d4eb44",
"ext": ".svga"
},
{
"name": "跳上升",
"url": "//yun.duiba.com.cn/aurora/assets/5b7950568fdc540aad6444a944274ba0bf27571d.svga",
"uuid": "d0a20432-023b-4fd4-8595-f3bb726dfd5e",
"ext": ".svga"
},
{
"name": "跳下落",
"url": "//yun.duiba.com.cn/aurora/assets/7e2c1f241bf2cdcda5614b145910f3f2440ac473.svga",
"uuid": "f3b46174-3353-40c1-957f-fcd9c0227e04",
"ext": ".svga"
},
{
"name": "普通着地",
"url": "//yun.duiba.com.cn/aurora/assets/f7171bff5d525950b02dd578d705054c4ac09ad0.svga",
"uuid": "67b427ed-7dc6-475e-bcc3-a45554629d91",
"ext": ".svga"
},
{
"name": "着地特效",
"url": "//yun.duiba.com.cn/aurora/assets/f5a28ac3ef8acb9adc1ea59faf93213b56a797a0.svga",
"uuid": "cc3f6f1b-1dad-4023-a040-0c7c2ef0ca41",
"ext": ".svga"
},
{
"name": "完美着地特效",
"url": "//yun.duiba.com.cn/aurora/assets/27fa0246bb6e6af977fb29aebe19fbdb30ec03f5.svga",
"uuid": "839215b0-e5df-49db-852d-472a6a78510e",
"ext": ".svga"
},
{
"name": "边缘着地",
"url": "//yun.duiba.com.cn/aurora/assets/1eb7d525c85671c4ec3a40ab923c3142027d0d9e.svga",
"uuid": "33fabc67-c475-44bd-b403-9653abdf2d13",
"ext": ".svga"
},
{
"name": "被撞开",
"url": "//yun.duiba.com.cn/aurora/assets/30864d1f89748d1476232403ad6ab582cc806606.svga",
"uuid": "ecf58409-ecda-40f3-b152-70b0eb285caf",
"ext": ".svga"
},
{
"name": "被撞烟雾",
"url": "//yun.duiba.com.cn/aurora/assets/91841eb45559ee7f1f43378b74be10d9234aac61.svga",
"uuid": "5497949d-1f04-4403-acd8-e0191631f016",
"ext": ".svga"
},
{
"name": "降落",
"url": "//yun.duiba.com.cn/aurora/assets/eea97e28c37a2da354021f697476c7a31c8362f5.svga",
"uuid": "82b514a9-69c4-425c-a77d-f34efeef1997",
"ext": ".svga"
},
{
"name": "钱袋",
"url": "//yun.duiba.com.cn/aurora/assets/12d46f318471f2cff30306f3c0b0c506d67ee166.svga",
"uuid": "3b7feeae-ebb5-49cf-b838-64f46c585978",
"ext": ".svga"
},
{
"name": "钱袋-静态",
"url": "//yun.duiba.com.cn/aurora/assets/35116c957aa4161ea3444611530c0110a69919cf.png",
"uuid": "80a6f0f2-7934-4b2b-a1af-c566dae1040f",
"ext": ".png"
},
{
"name": "跳起音效",
"url": "//yun.duiba.com.cn/aurora/assets/8e3c6af83c20daff6ad34ff198413f0be4903039.mp3",
"uuid": "f9826065-0815-4b6d-be7f-b28478975c68",
"ext": ".mp3"
},
{
"name": "普通落地音效",
"url": "//yun.duiba.com.cn/aurora/assets/b83729366abd4c6aed590bf40bb3ad15e806c8d5.mp3",
"uuid": "dd2a8a0b-18ea-49a7-841d-221e1a3d2d50",
"ext": ".mp3"
},
{
"name": "边缘落地音效",
"url": "//yun.duiba.com.cn/aurora/assets/069079dea1901151594684de3ef294925556c1c3.mp3",
"uuid": "44bfc5ac-0093-4b40-8c8f-cef3000fb436",
"ext": ".mp3"
},
{
"name": "被撞开音效",
"url": "//yun.duiba.com.cn/aurora/assets/6f19e09e8a5300d59b069ed55b82ab8f8b876dc6.mp3",
"uuid": "f7cbf9ef-76b5-4ae8-9e05-680a3b0d223f",
"ext": ".mp3"
},
{
"name": "完美落地音效1",
"url": "//yun.duiba.com.cn/aurora/assets/c492aa71c3f385ae179977b328ec3d93c4c085e2.mp3",
"uuid": "8f5fea1d-d11f-4fd1-a27a-85b0145d54e5",
"ext": ".mp3"
},
{
"name": "完美落地音效2",
"url": "//yun.duiba.com.cn/aurora/assets/317e268d07cefddc69309941e38dbcf7d48f8ebc.mp3",
"uuid": "7452d198-9ab2-46e2-99e2-877fdce9fbe1",
"ext": ".mp3"
},
{
"name": "完美落地音效3",
"url": "//yun.duiba.com.cn/aurora/assets/5e7795c318bdf5357441085d0c681221274a72a9.mp3",
"uuid": "81209b74-d23a-4250-8695-284e9d9a6c00",
"ext": ".mp3"
},
{
"name": "完美落地音效4",
"url": "//yun.duiba.com.cn/aurora/assets/7a62f51f550ea3968fe080ee56abf28be8a92f8c.mp3",
"uuid": "ff87ce4f-c3bd-49ec-b890-4215bedb921d",
"ext": ".mp3"
},
{
"name": "降落伞下落音效",
"url": "//yun.duiba.com.cn/aurora/assets/eb4246b47a8fc2c5707d764bee2cd6a710bdc13e.mp3",
"uuid": "adb5d3ab-143f-4648-a2c4-ff794aceb2fd",
"ext": ".mp3"
},
{
"name": "撞击钱袋音效",
"url": "//yun.duiba.com.cn/aurora/assets/a6e1c99e49f258a42d65ac00b81c5a2b103aa172.mp3",
"uuid": "f06fb9b4-ef76-43ff-80ad-0f920e2ce69c",
"ext": ".mp3"
}
],
"events": {
"in": {
"jump-high-reset": {
"alias": "重置"
},
"jump-high-start": {
"alias": "开始"
},
"jump-high-revive": {
"alias": "复活"
},
"jump-high-pause": {
"alias": "暂停"
},
"jump-high-resume": {
"alias": "恢复"
}
},
"out": {
"jump-high-game-start": {
"alias": "游戏开始",
"data": {}
},
"jump-high-game-end": {
"alias": "游戏结束",
"data": {}
},
"jump-high-score": {
"alias": "分数变化",
"data": {
"type": "类型(0:完美,1:仅中央,2:正常,3:边缘,4:钱袋)",
"score": "分数",
"scoreAdd": "增值分数"
}
}
}
},
"id": "jump-high",
"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['jump-high'] = factory(global.tslib));\n}(this, (function (tslib) { 'use strict';\n\n\tvar props = {};\n\tfunction prepareProps() {\n\t var metaProps = getProps();\n\t engine.injectProp(props, metaProps);\n\t}\n\tfunction injectProps(p) {\n\t engine.injectProp(props, p);\n\t}\n\t//# sourceMappingURL=props.js.map\n\n\tfunction getTexture(uuid) {\n\t return engine.Texture.from(getAssetByUUID(uuid).uuid);\n\t}\n\tfunction getTextureByName(name) {\n\t return getTexture(engine.getAssetByName(name).uuid);\n\t}\n\tfunction getBlockAsset(type) {\n\t return engine.getAssetByName(props.blockAssets[type]);\n\t}\n\tfunction createSvga(name, anchorName) {\n\t var inst = new svga.Svga();\n\t inst.source = 'asset://' + engine.getAssetByName(name).uuid;\n\t var anchor = props[(anchorName)];\n\t if (anchor) {\n\t inst.x = -anchor.x;\n\t inst.y = -anchor.y;\n\t inst.anchorX = anchor.x;\n\t inst.anchorY = anchor.y;\n\t }\n\t return inst;\n\t}\n\tfunction playSound(name) {\n\t engine.playSound(engine.getAssetByName(name).uuid, { keep: true });\n\t}\n\t//# sourceMappingURL=utils.js.map\n\n\tvar Block = (function (_super) {\n\t tslib.__extends(Block, _super);\n\t function Block() {\n\t var _this = _super.call(this) || this;\n\t var body = _this.body = new svga.Svga();\n\t body.x = -props.blockWidth / 2;\n\t body.y = -props.blockHitHeight - props.blockPaddingTop;\n\t _this.addChild(body);\n\t return _this;\n\t }\n\t Block.prototype.reset = function (_a) {\n\t var type = _a.type;\n\t this.dir = Math.random() > 0.5 ? 1 : -1;\n\t if (this.type != type) {\n\t this.type = type;\n\t var asset = getBlockAsset(type);\n\t this.body.source = 'asset://' + asset.uuid;\n\t }\n\t this.scaleX = this.dir;\n\t this.body.gotoAndStop(1);\n\t };\n\t Block.prototype.playEnter = function (index, animation) {\n\t var _this = this;\n\t this.visible = true;\n\t this.x = this.dir * this.stage.width;\n\t var _a = props.blockDurationRange, min = _a[0], max = _a[1];\n\t var duration = Math.max(max - index * props.blockDurationStep, min);\n\t duration = duration + max * Math.random() * props.blockDurationRandom * (Math.random() > 0.5 ? 1 : -1);\n\t return new Promise(function (resolve) {\n\t if (animation) {\n\t engine.Tween.get(_this, null, null, true)\n\t .to({ x: 0, }, duration)\n\t .call(resolve);\n\t }\n\t else {\n\t _this.x = 0;\n\t setTimeout(function () {\n\t console.log(_this.body);\n\t }, 200);\n\t resolve();\n\t }\n\t });\n\t };\n\t Block.prototype.playLeave = function () {\n\t this.visible = false;\n\t };\n\t Block.prototype.playEffect = function () {\n\t var body = this.body;\n\t body.play(true, false);\n\t body.once(engine.Event.END_FRAME, function () {\n\t body.gotoAndStop(1);\n\t }, this);\n\t };\n\t Block.prototype.stop = function () {\n\t engine.Tween.removeTweens(this);\n\t };\n\t return Block;\n\t}(engine.Container));\n\t//# sourceMappingURL=Block.js.map\n\n\tvar Background = (function (_super) {\n\t tslib.__extends(Background, _super);\n\t function Background() {\n\t return _super.call(this) || this;\n\t }\n\t Background.prototype.setup = function () {\n\t var _a = this.stage, width = _a.width, height = _a.height;\n\t var bg = this._bg = new engine.Image(getTextureByName('背景图'));\n\t bg.anchorX = bg.width / 2;\n\t bg.anchorY = bg.height / 2;\n\t bg.x = -(bg.width - width) / 2;\n\t bg.y = -(bg.height - height) / 2;\n\t this.addChild(bg);\n\t this._minScale = width / bg.width;\n\t };\n\t Background.prototype.playZoom = function (type, duration) {\n\t var _this = this;\n\t if (duration === void 0) { duration = 700; }\n\t return new Promise(function (resolve) {\n\t var scale = type === 'in' ? 1 : _this._minScale;\n\t engine.Tween.get(_this._bg, null, null, true)\n\t .to({ scaleX: scale, scaleY: scale }, duration, engine.Ease.cubicInOut)\n\t .call(resolve);\n\t });\n\t };\n\t return Background;\n\t}(engine.Container));\n\t//# sourceMappingURL=Background.js.map\n\n\tvar svgaAssets = {\n\t aniReady: { name: '准备立正', dir: 1 },\n\t aniJump: { name: '跳上升', dir: 1 },\n\t aniFall: { name: '跳下落', dir: 1 },\n\t aniLandNormal: { name: '普通着地', dir: 1 },\n\t aniLandSide: { name: '边缘着地', dir: -1 },\n\t aniHit: { name: '被撞开', dir: -1 },\n\t aniParachute: { name: '降落', dir: -1 },\n\t};\n\tvar Player = (function (_super) {\n\t tslib.__extends(Player, _super);\n\t function Player() {\n\t var _this = _super.call(this) || this;\n\t _this.g = props.gravity;\n\t _this.addEventListener(engine.Event.ENTER_FRAME, _this.onEnterFrame, _this);\n\t return _this;\n\t }\n\t Player.prototype.switchAni = function (name, dir, play, loop) {\n\t var _this = this;\n\t if (dir === void 0) { dir = 1; }\n\t if (play === void 0) { play = true; }\n\t if (loop === void 0) { loop = false; }\n\t return new Promise(function (resolve) {\n\t _this.scaleX = dir;\n\t if (_this._aniName !== name) {\n\t _this._aniName = name;\n\t var oldAni = _this.removeChild(_this.getChildByName('body'));\n\t if (oldAni) {\n\t oldAni.stop();\n\t }\n\t var ani = _this._currentAni = _this['ani' + name];\n\t _this.addChild(ani);\n\t if (play) {\n\t ani.play(false, loop);\n\t if (loop) {\n\t resolve();\n\t }\n\t else {\n\t ani.once(engine.Event.END_FRAME, resolve);\n\t }\n\t }\n\t else {\n\t ani.gotoAndStop(1);\n\t resolve();\n\t }\n\t }\n\t });\n\t };\n\t Player.prototype.setup = function () {\n\t this.prefectEffect = createSvga('完美着地特效', 'playerLandPrefectAnchor');\n\t this.landEffect = createSvga('着地特效', 'playerLandEffectAnchor');\n\t for (var key in svgaAssets) {\n\t var _a = svgaAssets[key], name = _a.name, dir = _a.dir;\n\t var body = this[key] = createSvga(name, key.replace('ani', 'player') + 'Anchor');\n\t body.name = 'body';\n\t body.scaleX = dir;\n\t }\n\t };\n\t Player.prototype.reset = function (revive) {\n\t this.x = 0;\n\t this.rotation = 0;\n\t this.scaleX = this.scaleY = 1;\n\t this._prefectLandCounting = 0;\n\t engine.Tween.removeTweens(this);\n\t if (revive) {\n\t this.switchAni('Jump', 1, false);\n\t }\n\t };\n\t Player.prototype.playReady = function () {\n\t var _this = this;\n\t return new Promise(function (resolve) {\n\t _this.switchAni('Ready', 1);\n\t _this._currentAni.once(engine.Event.END_FRAME, function () {\n\t this.switchAni('Jump', 1, false);\n\t resolve();\n\t }, _this);\n\t });\n\t };\n\t Player.prototype.onEnterFrame = function (event) {\n\t if (!this.playing) {\n\t return;\n\t }\n\t this.vy += this.g;\n\t this.y += this.vy;\n\t if (this.vy > 0 && this._aniName !== 'Fall') {\n\t this.dispatchEvent('jump-on-top');\n\t this.switchAni('Fall');\n\t }\n\t if (this.y > this.baseY) {\n\t this.y = this.baseY;\n\t this.playing = false;\n\t this.jumpPromise && this.jumpPromise({\n\t aboveBlock: this.aboveBlock,\n\t });\n\t this.jumpPromise = null;\n\t }\n\t };\n\t Player.prototype.changeBaseY = function (v) {\n\t if (this.baseY == v) {\n\t return;\n\t }\n\t this.aboveBlock = true;\n\t this.baseY = v;\n\t };\n\t Player.prototype.jump = function () {\n\t var _this = this;\n\t playSound('跳起音效');\n\t this.switchAni('Jump', 1, false);\n\t this._currentAni.play(false, false);\n\t this.aboveBlock = false;\n\t this.playing = true;\n\t this.baseY = this.y;\n\t this.vy = -props.jumpSpeed;\n\t return new Promise(function (resolve) {\n\t _this.jumpPromise = resolve;\n\t });\n\t };\n\t Player.prototype.playLand = function (type, dir) {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var _a, prefectEffect_1, landEffect_1;\n\t return tslib.__generator(this, function (_b) {\n\t switch (_b.label) {\n\t case 0:\n\t _a = type;\n\t switch (_a) {\n\t case 0: return [3, 1];\n\t case 1: return [3, 3];\n\t case 2: return [3, 3];\n\t case 3: return [3, 4];\n\t }\n\t return [3, 5];\n\t case 1:\n\t this._prefectLandCounting++;\n\t playSound('完美落地音效' + Math.min(4, this._prefectLandCounting));\n\t prefectEffect_1 = this.prefectEffect;\n\t this.addChildAt(prefectEffect_1, 0);\n\t prefectEffect_1.gotoAndPlay(1);\n\t prefectEffect_1.once(engine.Event.END_FRAME, function () {\n\t this.removeChild(prefectEffect_1);\n\t }, this);\n\t landEffect_1 = this.landEffect;\n\t this.addChildAt(landEffect_1, 0);\n\t landEffect_1.gotoAndPlay(1);\n\t landEffect_1.once(engine.Event.END_FRAME, function () {\n\t this.removeChild(landEffect_1);\n\t }, this);\n\t return [4, this.switchAni('LandNormal')];\n\t case 2:\n\t _b.sent();\n\t return [3, 5];\n\t case 3:\n\t this._prefectLandCounting = 0;\n\t playSound('普通落地音效');\n\t this.switchAni('LandNormal');\n\t return [3, 5];\n\t case 4:\n\t this._prefectLandCounting = 0;\n\t playSound('边缘落地音效');\n\t this.switchAni('LandSide', dir);\n\t return [3, 5];\n\t case 5: return [2];\n\t }\n\t });\n\t });\n\t };\n\t Player.prototype.hitAway = function (dir) {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var _this = this;\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t this.jumpPromise && this.jumpPromise();\n\t this.jumpPromise = null;\n\t playSound('被撞开音效');\n\t this.switchAni('Hit', dir);\n\t this.vy = 0;\n\t return [4, new Promise(function (resolve) {\n\t engine.Tween.get(_this)\n\t .to({\n\t x: -dir * props.hitAwayDistance.x,\n\t }, props.hitAwayDuration, engine.Ease.quartOut);\n\t engine.Tween.get(_this)\n\t .to({\n\t y: _this.y + props.hitAwayDistance.y,\n\t }, props.hitAwayDuration, engine.Ease.cubicOut)\n\t .call(resolve);\n\t })];\n\t case 1:\n\t _a.sent();\n\t return [2];\n\t }\n\t });\n\t });\n\t };\n\t Player.prototype.parachute = function (dir) {\n\t var _this = this;\n\t this.switchAni('Parachute', dir);\n\t return new Promise(function (resolve) {\n\t engine.Tween.get(_this)\n\t .wait(200)\n\t .call(function () {\n\t playSound('降落伞下落音效');\n\t })\n\t .wait(300)\n\t .to({ y: _this.y + props.parachuteDistance }, props.parachuteDuration)\n\t .set({ anchorOffsetY: 0 })\n\t .call(resolve);\n\t });\n\t };\n\t return Player;\n\t}(engine.Container));\n\t//# sourceMappingURL=Player.js.map\n\n\tvar Base = (function (_super) {\n\t tslib.__extends(Base, _super);\n\t function Base() {\n\t return _super.call(this, getTextureByName('底座')) || this;\n\t }\n\t Base.prototype.setup = function () {\n\t this.x = -(this.width) / 2;\n\t };\n\t Base.prototype.reset = function () {\n\t this.y = -props.baseOffset;\n\t };\n\t return Base;\n\t}(engine.Image));\n\t//# sourceMappingURL=Base.js.map\n\n\tvar GuideLayer = (function (_super) {\n\t tslib.__extends(GuideLayer, _super);\n\t function GuideLayer() {\n\t var _this = _super.call(this) || this;\n\t _this.setup();\n\t return _this;\n\t }\n\t GuideLayer.prototype.setup = function () {\n\t };\n\t GuideLayer.prototype.show = function (id, options) {\n\t var _this = this;\n\t return new Promise(function (resolve) {\n\t _this.visible = true;\n\t if (!_this.guideMask) {\n\t var _a = _this.stage, width = _a.width, height = _a.height;\n\t var guideMask = _this.guideMask = new engine.Container();\n\t var guideHole = new engine.Image(getTextureByName('引导遮罩'));\n\t guideHole.x = (width - guideHole.width) / 2;\n\t guideHole.y = options.y;\n\t guideMask.addChild(guideHole);\n\t _this.createRect(guideMask, 0, 0, width, guideHole.y);\n\t _this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);\n\t _this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);\n\t _this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);\n\t var label = _this.label = new engine.Label();\n\t label.fillColor = 'white';\n\t label.size = 25;\n\t label.text = props.guideText;\n\t label.x = (width - label.width) / 2;\n\t label.y = guideHole.y + guideHole.height + 50;\n\t guideMask.addChild(label);\n\t _this.addChild(guideMask);\n\t }\n\t _this.once(engine.MouseEvent.CLICK, function () {\n\t this.visible = false;\n\t resolve();\n\t }, _this);\n\t });\n\t };\n\t GuideLayer.prototype.createRect = function (container, x, y, width, height) {\n\t var rect = new engine.Rect();\n\t rect.x = x;\n\t rect.y = y;\n\t rect.width = width;\n\t rect.height = height;\n\t rect.fillColor = 'black';\n\t rect.alpha = 0.7;\n\t container.addChild(rect);\n\t };\n\t return GuideLayer;\n\t}(engine.Container));\n\t//# sourceMappingURL=GuideLayer.js.map\n\n\tvar GoldBag = (function (_super) {\n\t tslib.__extends(GoldBag, _super);\n\t function GoldBag() {\n\t var _this = _super.call(this) || this;\n\t _this.setup();\n\t return _this;\n\t }\n\t GoldBag.prototype.setup = function () {\n\t var avatar = this.avatar = new engine.Sprite(getTextureByName('钱袋-静态'));\n\t avatar.x = -props.goldPackAvatarAnchor.x;\n\t avatar.y = -props.goldPackAvatarAnchor.y;\n\t this.addChild(avatar);\n\t var svga = this.svga = createSvga('钱袋', 'goldPackAnchor');\n\t svga.visible = false;\n\t this.addChild(svga);\n\t };\n\t GoldBag.prototype.reset = function (data) {\n\t this.y = data.y;\n\t this.avatar.visible = true;\n\t this.svga.visible = false;\n\t this.svga.gotoAndStop(1);\n\t this.remain = data.remain;\n\t };\n\t GoldBag.prototype.playOpen = function () {\n\t var _this = this;\n\t this.avatar.visible = false;\n\t this.svga.visible = true;\n\t return new Promise(function (resolve) {\n\t _this.svga.play(true, false);\n\t _this.svga.once(engine.Event.END_FRAME, function () {\n\t this.svga.visible = false;\n\t resolve();\n\t }, _this);\n\t });\n\t };\n\t return GoldBag;\n\t}(engine.Container));\n\t//# sourceMappingURL=GoldBag.js.map\n\n\tvar ObjectPool = engine.ObjectPool;\n\tvar PoolName = 'gold-bag';\n\tObjectPool.registerPool(PoolName, function () {\n\t return new GoldBag();\n\t}, function (item, data) {\n\t item.reset(data);\n\t});\n\tvar GameView = (function (_super) {\n\t tslib.__extends(GameView, _super);\n\t function GameView() {\n\t var _this = _super.call(this) || this;\n\t _this.index = -1;\n\t _this.goldBags = [];\n\t _this.baseOffset = -props.baseOffset + props.playerOffset;\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\n\t return _this;\n\t }\n\t GameView.prototype.setup = function () {\n\t if (this._hasSetup) {\n\t return;\n\t }\n\t this._hasSetup = true;\n\t var _a = this.stage, width = _a.width, height = _a.height;\n\t var background = this.background = new Background();\n\t this.addChild(background);\n\t background.setup();\n\t var frontContainer = this.frontContainer = new engine.Container();\n\t frontContainer.x = width / 2;\n\t this.addChild(frontContainer);\n\t var guideLayer = this.guideLayer = new GuideLayer();\n\t this.addChild(guideLayer);\n\t var base = this.base = new Base();\n\t frontContainer.addChild(base);\n\t base.setup();\n\t var blockContainer = this.blockContainer = new engine.Container();\n\t frontContainer.addChild(blockContainer);\n\t var player = this.player = new Player();\n\t frontContainer.addChild(player);\n\t player.setup();\n\t player.addEventListener('jump-on-top', this.onPlayerJumpOnTop, this);\n\t ObjectPool.recycleObject(PoolName, ObjectPool.getObject(PoolName, {\n\t y: 0,\n\t remain: 0,\n\t }));\n\t this.hitEffect = createSvga('被撞烟雾', 'hitEffectAnchor');\n\t this.pos = 0;\n\t this.background.setup();\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);\n\t this.reset();\n\t };\n\t GameView.prototype.reset = function (revive) {\n\t if (revive === void 0) { revive = false; }\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var blockContainer, i, li, block, i, i, li, goldBag;\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t this.base.reset();\n\t this.index = -1;\n\t this._score = 0;\n\t if (revive) ;\n\t else {\n\t this.pos = 0;\n\t blockContainer = this.blockContainer;\n\t for (i = 0, li = blockContainer.children.length; i < li; i++) {\n\t block = blockContainer.getChildAt(i);\n\t block.playLeave();\n\t }\n\t }\n\t for (i = 0; i < props.initBlockCount; i++) {\n\t this.addBlock(false);\n\t }\n\t for (i = 0, li = this.goldBags.length; i < li; i++) {\n\t goldBag = this.goldBags[i];\n\t this.frontContainer.removeChild(goldBag);\n\t ObjectPool.recycleObject(PoolName, goldBag);\n\t }\n\t this.goldBags.splice(0);\n\t this.playZoom('in');\n\t return [4, this.resetPlayer(revive)];\n\t case 1:\n\t _a.sent();\n\t return [2];\n\t }\n\t });\n\t });\n\t };\n\t GameView.prototype.resetPlayer = function (revive) {\n\t if (revive === void 0) { revive = false; }\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t return tslib.__generator(this, function (_a) {\n\t this.player.reset(revive);\n\t this.player.y = this.baseOffset - (this.index + 1) * props.blockHitHeight;\n\t return [2];\n\t });\n\t });\n\t };\n\t GameView.prototype.start = function (revive) {\n\t if (revive === void 0) { revive = false; }\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var guideFlagKey, guideFlag;\n\t var _this = this;\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t if (!!revive) return [3, 2];\n\t return [4, this.player.playReady()];\n\t case 1:\n\t _a.sent();\n\t _a.label = 2;\n\t case 2:\n\t guideFlagKey = 'jump-high-guide_' + props.guideFlagKey;\n\t guideFlag = localStorage.getItem(guideFlagKey);\n\t if (!!guideFlag) return [3, 4];\n\t localStorage.setItem(guideFlagKey, '1');\n\t return [4, this.guideLayer.show('', { y: this.stage.height + this.player.y - 280 })];\n\t case 3:\n\t _a.sent();\n\t _a.label = 4;\n\t case 4:\n\t this.lastLandType = 0;\n\t this._remainToShowGoldBag = props.goldBagScoreMultiple - props.goldBagScoreSubtraction;\n\t this._touchEnabled = true;\n\t setTimeout(function () {\n\t _this.addBlock();\n\t }, 100);\n\t engine.globalEvent.dispatchEvent('jump-high-game-start');\n\t return [2];\n\t }\n\t });\n\t });\n\t };\n\t GameView.prototype.pause = function () {\n\t if (this.currentBlock) {\n\t engine.Tween.pauseTweens(this.currentBlock);\n\t }\n\t engine.Tween.pauseTweens(this.player);\n\t };\n\t GameView.prototype.resume = function () {\n\t if (this.currentBlock) {\n\t engine.Tween.resumeTweens(this.currentBlock);\n\t }\n\t engine.Tween.resumeTweens(this.player);\n\t };\n\t GameView.prototype.revive = function () {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t this.blockContainer.getChildAt(this.index).visible = false;\n\t this.index--;\n\t return [4, this.resetPlayer(true)];\n\t case 1:\n\t _a.sent();\n\t return [4, this.playZoom('in')];\n\t case 2:\n\t _a.sent();\n\t this.start(true);\n\t return [2];\n\t }\n\t });\n\t });\n\t };\n\t GameView.prototype.addBlock = function (animation) {\n\t var _this = this;\n\t if (animation === void 0) { animation = true; }\n\t this.index++;\n\t var blockContainer = this.blockContainer;\n\t var block;\n\t if (blockContainer.children.length > this.index) {\n\t block = blockContainer.getChildAt(this.index);\n\t block.visible = true;\n\t }\n\t else {\n\t block = new Block();\n\t blockContainer.addChild(block);\n\t }\n\t block.reset({\n\t type: Math.floor(Math.random() * props.blockAssets.length),\n\t });\n\t block.y = this.baseOffset - this.index * props.blockHitHeight;\n\t this.blockComplete = false;\n\t block.playEnter(this.index, animation).then(function (data) {\n\t _this.blockComplete = true;\n\t });\n\t if (animation) {\n\t this.needHitTest = true;\n\t }\n\t this.currentBlock = block;\n\t };\n\t GameView.prototype.addGoldBag = function () {\n\t var goldBag = ObjectPool.getObject(PoolName, {\n\t y: this.baseOffset - (this.blockCount + props.goldBagDistance + props.goldBagJumpSubtraction) * props.blockHitHeight,\n\t remain: props.goldBagDistance,\n\t });\n\t this.frontContainer.addChild(goldBag);\n\t this.goldBags.push(goldBag);\n\t };\n\t GameView.prototype.playOpenGoldBag = function () {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var i, li, goldBag;\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t i = 0, li = this.goldBags.length;\n\t _a.label = 1;\n\t case 1:\n\t if (!(i < li)) return [3, 4];\n\t goldBag = this.goldBags[i];\n\t goldBag.remain--;\n\t if (!(goldBag.remain <= 0)) return [3, 3];\n\t this.goldBags.splice(i, 1);\n\t i--;\n\t li--;\n\t this.nextToUpdateScore = true;\n\t return [4, goldBag.playOpen()];\n\t case 2:\n\t _a.sent();\n\t this.frontContainer.removeChild(goldBag);\n\t ObjectPool.recycleObject(PoolName, goldBag);\n\t _a.label = 3;\n\t case 3:\n\t i++;\n\t return [3, 1];\n\t case 4: return [2];\n\t }\n\t });\n\t });\n\t };\n\t GameView.prototype.onPlayerJumpOnTop = function () {\n\t if (this.nextToUpdateScore) {\n\t this.nextToUpdateScore = false;\n\t this.scoreChange(4);\n\t playSound('撞击钱袋音效');\n\t }\n\t };\n\t Object.defineProperty(GameView.prototype, \"blockCount\", {\n\t get: function () {\n\t return this.index - props.initBlockCount + 1;\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(GameView.prototype, \"pos\", {\n\t get: function () {\n\t return this._pos;\n\t },\n\t set: function (v) {\n\t this._pos = v;\n\t this.updatePos();\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t GameView.prototype.updatePos = function () {\n\t this.frontContainer.y = this.stage.height + this._pos;\n\t };\n\t GameView.prototype.onEnterFrame = function (event) {\n\t if (this.needHitTest) {\n\t if (this.currentBlock) {\n\t var _a = this.currentBlock, bx = _a.x, by = _a.y, dir = _a.dir;\n\t var _b = this.player, px = _b.x, py = _b.y;\n\t var blockHitWidth = props.blockHitWidth, blockHitHeight = props.blockHitHeight, playerWidth = props.playerWidth;\n\t var hitOn = false;\n\t if (Math.abs(px - bx) < (blockHitWidth + playerWidth) / 2) {\n\t this.player.changeBaseY(by - blockHitHeight);\n\t if (py > by - blockHitHeight) {\n\t hitOn = true;\n\t }\n\t }\n\t if (hitOn) {\n\t this.onHitOn(dir);\n\t }\n\t }\n\t }\n\t };\n\t GameView.prototype.onHitOn = function (dir) {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t this._touchEnabled = false;\n\t this.needHitTest = false;\n\t clearInterval(this.timer);\n\t this.currentBlock.stop();\n\t this.playHitEffect(dir);\n\t return [4, this.player.hitAway(dir)];\n\t case 1:\n\t _a.sent();\n\t this.playZoom('out');\n\t return [4, this.player.parachute(dir)];\n\t case 2:\n\t _a.sent();\n\t engine.globalEvent.dispatchEvent('jump-high-game-end');\n\t return [2];\n\t }\n\t });\n\t });\n\t };\n\t GameView.prototype.jump = function () {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var result, pos, type, lastLandType;\n\t var _this = this;\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t if (!this._touchEnabled) {\n\t return [2];\n\t }\n\t this._touchEnabled = false;\n\t this.playOpenGoldBag();\n\t return [4, this.player.jump()];\n\t case 1:\n\t result = _a.sent();\n\t if (!result) return [3, 5];\n\t if (!result.aboveBlock) return [3, 4];\n\t pos = Math.abs(this.currentBlock.x);\n\t type = 0;\n\t if (pos > 0) {\n\t type = pos > 0 && pos < props.scoreThreshold ? 2 : 3;\n\t }\n\t lastLandType = this.lastLandType;\n\t this.lastLandType = type;\n\t if (type === 0) {\n\t if (lastLandType !== type) {\n\t type = 1;\n\t }\n\t }\n\t if (type < 3) {\n\t this.currentBlock.playEffect();\n\t }\n\t this.player.playLand(type, this.currentBlock.dir);\n\t this.currentBlock.stop();\n\t this.scoreChange(type);\n\t return [4, this.playShake()];\n\t case 2:\n\t _a.sent();\n\t return [4, new Promise(function (resolve) {\n\t engine.Tween.get(_this, null, null, true)\n\t .to({ pos: props.blockHitHeight * _this.index }, 300, engine.Ease.cubicOut)\n\t .call(resolve);\n\t })];\n\t case 3:\n\t _a.sent();\n\t this.addBlock();\n\t _a.label = 4;\n\t case 4:\n\t this._touchEnabled = true;\n\t _a.label = 5;\n\t case 5: return [2];\n\t }\n\t });\n\t });\n\t };\n\t GameView.prototype.scoreChange = function (type) {\n\t var scoreAdd = props.scoreWeights[type];\n\t this._score += scoreAdd;\n\t this._remainToShowGoldBag -= scoreAdd;\n\t var score = this._score;\n\t engine.globalEvent.dispatchEvent('jump-high-score', {\n\t type: type,\n\t score: score,\n\t scoreAdd: scoreAdd,\n\t });\n\t console.log(score, this._remainToShowGoldBag);\n\t if (this._remainToShowGoldBag <= 0) {\n\t this._remainToShowGoldBag += props.goldBagScoreMultiple;\n\t this.addGoldBag();\n\t console.log('addGoldBag');\n\t }\n\t };\n\t GameView.prototype.playHitEffect = function (dir) {\n\t var hitEffect = this.hitEffect;\n\t hitEffect.scaleX = dir;\n\t hitEffect.y = this.player.y - props.hitEffectAnchor.y;\n\t hitEffect.play(true, false);\n\t hitEffect.once(engine.Event.END_FRAME, function () {\n\t this.frontContainer.removeChild(hitEffect);\n\t }, this);\n\t this.frontContainer.addChild(hitEffect);\n\t };\n\t GameView.prototype.playZoom = function (type, duration) {\n\t var _this = this;\n\t if (duration === void 0) { duration = 700; }\n\t this.background.playZoom(type, duration);\n\t var count = this.stage.height / props.blockHitHeight;\n\t return new Promise(function (resolve) {\n\t _this.frontContainer.anchorY = -props.blockHitHeight * (_this.index + count * 1.3) + props.baseOffset;\n\t var scale = type === 'in' ? 1 : Math.min((_this.stage.height / props.blockHitHeight / (_this.index + count)), props.maxScale);\n\t console.log(scale);\n\t engine.Tween.get(_this.frontContainer, null, null, true)\n\t .to({ scaleX: scale, scaleY: scale }, duration, engine.Ease.cubicInOut)\n\t .call(resolve);\n\t });\n\t };\n\t GameView.prototype.playShake = function () {\n\t var _this = this;\n\t var _a = this.frontContainer, x = _a.x, y = _a.y;\n\t return new Promise(function (resolve) {\n\t var shakeOffset = 7;\n\t var duration = 30;\n\t engine.Tween.get(_this.frontContainer, null, null, true)\n\t .to({ x: x, y: y - shakeOffset }, duration)\n\t .to({ x: x, y: y + shakeOffset }, duration)\n\t .to({ x: x + shakeOffset, y: y }, duration)\n\t .to({ x: x - shakeOffset, y: y }, duration)\n\t .to({ x: x, y: y }, duration)\n\t .call(resolve);\n\t });\n\t };\n\t return GameView;\n\t}(engine.Container));\n\n\tvar JumpHigh = (function (_super) {\n\t tslib.__extends(JumpHigh, _super);\n\t function JumpHigh() {\n\t var _this = _super.call(this) || this;\n\t engine.globalEvent.addEventListener('jump-high-reset', _this.reset, _this);\n\t engine.globalEvent.addEventListener('jump-high-start', _this.start, _this);\n\t engine.globalEvent.addEventListener('jump-high-pause', _this.pause, _this);\n\t engine.globalEvent.addEventListener('jump-high-resume', _this.resume, _this);\n\t engine.globalEvent.addEventListener('jump-high-revive', _this.revive, _this);\n\t _this.addEventListener(engine.MouseEvent.MOUSE_DOWN, _this.onTap, _this);\n\t var gameView = _this._gameView = new GameView();\n\t _this.addChild(gameView);\n\t return _this;\n\t }\n\t JumpHigh.prototype.reset = function () {\n\t this._gameView.reset();\n\t };\n\t JumpHigh.prototype.start = function (event) {\n\t {\n\t injectProps(event.data);\n\t }\n\t this._status = 1;\n\t this._gameView.start();\n\t };\n\t JumpHigh.prototype.pause = function () {\n\t this._gameView.pause();\n\t };\n\t JumpHigh.prototype.resume = function () {\n\t this._gameView.resume();\n\t };\n\t JumpHigh.prototype.revive = function () {\n\t this._gameView.revive();\n\t };\n\t JumpHigh.prototype.onTap = function (event) {\n\t this._gameView.jump();\n\t };\n\t return JumpHigh;\n\t}(engine.Container));\n\t//# sourceMappingURL=JumpHigh.js.map\n\n\tfunction index (props) {\n\t prepareProps();\n\t injectProps(props);\n\t var instance = new JumpHigh();\n\t return instance;\n\t}\n\t//# sourceMappingURL=index.js.map\n\n\treturn index;\n\n})));\n"
}
{
"name": "口红机",
"desc": "口红机模块",
"props": {
"guideText": {
"alias": "引导文本",
"type": "string",
"default": "点击屏幕将口红插到水果盘上\n射击时不可碰到口红"
},
"guideFlagKey": {
"alias": "引导标识名",
"type": "string",
"default": "test"
},
"rotationRange": {
"alias": "旋转角度范围",
"type": "array<number>",
"default": "90,360"
},
"rotationDurationMultipleRandom": {
"alias": "旋转时间是角度差的随机值",
"type": "number",
"default": 5
},
"rotationDurationMultipleBase": {
"alias": "旋转时间是角度差的倍数基数",
"type": "number",
"default": 3
},
"breakUpRatios": {
"alias": "圆盘破裂角度比例",
"type": "array<number>",
"default": "10,170,270,370"
},
"breakUpDistanceRange": {
"alias": "圆盘裂开距离",
"type": "array<number>",
"default": "10,20"
},
"turntableFallDuration": {
"alias": "圆盘掉落时间",
"type": "number",
"default": 800
},
"turntableFallDistance": {
"alias": "圆盘掉落距离",
"type": "number",
"default": 600
},
"stickInsertDepth": {
"alias": "口红插入深度",
"type": "number",
"default": 20
},
"stickAngle": {
"alias": "口红所占角度",
"type": "number",
"default": 4.5
},
"stickDistance": {
"alias": "口红到圆盘的距离",
"type": "number",
"default": 400
},
"stickSendDuration": {
"alias": "口红发射时间",
"type": "number",
"default": 200
},
"stickFallDistance": {
"alias": "口红掉落距离",
"type": "number",
"default": 400
},
"lipstickCount": {
"alias": "口红数量",
"type": "number",
"default": 2
}
},
"assets": [
{
"name": "引导遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/75cc4ea91654fd1e9900d071cac5ca5296b1bd19.png",
"uuid": "6879e370-59c1-453c-8d61-cd3d724ea650",
"ext": ".png"
},
{
"name": "口红素材",
"url": "//yun.duiba.com.cn/aurora/assets/7afc62bec2625dbd45f54c5a3564c40e73122b51.png",
"uuid": "bc4a0ad3-0d5a-4082-a6da-5f5ede371ed5",
"ext": ".png"
}
],
"events": {
"in": {
"lipstick-turntable-reset": {
"alias": "重置",
"data": {
"turntableAssetName": "转盘素材名",
"lipstickCount": "口红数量",
"countDown": "倒计时(s)"
}
},
"lipstick-turntable-start": {
"alias": "开始"
},
"lipstick-turntable-revive": {
"alias": "复活"
},
"lipstick-turntable-pause": {
"alias": "暂停"
},
"lipstick-turntable-resume": {
"alias": "恢复"
},
"lipstick-turntable-clear": {
"alias": "清空,通过reset事件恢复"
}
},
"out": {
"lipstick-turntable-game-success": {
"alias": "游戏成功",
"data": {}
},
"lipstick-turntable-game-failed": {
"alias": "游戏失败",
"data": {
"reason": "失败原因(1:超时,2:碰到口红)"
}
},
"lipstick-turntable-hit": {
"alias": "成功射中",
"data": {
"remain": "剩余口红数"
}
},
"lipstick-turntable-countdown": {
"alias": "倒计时",
"data": {
"second": "倒计时秒数"
}
}
}
},
"id": "lipstick-turntable",
"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['lipstick-turntable'] = factory(global.tslib));\n}(this, (function (tslib) { 'use strict';\n\n\tvar props = {};\n\tfunction prepareProps() {\n\t var metaProps = getProps();\n\t engine.injectProp(props, metaProps);\n\t}\n\tfunction injectProps(p) {\n\t engine.injectProp(props, p);\n\t}\n\t//# sourceMappingURL=props.js.map\n\n\tfunction getTexture(uuid) {\n\t return engine.Texture.from(getAssetByUUID(uuid).uuid);\n\t}\n\tfunction getTextureByName(name) {\n\t return getTexture(engine.getAssetByName(name).uuid);\n\t}\n\n\tvar GuideLayer = (function (_super) {\n\t tslib.__extends(GuideLayer, _super);\n\t function GuideLayer() {\n\t var _this = _super.call(this) || this;\n\t _this.setup();\n\t return _this;\n\t }\n\t GuideLayer.prototype.setup = function () {\n\t };\n\t GuideLayer.prototype.show = function (id, options) {\n\t var _this = this;\n\t return new Promise(function (resolve) {\n\t _this.visible = true;\n\t if (!_this.guideMask) {\n\t var _a = _this.stage, width = _a.width, height = _a.height;\n\t var guideMask = _this.guideMask = new engine.Container();\n\t var guideHole = new engine.Image(getTextureByName('引导遮罩'));\n\t guideHole.x = (width - guideHole.width) / 2;\n\t guideHole.y = options.y;\n\t guideMask.addChild(guideHole);\n\t _this.createRect(guideMask, 0, 0, width, guideHole.y);\n\t _this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);\n\t _this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);\n\t _this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);\n\t var label = _this.label = new engine.Label();\n\t label.fillColor = 'white';\n\t label.size = 25;\n\t label.text = props.guideText;\n\t label.x = (width - label.width) / 2;\n\t label.y = guideHole.y + guideHole.height + 50;\n\t guideMask.addChild(label);\n\t _this.addChild(guideMask);\n\t }\n\t _this.once(engine.MouseEvent.CLICK, function () {\n\t this.visible = false;\n\t resolve();\n\t }, _this);\n\t });\n\t };\n\t GuideLayer.prototype.createRect = function (container, x, y, width, height) {\n\t var rect = new engine.Rect();\n\t rect.x = x;\n\t rect.y = y;\n\t rect.width = width;\n\t rect.height = height;\n\t rect.fillColor = 'black';\n\t rect.alpha = 0.7;\n\t container.addChild(rect);\n\t };\n\t return GuideLayer;\n\t}(engine.Container));\n\t//# sourceMappingURL=GuideLayer.js.map\n\n\tvar Stick = (function (_super) {\n\t tslib.__extends(Stick, _super);\n\t function Stick() {\n\t var _this = _super.call(this) || this;\n\t var body = _this._body = new engine.Sprite(getTextureByName('口红素材'));\n\t body.anchorY = _this._body.height / 2;\n\t body.x = -body.width / 2;\n\t _this.addChild(body);\n\t return _this;\n\t }\n\t Stick.prototype.reset = function () {\n\t this.visible = true;\n\t this.rotation = 0;\n\t this.anchorOffsetY = 0;\n\t var body = this._body;\n\t body.y = 0;\n\t body.rotation = 0;\n\t };\n\t Stick.prototype.playSend = function (y, callback) {\n\t this._toY = y;\n\t engine.Tween.get(this)\n\t .to({ y: y }, props.stickSendDuration)\n\t .call(callback);\n\t };\n\t Stick.prototype.stopSend = function () {\n\t engine.Tween.removeTweens(this);\n\t };\n\t Stick.prototype.playFall = function () {\n\t var _this = this;\n\t return new Promise(function (resolve) {\n\t engine.Tween.get(_this, null, null, true)\n\t .to({ rotation: 30, y: _this._toY + props.stickFallDistance }, 500, engine.Ease.cubicOut)\n\t .call(resolve);\n\t });\n\t };\n\t Object.defineProperty(Stick.prototype, \"anchorOffsetY\", {\n\t set: function (v) {\n\t this._body.y = v;\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t return Stick;\n\t}(engine.Container));\n\t//# sourceMappingURL=Stick.js.map\n\n\tvar ObjectPool = engine.ObjectPool;\n\tvar PoolName = 'stick';\n\tObjectPool.registerPool(PoolName, function () {\n\t return new Stick();\n\t}, function (item, data) {\n\t item.reset();\n\t});\n\t//# sourceMappingURL=object-pool-init.js.map\n\n\tvar BreakUpPart = (function (_super) {\n\t tslib.__extends(BreakUpPart, _super);\n\t function BreakUpPart(turntable, from, to) {\n\t var _this = _super.call(this) || this;\n\t var body = _this._body = new engine.Image();\n\t _this.addChild(body);\n\t var mask = _this._body.mask = new engine.Graphics();\n\t _this.addChild(mask);\n\t _this._turntable = turntable;\n\t _this._from = from;\n\t _this._to = to;\n\t _this._fromR = from * Math.PI / 180;\n\t _this._toR = to * Math.PI / 180;\n\t return _this;\n\t }\n\t BreakUpPart.prototype.updateMask = function () {\n\t var mask = this._body.mask;\n\t mask.beginFill(0xff0000);\n\t mask.moveTo(0, 0);\n\t mask.arc(0, 0, this._turntable.radius + 5, this._fromR, this._toR);\n\t mask.endFill();\n\t var _a = props.breakUpDistanceRange, min = _a[0], max = _a[1];\n\t var mid = (this._toR - this._fromR) / 2 + this._fromR;\n\t this.x = Math.cos(mid) * Math.random() * max + min;\n\t this.y = Math.sin(mid) * Math.random() * max + min;\n\t this.alpha = 1;\n\t this.rotation = 0;\n\t };\n\t BreakUpPart.prototype.playFall = function (rotation) {\n\t var _this = this;\n\t this._body.rotation = rotation;\n\t return new Promise(function (resolve) {\n\t var angle = (_this._to - _this._from) / 2 + _this._from;\n\t var rotation = (angle > 270 ? 360 : 0) + 90 - angle;\n\t engine.Tween.get(_this, null, null, true)\n\t .to({ y: _this.y + props.turntableFallDistance, alpha: 0, rotation: rotation }, props.turntableFallDuration, engine.Ease.cubicIn)\n\t .call(resolve);\n\t });\n\t };\n\t Object.defineProperty(BreakUpPart.prototype, \"body\", {\n\t get: function () {\n\t return this._body;\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t return BreakUpPart;\n\t}(engine.Container));\n\t//# sourceMappingURL=BreakUpPart.js.map\n\n\tvar ObjectPool$1 = engine.ObjectPool;\n\tvar Turntable = (function (_super) {\n\t tslib.__extends(Turntable, _super);\n\t function Turntable() {\n\t var _this = _super.call(this) || this;\n\t _this._items = [];\n\t var wrapper = _this._wrapper = new engine.Container();\n\t _this.addChild(wrapper);\n\t var stickContainer = _this._stickContainer = new engine.Container();\n\t wrapper.addChild(stickContainer);\n\t var body = _this._body = new engine.Image();\n\t wrapper.addChild(body);\n\t var breakUpContainer = _this._breakUpContainer = new engine.Container();\n\t for (var i = 0, li = props.breakUpRatios.length - 1; i < li; i++) {\n\t var part = new BreakUpPart(_this, props.breakUpRatios[i], props.breakUpRatios[i + 1]);\n\t breakUpContainer.addChild(part);\n\t }\n\t breakUpContainer.visible = false;\n\t _this.addChild(breakUpContainer);\n\t return _this;\n\t }\n\t Turntable.prototype.resetAsset = function (body, asset) {\n\t body.source = asset;\n\t body.x = -body.width / 2;\n\t body.y = -body.height / 2;\n\t body.anchorX = -body.x;\n\t body.anchorY = -body.y;\n\t };\n\t Turntable.prototype.reset = function (options) {\n\t var turntableAssetName = options.turntableAssetName;\n\t this.rotationRange = props.rotationRange;\n\t var body = this._body;\n\t body.visible = true;\n\t this.resetAsset(body, turntableAssetName);\n\t this._radius = body.width / 2;\n\t this.hideSticks();\n\t for (var _i = 0, _a = this._breakUpContainer.children; _i < _a.length; _i++) {\n\t var part = _a[_i];\n\t this.resetAsset(part.body, turntableAssetName);\n\t part.updateMask();\n\t }\n\t this._breakUpContainer.visible = false;\n\t };\n\t Object.defineProperty(Turntable.prototype, \"radius\", {\n\t get: function () {\n\t return this._radius;\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Turntable.prototype.start = function () {\n\t this._dir = 1;\n\t this._items.splice(0);\n\t this.rotateOnce();\n\t };\n\t Turntable.prototype.pause = function () {\n\t engine.Tween.pauseTweens(this._wrapper);\n\t };\n\t Turntable.prototype.resume = function () {\n\t engine.Tween.resumeTweens(this._wrapper);\n\t };\n\t Turntable.prototype.addStick = function (stick) {\n\t var angle = this.parseAngle(this._wrapper.rotation);\n\t var minDis = props.stickAngle * 2;\n\t var hitOn = false;\n\t for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n\t var item = _a[_i];\n\t if (Math.abs(item - angle) < minDis) {\n\t hitOn = true;\n\t break;\n\t }\n\t }\n\t if (hitOn) {\n\t this.pause();\n\t }\n\t else {\n\t this._items.push(angle);\n\t stick.anchorOffsetY = stick.y;\n\t stick.y = 0;\n\t stick.rotation = -this._wrapper.rotation;\n\t this._stickContainer.addChild(stick);\n\t this.shake();\n\t }\n\t return hitOn;\n\t };\n\t Turntable.prototype.parseAngle = function (r) {\n\t var round = r % 360;\n\t if (round < 0) {\n\t round += 360;\n\t }\n\t return round;\n\t };\n\t Turntable.prototype.hideSticks = function () {\n\t for (var _i = 0, _a = this._stickContainer.children; _i < _a.length; _i++) {\n\t var stick = _a[_i];\n\t ObjectPool$1.recycleObject(PoolName, stick);\n\t }\n\t this._stickContainer.removeChildren();\n\t };\n\t Turntable.prototype.playBreakUp = function () {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t var p, _i, _a, part;\n\t return tslib.__generator(this, function (_b) {\n\t switch (_b.label) {\n\t case 0:\n\t this.pause();\n\t this._body.visible = false;\n\t this._breakUpContainer.visible = true;\n\t for (_i = 0, _a = this._breakUpContainer.children; _i < _a.length; _i++) {\n\t part = _a[_i];\n\t p = part.playFall(this._wrapper.rotation);\n\t }\n\t return [4, p];\n\t case 1:\n\t _b.sent();\n\t return [2];\n\t }\n\t });\n\t });\n\t };\n\t Turntable.prototype.shake = function () {\n\t engine.Tween.get(this, null, null, true)\n\t .to({ y: this.y - 5 }, 50)\n\t .to({ y: this.y }, 50);\n\t };\n\t Turntable.prototype.rotateOnce = function () {\n\t var _a = this.rotationRange, min = _a[0], max = _a[1];\n\t var dealtRotation = Math.random() * max + min;\n\t var duration = dealtRotation * (Math.random() * props.rotationDurationMultipleRandom + props.rotationDurationMultipleBase);\n\t var rotation = this._wrapper.rotation + this._dir * dealtRotation;\n\t this._dir *= -1;\n\t engine.Tween.get(this._wrapper, null, null, true)\n\t .to({ rotation: rotation }, duration)\n\t .call(this.rotateOnce, this);\n\t };\n\t return Turntable;\n\t}(engine.Container));\n\t//# sourceMappingURL=Turntable.js.map\n\n\tvar ObjectPool$2 = engine.ObjectPool;\n\tvar GameView = (function (_super) {\n\t tslib.__extends(GameView, _super);\n\t function GameView() {\n\t var _this = _super.call(this) || this;\n\t _this.countDownStep = function (decrease) {\n\t if (decrease === void 0) { decrease = true; }\n\t if (decrease) {\n\t _this._countdown--;\n\t if (_this._countdown <= 0) {\n\t _this.stopCountDown();\n\t _this.onTimeout();\n\t }\n\t }\n\t engine.globalEvent.dispatchEvent('lipstick-turntable-countdown', {\n\t second: _this._countdown,\n\t });\n\t };\n\t _this.onHit = function () { return tslib.__awaiter(_this, void 0, void 0, function () {\n\t var stick;\n\t return tslib.__generator(this, function (_a) {\n\t switch (_a.label) {\n\t case 0:\n\t stick = this._stick;\n\t if (!this.turntable.addStick(stick)) return [3, 2];\n\t this.stopCountDown();\n\t return [4, stick.playFall()];\n\t case 1:\n\t _a.sent();\n\t engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {\n\t reason: 2,\n\t });\n\t return [3, 5];\n\t case 2:\n\t this._counting--;\n\t engine.globalEvent.dispatchEvent('lipstick-turntable-hit', {\n\t remain: this._counting,\n\t });\n\t if (!(this._counting === 0)) return [3, 4];\n\t this.turntable.hideSticks();\n\t this.stopCountDown();\n\t return [4, this.turntable.playBreakUp()];\n\t case 3:\n\t _a.sent();\n\t engine.globalEvent.dispatchEvent('lipstick-turntable-game-success');\n\t return [3, 5];\n\t case 4:\n\t this.prepareStick();\n\t _a.label = 5;\n\t case 5: return [2];\n\t }\n\t });\n\t }); };\n\t _this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);\n\t return _this;\n\t }\n\t GameView.prototype.setup = function () {\n\t if (this._hasSetup) {\n\t return;\n\t }\n\t this._hasSetup = true;\n\t var turntable = this.turntable = new Turntable();\n\t this.addChild(turntable);\n\t var guideLayer = this.guideLayer = new GuideLayer();\n\t this.addChild(guideLayer);\n\t };\n\t GameView.prototype.reset = function (revive, options) {\n\t if (options === void 0) { options = null; }\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t return tslib.__generator(this, function (_a) {\n\t if (options) {\n\t this.turntable.reset(options);\n\t this.recycleStick();\n\t }\n\t else {\n\t this.prepareStick();\n\t }\n\t return [2];\n\t });\n\t });\n\t };\n\t GameView.prototype.start = function () {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t return tslib.__generator(this, function (_a) {\n\t this._countdown = props.countDown;\n\t this._counting = props.lipstickCount;\n\t this.turntable.start();\n\t this.prepareStick();\n\t this.countDownStep(false);\n\t this.startCountDown();\n\t return [2];\n\t });\n\t });\n\t };\n\t GameView.prototype.startCountDown = function () {\n\t this._timer = setInterval(this.countDownStep, 1000);\n\t };\n\t GameView.prototype.stopCountDown = function () {\n\t if (this._timer) {\n\t clearInterval(this._timer);\n\t this._timer = null;\n\t }\n\t };\n\t GameView.prototype.prepareStick = function () {\n\t var stick = this._stick = ObjectPool$2.getObject(PoolName);\n\t stick.y = props.stickDistance;\n\t this.addChildAt(stick, 0);\n\t this._touchEnabled = true;\n\t };\n\t GameView.prototype.recycleStick = function () {\n\t var stick = this._stick;\n\t if (stick) {\n\t this._stick = null;\n\t this.removeChild(stick);\n\t ObjectPool$2.recycleObject(PoolName, stick);\n\t }\n\t };\n\t GameView.prototype.pause = function () {\n\t this.turntable.pause();\n\t this._stick.stopSend();\n\t this._stick.playFall();\n\t this.stopCountDown();\n\t };\n\t GameView.prototype.resume = function () {\n\t this.recycleStick();\n\t this.turntable.resume();\n\t this.startCountDown();\n\t };\n\t GameView.prototype.revive = function () {\n\t return tslib.__awaiter(this, void 0, void 0, function () {\n\t return tslib.__generator(this, function (_a) {\n\t this.recycleStick();\n\t this.prepareStick();\n\t this.turntable.resume();\n\t return [2];\n\t });\n\t });\n\t };\n\t GameView.prototype.onTimeout = function () {\n\t this.pause();\n\t this._touchEnabled = false;\n\t engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {\n\t reason: 1,\n\t });\n\t };\n\t GameView.prototype.tap = function (e) {\n\t if (!this._touchEnabled) {\n\t return;\n\t }\n\t this._touchEnabled = false;\n\t this._stick.playSend(this.turntable.radius - props.stickInsertDepth, this.onHit);\n\t };\n\t return GameView;\n\t}(engine.Container));\n\t//# sourceMappingURL=GameView.js.map\n\n\tvar GameWrapper = (function (_super) {\n\t tslib.__extends(GameWrapper, _super);\n\t function GameWrapper() {\n\t var _this = _super.call(this) || this;\n\t engine.globalEvent.addEventListener('lipstick-turntable-reset', _this.reset, _this);\n\t engine.globalEvent.addEventListener('lipstick-turntable-start', _this.start, _this);\n\t engine.globalEvent.addEventListener('lipstick-turntable-pause', _this.pause, _this);\n\t engine.globalEvent.addEventListener('lipstick-turntable-resume', _this.resume, _this);\n\t engine.globalEvent.addEventListener('lipstick-turntable-revive', _this.revive, _this);\n\t engine.globalEvent.addEventListener('lipstick-turntable-clear', _this.clear, _this);\n\t _this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);\n\t var gameView = _this._gameView = new GameView();\n\t _this.addChild(gameView);\n\t return _this;\n\t }\n\t GameWrapper.prototype.reset = function (event) {\n\t injectProps(event.data);\n\t this._gameView.visible = true;\n\t this._gameView.reset(false, event.data);\n\t };\n\t GameWrapper.prototype.start = function (event) {\n\t injectProps(event.data);\n\t this._status = 1;\n\t this._gameView.start();\n\t };\n\t GameWrapper.prototype.pause = function () {\n\t this._gameView.pause();\n\t };\n\t GameWrapper.prototype.resume = function () {\n\t this._gameView.resume();\n\t };\n\t GameWrapper.prototype.revive = function () {\n\t this._gameView.revive();\n\t };\n\t GameWrapper.prototype.clear = function () {\n\t this._gameView.visible = false;\n\t };\n\t GameWrapper.prototype.onTap = function (event) {\n\t this._gameView.tap(event);\n\t };\n\t return GameWrapper;\n\t}(engine.Container));\n\t//# sourceMappingURL=GameWrapper.js.map\n\n\tfunction index (props) {\n\t prepareProps();\n\t injectProps(props);\n\t var instance = new GameWrapper();\n\t return instance;\n\t}\n\t//# sourceMappingURL=index.js.map\n\n\treturn index;\n\n})));\n"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "静音",
"desc": "静音",
"props": {
"muted": {
"alias": "是否静音",
"type": "boolean",
"default": true
}
},
"output": [
"complete"
],
"id": "mute-sound",
"script": "var muted = engine.findVariable('muted', args, props);\nengine.mute(muted);\nnext('complete');\n",
"group": "base",
"type": "builtin"
}
......@@ -9,13 +9,17 @@
"target": {
"type": "node",
"alias": "目标节点"
},
"props": {
"type": "map",
"alias": "配置属性"
}
},
"output": [
"complete"
],
"id": "add-custom-module",
"script": "engine.addCustomModule(props.id, props.target || target);\nnext('complete');\n",
"script": "var p = engine.findVariable('props', args, props);\nengine.addCustomModule(props.id, props.target || target, p);\nnext('complete');\n",
"group": "view",
"type": "builtin"
}
......@@ -5,13 +5,18 @@
"viewName": {
"alias": "目标视图名",
"type": "string"
},
"replace": {
"alias": "是否替换场景",
"type": "boolean",
"default": false
}
},
"output": [
"complete"
],
"id": "push-scene",
"script": "if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage = engine.gameStage;\n var view = gameStage.instantiateView(props.viewName);\n if (view) {\n gameStage.sceneContainer.push(view);\n }\n next('complete');\n}\n",
"script": "var replace = engine.findVariable('replace', args, props);\nif (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage = engine.gameStage;\n var view = gameStage.instantiateView(props.viewName);\n if (view) {\n if (replace) {\n gameStage.sceneContainer.replace(view);\n }\n else {\n gameStage.sceneContainer.push(view);\n }\n }\n next('complete');\n}\n",
"group": "view",
"type": "builtin"
}
......@@ -17,17 +17,17 @@
"default": "0.0.0.0"
},
"autoExposure": {
"alias": "自动曝光",
"alias": "曝光自动触发",
"type": "boolean",
"default": true
},
"onceAutoExposure": {
"alias": "单次自动曝光",
"alias": "单次曝光",
"type": "boolean",
"default": true
},
"autoExposureType": {
"alias": "自动曝光方式",
"alias": "曝光触发方式",
"type": "enum",
"enum": [
"visible",
......@@ -36,7 +36,7 @@
"default": "visible"
},
"autoClick": {
"alias": "自动点击",
"alias": "点击自动触发",
"type": "boolean",
"default": true
}
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var props_1 = require("../props");
var Block = (function (_super) {
__extends(Block, _super);
function Block() {
var _this = _super.call(this) || this;
var body = _this.body = new svga.Svga();
body.x = -props_1.props.blockWidth / 2;
body.y = -props_1.props.blockHitHeight - props_1.props.blockPaddingTop;
_this.addChild(body);
return _this;
}
Block.prototype.reset = function (_a) {
var type = _a.type;
this.dir = Math.random() > 0.5 ? 1 : -1;
if (this.type != type) {
this.type = type;
var asset_1 = utils_1.getBlockAsset(type);
this.body.source = 'asset://' + asset_1.uuid;
}
this.scaleX = this.dir;
this.body.gotoAndStop(1);
};
Block.prototype.playEnter = function (index, animation) {
var _this = this;
this.visible = true;
this.x = this.dir * this.stage.width;
var _a = props_1.props.blockDurationRange, min = _a[0], max = _a[1];
var duration = Math.max(max - index * props_1.props.blockDurationStep, min);
duration = duration + max * Math.random() * props_1.props.blockDurationRandom * (Math.random() > 0.5 ? 1 : -1);
return new Promise(function (resolve) {
if (animation) {
engine.Tween.get(_this, null, null, true)
.to({ x: 0, }, duration)
.call(resolve);
}
else {
_this.x = 0;
setTimeout(function () {
console.log(_this.body);
}, 200);
resolve();
}
});
};
Block.prototype.playLeave = function () {
this.visible = false;
};
Block.prototype.playEffect = function () {
var body = this.body;
body.play(true, false);
body.once(engine.Event.END_FRAME, function () {
body.gotoAndStop(1);
}, this);
};
Block.prototype.stop = function () {
engine.Tween.removeTweens(this);
};
return Block;
}(engine.Container));
exports.default = Block;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Block_1 = require("./Block");
var Background_1 = require("./Background");
var Player_1 = require("./Player");
var props_1 = require("../props");
var utils_1 = require("./utils");
var Base_1 = require("./Base");
var GuideLayer_1 = require("./GuideLayer");
var GoldBag_1 = require("./GoldBag");
var ObjectPool = engine.ObjectPool;
var PoolName = 'gold-bag';
ObjectPool.registerPool(PoolName, function () {
return new GoldBag_1.GoldBag();
}, function (item, data) {
item.reset(data);
});
var GameView = (function (_super) {
__extends(GameView, _super);
function GameView() {
var _this = _super.call(this) || this;
_this.index = -1;
_this.goldBags = [];
_this.baseOffset = -props_1.props.baseOffset + props_1.props.playerOffset;
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
GameView.prototype.setup = function () {
if (this._hasSetup) {
return;
}
this._hasSetup = true;
var _a = this.stage, width = _a.width, height = _a.height;
var background = this.background = new Background_1.Background();
this.addChild(background);
background.setup();
var frontContainer = this.frontContainer = new engine.Container();
frontContainer.x = width / 2;
this.addChild(frontContainer);
var guideLayer = this.guideLayer = new GuideLayer_1.GuideLayer();
this.addChild(guideLayer);
var base = this.base = new Base_1.Base();
frontContainer.addChild(base);
base.setup();
var blockContainer = this.blockContainer = new engine.Container();
frontContainer.addChild(blockContainer);
var player = this.player = new Player_1.default();
frontContainer.addChild(player);
player.setup();
player.addEventListener('jump-on-top', this.onPlayerJumpOnTop, this);
ObjectPool.recycleObject(PoolName, ObjectPool.getObject(PoolName, {
y: 0,
remain: 0,
}));
this.hitEffect = utils_1.createSvga('被撞烟雾', 'hitEffectAnchor');
this.pos = 0;
this.background.setup();
this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
this.reset();
};
GameView.prototype.reset = function (revive) {
if (revive === void 0) { revive = false; }
return __awaiter(this, void 0, void 0, function () {
var blockContainer, i, li, block, i, i, li, goldBag;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.base.reset();
this.index = -1;
this._score = 0;
if (revive) {
}
else {
this.pos = 0;
blockContainer = this.blockContainer;
for (i = 0, li = blockContainer.children.length; i < li; i++) {
block = blockContainer.getChildAt(i);
block.playLeave();
}
}
for (i = 0; i < props_1.props.initBlockCount; i++) {
this.addBlock(false);
}
for (i = 0, li = this.goldBags.length; i < li; i++) {
goldBag = this.goldBags[i];
this.frontContainer.removeChild(goldBag);
ObjectPool.recycleObject(PoolName, goldBag);
}
this.goldBags.splice(0);
this.playZoom('in');
return [4, this.resetPlayer(revive)];
case 1:
_a.sent();
return [2];
}
});
});
};
GameView.prototype.resetPlayer = function (revive) {
if (revive === void 0) { revive = false; }
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.player.reset(revive);
this.player.y = this.baseOffset - (this.index + 1) * props_1.props.blockHitHeight;
return [2];
});
});
};
GameView.prototype.start = function (revive) {
if (revive === void 0) { revive = false; }
return __awaiter(this, void 0, void 0, function () {
var guideFlagKey, guideFlag;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!revive) return [3, 2];
return [4, this.player.playReady()];
case 1:
_a.sent();
_a.label = 2;
case 2:
guideFlagKey = 'jump-high-guide_' + props_1.props.guideFlagKey;
guideFlag = localStorage.getItem(guideFlagKey);
if (!!guideFlag) return [3, 4];
localStorage.setItem(guideFlagKey, '1');
return [4, this.guideLayer.show('', { y: this.stage.height + this.player.y - 280 })];
case 3:
_a.sent();
_a.label = 4;
case 4:
this.lastLandType = 0;
this._remainToShowGoldBag = props_1.props.goldBagScoreMultiple - props_1.props.goldBagScoreSubtraction;
this._touchEnabled = true;
setTimeout(function () {
_this.addBlock();
}, 100);
engine.globalEvent.dispatchEvent('jump-high-game-start');
return [2];
}
});
});
};
GameView.prototype.pause = function () {
if (this.currentBlock) {
engine.Tween.pauseTweens(this.currentBlock);
}
engine.Tween.pauseTweens(this.player);
};
GameView.prototype.resume = function () {
if (this.currentBlock) {
engine.Tween.resumeTweens(this.currentBlock);
}
engine.Tween.resumeTweens(this.player);
};
GameView.prototype.revive = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.blockContainer.getChildAt(this.index).visible = false;
this.index--;
return [4, this.resetPlayer(true)];
case 1:
_a.sent();
return [4, this.playZoom('in')];
case 2:
_a.sent();
this.start(true);
return [2];
}
});
});
};
GameView.prototype.addBlock = function (animation) {
var _this = this;
if (animation === void 0) { animation = true; }
this.index++;
var blockContainer = this.blockContainer;
var block;
if (blockContainer.children.length > this.index) {
block = blockContainer.getChildAt(this.index);
block.visible = true;
}
else {
block = new Block_1.default();
blockContainer.addChild(block);
}
block.reset({
type: Math.floor(Math.random() * props_1.props.blockAssets.length),
});
block.y = this.baseOffset - this.index * props_1.props.blockHitHeight;
this.blockComplete = false;
block.playEnter(this.index, animation).then(function (data) {
_this.blockComplete = true;
});
if (animation) {
this.needHitTest = true;
}
this.currentBlock = block;
};
GameView.prototype.addGoldBag = function () {
var goldBag = ObjectPool.getObject(PoolName, {
y: this.baseOffset - (this.blockCount + props_1.props.goldBagDistance + props_1.props.goldBagJumpSubtraction) * props_1.props.blockHitHeight,
remain: props_1.props.goldBagDistance,
});
this.frontContainer.addChild(goldBag);
this.goldBags.push(goldBag);
};
GameView.prototype.playOpenGoldBag = function () {
return __awaiter(this, void 0, void 0, function () {
var i, li, goldBag;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
i = 0, li = this.goldBags.length;
_a.label = 1;
case 1:
if (!(i < li)) return [3, 4];
goldBag = this.goldBags[i];
goldBag.remain--;
if (!(goldBag.remain <= 0)) return [3, 3];
this.goldBags.splice(i, 1);
i--;
li--;
this.nextToUpdateScore = true;
return [4, goldBag.playOpen()];
case 2:
_a.sent();
this.frontContainer.removeChild(goldBag);
ObjectPool.recycleObject(PoolName, goldBag);
_a.label = 3;
case 3:
i++;
return [3, 1];
case 4: return [2];
}
});
});
};
GameView.prototype.onPlayerJumpOnTop = function () {
if (this.nextToUpdateScore) {
this.nextToUpdateScore = false;
this.scoreChange(4);
utils_1.playSound('撞击钱袋音效');
}
};
Object.defineProperty(GameView.prototype, "blockCount", {
get: function () {
return this.index - props_1.props.initBlockCount + 1;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GameView.prototype, "pos", {
get: function () {
return this._pos;
},
set: function (v) {
this._pos = v;
this.updatePos();
},
enumerable: true,
configurable: true
});
GameView.prototype.updatePos = function () {
this.frontContainer.y = this.stage.height + this._pos;
};
GameView.prototype.onEnterFrame = function (event) {
if (this.needHitTest) {
if (this.currentBlock) {
var _a = this.currentBlock, bx = _a.x, by = _a.y, dir = _a.dir;
var _b = this.player, px = _b.x, py = _b.y;
var blockHitWidth = props_1.props.blockHitWidth, blockHitHeight = props_1.props.blockHitHeight, playerWidth = props_1.props.playerWidth;
var hitOn = false;
if (Math.abs(px - bx) < (blockHitWidth + playerWidth) / 2) {
this.player.changeBaseY(by - blockHitHeight);
if (py > by - blockHitHeight) {
hitOn = true;
}
}
if (hitOn) {
this.onHitOn(dir);
}
}
}
};
GameView.prototype.onHitOn = function (dir) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this._touchEnabled = false;
this.needHitTest = false;
clearInterval(this.timer);
this.currentBlock.stop();
this.playHitEffect(dir);
return [4, this.player.hitAway(dir)];
case 1:
_a.sent();
this.playZoom('out');
return [4, this.player.parachute(dir)];
case 2:
_a.sent();
engine.globalEvent.dispatchEvent('jump-high-game-end');
return [2];
}
});
});
};
GameView.prototype.jump = function () {
return __awaiter(this, void 0, void 0, function () {
var result, pos, type_1, lastLandType;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this._touchEnabled) {
return [2];
}
this._touchEnabled = false;
this.playOpenGoldBag();
return [4, this.player.jump()];
case 1:
result = _a.sent();
if (!result) return [3, 5];
if (!result.aboveBlock) return [3, 4];
pos = Math.abs(this.currentBlock.x);
type_1 = 0;
if (pos > 0) {
type_1 = pos > 0 && pos < props_1.props.scoreThreshold ? 2 : 3;
}
lastLandType = this.lastLandType;
this.lastLandType = type_1;
if (type_1 === 0) {
if (lastLandType !== type_1) {
type_1 = 1;
}
}
if (type_1 < 3) {
this.currentBlock.playEffect();
}
this.player.playLand(type_1, this.currentBlock.dir);
this.currentBlock.stop();
this.scoreChange(type_1);
return [4, this.playShake()];
case 2:
_a.sent();
return [4, new Promise(function (resolve) {
engine.Tween.get(_this, null, null, true)
.to({ pos: props_1.props.blockHitHeight * _this.index }, 300, engine.Ease.cubicOut)
.call(resolve);
})];
case 3:
_a.sent();
this.addBlock();
_a.label = 4;
case 4:
this._touchEnabled = true;
_a.label = 5;
case 5: return [2];
}
});
});
};
GameView.prototype.scoreChange = function (type) {
var scoreAdd = props_1.props.scoreWeights[type];
this._score += scoreAdd;
this._remainToShowGoldBag -= scoreAdd;
var score = this._score;
engine.globalEvent.dispatchEvent('jump-high-score', {
type: type,
score: score,
scoreAdd: scoreAdd,
});
console.log(score, this._remainToShowGoldBag);
if (this._remainToShowGoldBag <= 0) {
this._remainToShowGoldBag += props_1.props.goldBagScoreMultiple;
this.addGoldBag();
console.log('addGoldBag');
}
};
GameView.prototype.playHitEffect = function (dir) {
var hitEffect = this.hitEffect;
hitEffect.scaleX = dir;
hitEffect.y = this.player.y - props_1.props.hitEffectAnchor.y;
hitEffect.play(true, false);
hitEffect.once(engine.Event.END_FRAME, function () {
this.frontContainer.removeChild(hitEffect);
}, this);
this.frontContainer.addChild(hitEffect);
};
GameView.prototype.playZoom = function (type, duration) {
var _this = this;
if (duration === void 0) { duration = 700; }
this.background.playZoom(type, duration);
var count = this.stage.height / props_1.props.blockHitHeight;
return new Promise(function (resolve) {
_this.frontContainer.anchorY = -props_1.props.blockHitHeight * (_this.index + count * 1.3) + props_1.props.baseOffset;
var scale = type === 'in' ? 1 : Math.min((_this.stage.height / props_1.props.blockHitHeight / (_this.index + count)), props_1.props.maxScale);
console.log(scale);
engine.Tween.get(_this.frontContainer, null, null, true)
.to({ scaleX: scale, scaleY: scale }, duration, engine.Ease.cubicInOut)
.call(resolve);
});
};
GameView.prototype.playShake = function () {
var _this = this;
var _a = this.frontContainer, x = _a.x, y = _a.y;
return new Promise(function (resolve) {
var shakeOffset = 7;
var duration = 30;
engine.Tween.get(_this.frontContainer, null, null, true)
.to({ x: x, y: y - shakeOffset }, duration)
.to({ x: x, y: y + shakeOffset }, duration)
.to({ x: x + shakeOffset, y: y }, duration)
.to({ x: x - shakeOffset, y: y }, duration)
.to({ x: x, y: y }, duration)
.call(resolve);
});
};
return GameView;
}(engine.Container));
exports.default = GameView;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var utils_1 = require("./utils");
var GoldBag = (function (_super) {
__extends(GoldBag, _super);
function GoldBag() {
var _this = _super.call(this) || this;
_this.setup();
return _this;
}
GoldBag.prototype.setup = function () {
var avatar = this.avatar = new engine.Sprite(utils_1.getTextureByName('钱袋-静态'));
avatar.x = -props_1.props.goldPackAvatarAnchor.x;
avatar.y = -props_1.props.goldPackAvatarAnchor.y;
this.addChild(avatar);
var svga = this.svga = utils_1.createSvga('钱袋', 'goldPackAnchor');
svga.visible = false;
this.addChild(svga);
};
GoldBag.prototype.reset = function (data) {
this.y = data.y;
this.avatar.visible = true;
this.svga.visible = false;
this.svga.gotoAndStop(1);
this.remain = data.remain;
};
GoldBag.prototype.playOpen = function () {
var _this = this;
this.avatar.visible = false;
this.svga.visible = true;
return new Promise(function (resolve) {
_this.svga.play(true, false);
_this.svga.once(engine.Event.END_FRAME, function () {
this.svga.visible = false;
resolve();
}, _this);
});
};
return GoldBag;
}(engine.Container));
exports.GoldBag = GoldBag;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameView_1 = require("./GameView");
var props_1 = require("../props");
var JumpHigh = (function (_super) {
__extends(JumpHigh, _super);
function JumpHigh() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('jump-high-reset', _this.reset, _this);
engine.globalEvent.addEventListener('jump-high-start', _this.start, _this);
engine.globalEvent.addEventListener('jump-high-pause', _this.pause, _this);
engine.globalEvent.addEventListener('jump-high-resume', _this.resume, _this);
engine.globalEvent.addEventListener('jump-high-revive', _this.revive, _this);
_this.addEventListener(engine.MouseEvent.MOUSE_DOWN, _this.onTap, _this);
var gameView = _this._gameView = new GameView_1.default();
_this.addChild(gameView);
return _this;
}
JumpHigh.prototype.reset = function () {
this._gameView.reset();
};
JumpHigh.prototype.start = function (event) {
if ('jump-high-start') {
props_1.injectProps(event.data);
}
this._status = 1;
this._gameView.start();
};
JumpHigh.prototype.pause = function () {
this._gameView.pause();
};
JumpHigh.prototype.resume = function () {
this._gameView.resume();
};
JumpHigh.prototype.revive = function () {
this._gameView.revive();
};
JumpHigh.prototype.onTap = function (event) {
this._gameView.jump();
};
return JumpHigh;
}(engine.Container));
exports.JumpHigh = JumpHigh;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var utils_1 = require("./utils");
var svgaAssets = {
aniReady: { name: '准备立正', dir: 1 },
aniJump: { name: '跳上升', dir: 1 },
aniFall: { name: '跳下落', dir: 1 },
aniLandNormal: { name: '普通着地', dir: 1 },
aniLandSide: { name: '边缘着地', dir: -1 },
aniHit: { name: '被撞开', dir: -1 },
aniParachute: { name: '降落', dir: -1 },
};
var Player = (function (_super) {
__extends(Player, _super);
function Player() {
var _this = _super.call(this) || this;
_this.g = props_1.props.gravity;
_this.addEventListener(engine.Event.ENTER_FRAME, _this.onEnterFrame, _this);
return _this;
}
Player.prototype.switchAni = function (name, dir, play, loop) {
var _this = this;
if (dir === void 0) { dir = 1; }
if (play === void 0) { play = true; }
if (loop === void 0) { loop = false; }
return new Promise(function (resolve) {
_this.scaleX = dir;
if (_this._aniName !== name) {
_this._aniName = name;
var oldAni = _this.removeChild(_this.getChildByName('body'));
if (oldAni) {
oldAni.stop();
}
var ani = _this._currentAni = _this['ani' + name];
_this.addChild(ani);
if (play) {
ani.play(false, loop);
if (loop) {
resolve();
}
else {
ani.once(engine.Event.END_FRAME, resolve);
}
}
else {
ani.gotoAndStop(1);
resolve();
}
}
});
};
Player.prototype.setup = function () {
this.prefectEffect = utils_1.createSvga('完美着地特效', 'playerLandPrefectAnchor');
this.landEffect = utils_1.createSvga('着地特效', 'playerLandEffectAnchor');
for (var key_1 in svgaAssets) {
var _a = svgaAssets[key_1], name_1 = _a.name, dir = _a.dir;
var body = this[key_1] = utils_1.createSvga(name_1, key_1.replace('ani', 'player') + 'Anchor');
body.name = 'body';
body.scaleX = dir;
}
};
Player.prototype.reset = function (revive) {
this.x = 0;
this.rotation = 0;
this.scaleX = this.scaleY = 1;
this._prefectLandCounting = 0;
engine.Tween.removeTweens(this);
if (revive) {
this.switchAni('Jump', 1, false);
}
};
Player.prototype.playReady = function () {
var _this = this;
return new Promise(function (resolve) {
_this.switchAni('Ready', 1);
_this._currentAni.once(engine.Event.END_FRAME, function () {
this.switchAni('Jump', 1, false);
resolve();
}, _this);
});
};
Player.prototype.onEnterFrame = function (event) {
if (!this.playing) {
return;
}
this.vy += this.g;
this.y += this.vy;
if (this.vy > 0 && this._aniName !== 'Fall') {
this.dispatchEvent('jump-on-top');
this.switchAni('Fall');
}
if (this.y > this.baseY) {
this.y = this.baseY;
this.playing = false;
this.jumpPromise && this.jumpPromise({
aboveBlock: this.aboveBlock,
});
this.jumpPromise = null;
}
};
Player.prototype.changeBaseY = function (v) {
if (this.baseY == v) {
return;
}
this.aboveBlock = true;
this.baseY = v;
};
Player.prototype.jump = function () {
var _this = this;
utils_1.playSound('跳起音效');
this.switchAni('Jump', 1, false);
this._currentAni.play(false, false);
this.aboveBlock = false;
this.playing = true;
this.baseY = this.y;
this.vy = -props_1.props.jumpSpeed;
return new Promise(function (resolve) {
_this.jumpPromise = resolve;
});
};
Player.prototype.playLand = function (type, dir) {
return __awaiter(this, void 0, void 0, function () {
var _a, prefectEffect_1, landEffect_1;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = type;
switch (_a) {
case 0: return [3, 1];
case 1: return [3, 3];
case 2: return [3, 3];
case 3: return [3, 4];
}
return [3, 5];
case 1:
this._prefectLandCounting++;
utils_1.playSound('完美落地音效' + Math.min(4, this._prefectLandCounting));
prefectEffect_1 = this.prefectEffect;
this.addChildAt(prefectEffect_1, 0);
prefectEffect_1.gotoAndPlay(1);
prefectEffect_1.once(engine.Event.END_FRAME, function () {
this.removeChild(prefectEffect_1);
}, this);
landEffect_1 = this.landEffect;
this.addChildAt(landEffect_1, 0);
landEffect_1.gotoAndPlay(1);
landEffect_1.once(engine.Event.END_FRAME, function () {
this.removeChild(landEffect_1);
}, this);
return [4, this.switchAni('LandNormal')];
case 2:
_b.sent();
return [3, 5];
case 3:
this._prefectLandCounting = 0;
utils_1.playSound('普通落地音效');
this.switchAni('LandNormal');
return [3, 5];
case 4:
this._prefectLandCounting = 0;
utils_1.playSound('边缘落地音效');
this.switchAni('LandSide', dir);
return [3, 5];
case 5: return [2];
}
});
});
};
Player.prototype.hitAway = function (dir) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.jumpPromise && this.jumpPromise();
this.jumpPromise = null;
utils_1.playSound('被撞开音效');
this.switchAni('Hit', dir);
this.vy = 0;
return [4, new Promise(function (resolve) {
engine.Tween.get(_this)
.to({
x: -dir * props_1.props.hitAwayDistance.x,
}, props_1.props.hitAwayDuration, engine.Ease.quartOut);
engine.Tween.get(_this)
.to({
y: _this.y + props_1.props.hitAwayDistance.y,
}, props_1.props.hitAwayDuration, engine.Ease.cubicOut)
.call(resolve);
})];
case 1:
_a.sent();
return [2];
}
});
});
};
Player.prototype.parachute = function (dir) {
var _this = this;
this.switchAni('Parachute', dir);
return new Promise(function (resolve) {
engine.Tween.get(_this)
.wait(200)
.call(function () {
utils_1.playSound('降落伞下落音效');
})
.wait(300)
.to({ y: _this.y + props_1.props.parachuteDistance }, props_1.props.parachuteDuration)
.set({ anchorOffsetY: 0 })
.call(resolve);
});
};
return Player;
}(engine.Container));
exports.default = Player;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
exports.getTexture = getTexture;
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
exports.getTextureByName = getTextureByName;
function getBlockAsset(type) {
return engine.getAssetByName(props_1.props.blockAssets[type]);
}
exports.getBlockAsset = getBlockAsset;
function createSvga(name, anchorName) {
var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
var anchor = props_1.props[(anchorName)];
if (anchor) {
inst.x = -anchor.x;
inst.y = -anchor.y;
inst.anchorX = anchor.x;
inst.anchorY = anchor.y;
}
return inst;
}
exports.createSvga = createSvga;
function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, { keep: true });
}
exports.playSound = playSound;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var JumpHigh_1 = require("./game/JumpHigh");
var props_1 = require("./props");
function default_1(props) {
props_1.prepareProps();
props_1.injectProps(props);
var instance = new JumpHigh_1.JumpHigh();
return instance;
}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var Background = (function (_super) {
__extends(Background, _super);
function Background() {
return _super.call(this) || this;
}
Background.prototype.setup = function () {
var _a = this.stage, width = _a.width, height = _a.height;
var bg = this._bg = new engine.Image(utils_1.getTextureByName('背景图'));
bg.anchorX = bg.width / 2;
bg.anchorY = bg.height / 2;
bg.x = -(bg.width - width) / 2;
bg.y = -(bg.height - height) / 2;
this.addChild(bg);
this._minScale = width / bg.width;
};
Background.prototype.playZoom = function (type, duration) {
var _this = this;
if (duration === void 0) { duration = 700; }
return new Promise(function (resolve) {
var scale = type === 'in' ? 1 : _this._minScale;
engine.Tween.get(_this._bg, null, null, true)
.to({ scaleX: scale, scaleY: scale }, duration, engine.Ease.cubicInOut)
.call(resolve);
});
};
return Background;
}(engine.Container));
exports.Background = Background;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var props_1 = require("../props");
var Base = (function (_super) {
__extends(Base, _super);
function Base() {
return _super.call(this, utils_1.getTextureByName('底座')) || this;
}
Base.prototype.setup = function () {
this.x = -(this.width) / 2;
};
Base.prototype.reset = function () {
this.y = -props_1.props.baseOffset;
};
return Base;
}(engine.Image));
exports.Base = Base;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var props_1 = require("../props");
var Block = (function (_super) {
__extends(Block, _super);
function Block() {
var _this = _super.call(this) || this;
var body = _this.body = new svga.Svga();
body.x = -props_1.props.blockWidth / 2;
body.y = -props_1.props.blockHitHeight - props_1.props.blockPaddingTop;
_this.addChild(body);
return _this;
}
Block.prototype.reset = function (_a) {
var type = _a.type;
this.dir = Math.random() > 0.5 ? 1 : -1;
if (this.type != type) {
this.type = type;
var asset_1 = utils_1.getBlockAsset(type);
this.body.source = 'asset://' + asset_1.uuid;
}
this.scaleX = this.dir;
this.body.gotoAndStop(1);
};
Block.prototype.playEnter = function (index, animation) {
var _this = this;
this.visible = true;
this.x = this.dir * this.stage.width;
var _a = props_1.props.blockSpeedRange, min = _a[0], max = _a[1];
var duration = Math.max(max - index * 10, min);
return new Promise(function (resolve) {
if (animation) {
engine.Tween.get(_this, null, null, true)
.to({ x: 0, }, duration)
.call(resolve);
}
else {
_this.x = 0;
setTimeout(function () {
console.log(_this.body);
}, 200);
resolve();
}
});
};
Block.prototype.playLeave = function () {
this.visible = false;
};
Block.prototype.playEffect = function () {
this.body.play(true, false);
};
Block.prototype.stop = function () {
engine.Tween.removeTweens(this);
};
return Block;
}(engine.Container));
exports.default = Block;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var BreakUpPart = (function (_super) {
__extends(BreakUpPart, _super);
function BreakUpPart(turntable, from, to) {
var _this = _super.call(this) || this;
var body = _this._body = new engine.Image();
_this.addChild(body);
var mask = _this._body.mask = new engine.Graphics();
_this.addChild(mask);
_this._turntable = turntable;
_this._from = from;
_this._to = to;
_this._fromR = from * Math.PI / 180;
_this._toR = to * Math.PI / 180;
return _this;
}
BreakUpPart.prototype.updateMask = function () {
var mask = this._body.mask;
mask.beginFill(0xff0000);
mask.moveTo(0, 0);
mask.arc(0, 0, this._turntable.radius + 5, this._fromR, this._toR);
mask.endFill();
var _a = props_1.props.breakUpDistanceRange, min = _a[0], max = _a[1];
var mid = (this._toR - this._fromR) / 2 + this._fromR;
this.x = Math.cos(mid) * Math.random() * max + min;
this.y = Math.sin(mid) * Math.random() * max + min;
this.alpha = 1;
this.rotation = 0;
};
BreakUpPart.prototype.playFall = function (rotation) {
var _this = this;
this._body.rotation = rotation;
return new Promise(function (resolve) {
var angle = (_this._to - _this._from) / 2 + _this._from;
var rotation = (angle > 270 ? 360 : 0) + 90 - angle;
engine.Tween.get(_this, null, null, true)
.to({ y: _this.y + props_1.props.turntableFallDistance, alpha: 0, rotation: rotation }, props_1.props.turntableFallDuration, engine.Ease.cubicIn)
.call(resolve);
});
};
Object.defineProperty(BreakUpPart.prototype, "body", {
get: function () {
return this._body;
},
enumerable: true,
configurable: true
});
return BreakUpPart;
}(engine.Container));
exports.BreakUpPart = BreakUpPart;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var GuideLayer_1 = require("./GuideLayer");
var ObjectPool = engine.ObjectPool;
var Turntable_1 = require("./Turntable");
var object_pool_init_1 = require("./object-pool-init");
var GameView = (function (_super) {
__extends(GameView, _super);
function GameView() {
var _this = _super.call(this) || this;
_this.countDownStep = function (decrease) {
if (decrease === void 0) { decrease = true; }
if (decrease) {
_this._countdown--;
if (_this._countdown <= 0) {
_this.stopCountDown();
_this.onTimeout();
}
}
engine.globalEvent.dispatchEvent('lipstick-turntable-countdown', {
second: _this._countdown,
});
};
_this.onHit = function () { return __awaiter(_this, void 0, void 0, function () {
var stick;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
stick = this._stick;
if (!this.turntable.addStick(stick)) return [3, 2];
this.stopCountDown();
return [4, stick.playFall()];
case 1:
_a.sent();
engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {
reason: 2,
});
return [3, 5];
case 2:
this._counting--;
engine.globalEvent.dispatchEvent('lipstick-turntable-hit', {
remain: this._counting,
});
if (!(this._counting === 0)) return [3, 4];
this.turntable.hideSticks();
this.stopCountDown();
return [4, this.turntable.playBreakUp()];
case 3:
_a.sent();
engine.globalEvent.dispatchEvent('lipstick-turntable-game-success');
return [3, 5];
case 4:
this.prepareStick();
_a.label = 5;
case 5: return [2];
}
});
}); };
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
GameView.prototype.setup = function () {
if (this._hasSetup) {
return;
}
this._hasSetup = true;
var turntable = this.turntable = new Turntable_1.Turntable();
this.addChild(turntable);
var guideLayer = this.guideLayer = new GuideLayer_1.GuideLayer();
this.addChild(guideLayer);
};
GameView.prototype.reset = function (revive, options) {
if (revive === void 0) { revive = false; }
if (options === void 0) { options = null; }
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (options) {
this.turntable.reset(options);
this.recycleStick();
}
else {
this.prepareStick();
}
return [2];
});
});
};
GameView.prototype.start = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this._countdown = props_1.props.countDown;
this._counting = props_1.props.lipstickCount;
this.turntable.start();
this.prepareStick();
this.countDownStep(false);
this.startCountDown();
return [2];
});
});
};
GameView.prototype.startCountDown = function () {
this._timer = setInterval(this.countDownStep, 1000);
};
GameView.prototype.stopCountDown = function () {
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
};
GameView.prototype.prepareStick = function () {
var stick = this._stick = ObjectPool.getObject(object_pool_init_1.PoolName);
stick.y = props_1.props.stickDistance;
this.addChildAt(stick, 0);
this._touchEnabled = true;
};
GameView.prototype.recycleStick = function () {
var stick = this._stick;
if (stick) {
this._stick = null;
this.removeChild(stick);
ObjectPool.recycleObject(object_pool_init_1.PoolName, stick);
}
};
GameView.prototype.pause = function () {
this.turntable.pause();
this._stick.stopSend();
this._stick.playFall();
this.stopCountDown();
};
GameView.prototype.resume = function () {
this.recycleStick();
this.turntable.resume();
this.startCountDown();
};
GameView.prototype.revive = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.recycleStick();
this.prepareStick();
this.turntable.resume();
return [2];
});
});
};
GameView.prototype.onTimeout = function () {
this.pause();
this._touchEnabled = false;
engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {
reason: 1,
});
};
GameView.prototype.tap = function (e) {
if (!this._touchEnabled) {
return;
}
this._touchEnabled = false;
this._stick.playSend(this.turntable.radius - props_1.props.stickInsertDepth, this.onHit);
};
return GameView;
}(engine.Container));
exports.default = GameView;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameView_1 = require("./GameView");
var props_1 = require("../props");
var GameWrapper = (function (_super) {
__extends(GameWrapper, _super);
function GameWrapper() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('lipstick-turntable-reset', _this.reset, _this);
engine.globalEvent.addEventListener('lipstick-turntable-start', _this.start, _this);
engine.globalEvent.addEventListener('lipstick-turntable-pause', _this.pause, _this);
engine.globalEvent.addEventListener('lipstick-turntable-resume', _this.resume, _this);
engine.globalEvent.addEventListener('lipstick-turntable-revive', _this.revive, _this);
engine.globalEvent.addEventListener('lipstick-turntable-clear', _this.clear, _this);
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
var gameView = _this._gameView = new GameView_1.default();
_this.addChild(gameView);
return _this;
}
GameWrapper.prototype.reset = function (event) {
props_1.injectProps(event.data);
this._gameView.visible = true;
this._gameView.reset(false, event.data);
};
GameWrapper.prototype.start = function (event) {
props_1.injectProps(event.data);
this._status = 1;
this._gameView.start();
};
GameWrapper.prototype.pause = function () {
this._gameView.pause();
};
GameWrapper.prototype.resume = function () {
this._gameView.resume();
};
GameWrapper.prototype.revive = function () {
this._gameView.revive();
};
GameWrapper.prototype.clear = function () {
this._gameView.visible = false;
};
GameWrapper.prototype.onTap = function (event) {
this._gameView.tap(event);
};
return GameWrapper;
}(engine.Container));
exports.GameWrapper = GameWrapper;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var GoldBag = (function (_super) {
__extends(GoldBag, _super);
function GoldBag() {
var _this = _super.call(this) || this;
_this.setup();
return _this;
}
GoldBag.prototype.setup = function () {
var svga = this.svga = utils_1.createSvga('钱袋', 'goldPackAnchor');
this.addChild(svga);
};
GoldBag.prototype.reset = function (data) {
this.y = data.y;
this.svga.visible = true;
this.svga.gotoAndStop(1);
};
GoldBag.prototype.playOpen = function () {
var _this = this;
return new Promise(function (resolve) {
_this.svga.play(true, false);
_this.svga.once(engine.Event.END_FRAME, function () {
this.svga.visible = false;
resolve();
}, _this);
});
};
return GoldBag;
}(engine.Container));
exports.GoldBag = GoldBag;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var utils_1 = require("./utils");
var GuideLayer = (function (_super) {
__extends(GuideLayer, _super);
function GuideLayer() {
var _this = _super.call(this) || this;
_this.setup();
return _this;
}
GuideLayer.prototype.setup = function () {
};
GuideLayer.prototype.show = function (id, options) {
var _this = this;
return new Promise(function (resolve) {
_this.visible = true;
if (!_this.guideMask) {
var _a = _this.stage, width = _a.width, height = _a.height;
var guideMask = _this.guideMask = new engine.Container();
var guideHole = new engine.Image(utils_1.getTextureByName('引导遮罩'));
guideHole.x = (width - guideHole.width) / 2;
guideHole.y = options.y;
guideMask.addChild(guideHole);
_this.createRect(guideMask, 0, 0, width, guideHole.y);
_this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);
_this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);
_this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);
var label = _this.label = new engine.Label();
label.fillColor = 'white';
label.size = 25;
label.text = props_1.props.guideText;
label.x = (width - label.width) / 2;
label.y = guideHole.y + guideHole.height + 50;
guideMask.addChild(label);
_this.addChild(guideMask);
}
_this.once(engine.MouseEvent.CLICK, function () {
this.visible = false;
resolve();
}, _this);
});
};
GuideLayer.prototype.createRect = function (container, x, y, width, height) {
var rect = new engine.Rect();
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
rect.fillColor = 'black';
rect.alpha = 0.7;
container.addChild(rect);
};
return GuideLayer;
}(engine.Container));
exports.GuideLayer = GuideLayer;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameView_1 = require("./GameView");
var props_1 = require("../props");
var JumpHigh = (function (_super) {
__extends(JumpHigh, _super);
function JumpHigh() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('jump-high-reset', _this.reset, _this);
engine.globalEvent.addEventListener('jump-high-start', _this.start, _this);
engine.globalEvent.addEventListener('jump-high-pause', _this.pause, _this);
engine.globalEvent.addEventListener('jump-high-resume', _this.resume, _this);
engine.globalEvent.addEventListener('jump-high-revive', _this.revive, _this);
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
var gameView = _this._gameView = new GameView_1.default();
_this.addChild(gameView);
return _this;
}
JumpHigh.prototype.reset = function () {
this._gameView.reset();
};
JumpHigh.prototype.start = function (event) {
if ('jump-high-start') {
props_1.injectProps(event.data);
}
this._status = 1;
this._gameView.start();
};
JumpHigh.prototype.pause = function () {
this._gameView.pause();
};
JumpHigh.prototype.resume = function () {
this._gameView.resume();
};
JumpHigh.prototype.revive = function () {
this._gameView.revive();
};
JumpHigh.prototype.onTap = function (event) {
this._gameView.jump();
};
return JumpHigh;
}(engine.Container));
exports.JumpHigh = JumpHigh;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameView_1 = require("./GameView");
var props_1 = require("../props");
var LipstickTurntable = (function (_super) {
__extends(LipstickTurntable, _super);
function LipstickTurntable() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('lipstick-turntable-reset', _this.reset, _this);
engine.globalEvent.addEventListener('lipstick-turntable-start', _this.start, _this);
engine.globalEvent.addEventListener('lipstick-turntable-pause', _this.pause, _this);
engine.globalEvent.addEventListener('lipstick-turntable-resume', _this.resume, _this);
engine.globalEvent.addEventListener('lipstick-turntable-revive', _this.revive, _this);
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
var gameView = _this._gameView = new GameView_1.default();
_this.addChild(gameView);
return _this;
}
LipstickTurntable.prototype.reset = function () {
this._gameView.reset();
};
LipstickTurntable.prototype.start = function (event) {
if ('lipstick-turntable-start') {
props_1.injectProps(event.data);
}
this._status = 1;
this._gameView.start();
};
LipstickTurntable.prototype.pause = function () {
this._gameView.pause();
};
LipstickTurntable.prototype.resume = function () {
this._gameView.resume();
};
LipstickTurntable.prototype.revive = function () {
this._gameView.revive();
};
LipstickTurntable.prototype.onTap = function (event) {
this._gameView.jump();
};
return LipstickTurntable;
}(engine.Container));
exports.LipstickTurntable = LipstickTurntable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameView_1 = require("./GameView");
var props_1 = require("../props");
var LispstickTurntable = (function (_super) {
__extends(LispstickTurntable, _super);
function LispstickTurntable() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('jump-high-reset', _this.reset, _this);
engine.globalEvent.addEventListener('jump-high-start', _this.start, _this);
engine.globalEvent.addEventListener('jump-high-pause', _this.pause, _this);
engine.globalEvent.addEventListener('jump-high-resume', _this.resume, _this);
engine.globalEvent.addEventListener('jump-high-revive', _this.revive, _this);
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
var gameView = _this._gameView = new GameView_1.default();
_this.addChild(gameView);
return _this;
}
LispstickTurntable.prototype.reset = function () {
this._gameView.reset();
};
LispstickTurntable.prototype.start = function (event) {
if ('jump-high-start') {
props_1.injectProps(event.data);
}
this._status = 1;
this._gameView.start();
};
LispstickTurntable.prototype.pause = function () {
this._gameView.pause();
};
LispstickTurntable.prototype.resume = function () {
this._gameView.resume();
};
LispstickTurntable.prototype.revive = function () {
this._gameView.revive();
};
LispstickTurntable.prototype.onTap = function (event) {
this._gameView.jump();
};
return LispstickTurntable;
}(engine.Container));
exports.LispstickTurntable = LispstickTurntable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameView_1 = require("./GameView");
var props_1 = require("../props");
var LisptickTurntable = (function (_super) {
__extends(LisptickTurntable, _super);
function LisptickTurntable() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('jump-high-reset', _this.reset, _this);
engine.globalEvent.addEventListener('jump-high-start', _this.start, _this);
engine.globalEvent.addEventListener('jump-high-pause', _this.pause, _this);
engine.globalEvent.addEventListener('jump-high-resume', _this.resume, _this);
engine.globalEvent.addEventListener('jump-high-revive', _this.revive, _this);
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
var gameView = _this._gameView = new GameView_1.default();
_this.addChild(gameView);
return _this;
}
LisptickTurntable.prototype.reset = function () {
this._gameView.reset();
};
LisptickTurntable.prototype.start = function (event) {
if ('jump-high-start') {
props_1.injectProps(event.data);
}
this._status = 1;
this._gameView.start();
};
LisptickTurntable.prototype.pause = function () {
this._gameView.pause();
};
LisptickTurntable.prototype.resume = function () {
this._gameView.resume();
};
LisptickTurntable.prototype.revive = function () {
this._gameView.revive();
};
LisptickTurntable.prototype.onTap = function (event) {
this._gameView.jump();
};
return LisptickTurntable;
}(engine.Container));
exports.LisptickTurntable = LisptickTurntable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var utils_1 = require("./utils");
var svgaAssets = {
aniJump: { name: '跳上升', dir: 1 },
aniFall: { name: '跳下落', dir: 1 },
aniLandNormal: { name: '普通着地', dir: 1 },
aniLandPrefect: { name: '完美着地', dir: 1 },
aniLandSide: { name: '边缘着地', dir: -1 },
aniHit: { name: '被撞开', dir: -1 },
aniParachute: { name: '降落', dir: 1 },
};
var Player = (function (_super) {
__extends(Player, _super);
function Player() {
var _this = _super.call(this) || this;
_this.g = props_1.props.gravity;
_this.addEventListener(engine.Event.ENTER_FRAME, _this.onEnterFrame, _this);
return _this;
}
Player.prototype.switchAni = function (name, dir, play, loop) {
var _this = this;
if (dir === void 0) { dir = 1; }
if (play === void 0) { play = true; }
if (loop === void 0) { loop = false; }
return new Promise(function (resolve) {
_this.scaleX = dir;
if (_this._aniName !== name) {
_this._aniName = name;
var oldAni = _this.removeChild(_this.getChildByName('body'));
if (oldAni) {
oldAni.stop();
}
var ani = _this._currentAni = _this['ani' + name];
_this.addChildAt(ani, 0);
if (play) {
ani.play(false, loop);
if (loop) {
resolve();
}
else {
ani.once(engine.Event.END_FRAME, resolve);
}
}
else {
ani.gotoAndStop(1);
resolve();
}
}
});
};
Player.prototype.setup = function () {
for (var key_1 in svgaAssets) {
var _a = svgaAssets[key_1], name_1 = _a.name, dir = _a.dir;
var body = this[key_1] = utils_1.createSvga(name_1, key_1.replace('ani', 'player') + 'Anchor');
body.name = 'body';
body.scaleX = dir;
}
};
Player.prototype.reset = function () {
this.x = 0;
this.rotation = 0;
this.scaleX = this.scaleY = 1;
this._prefectLandCounting = 0;
engine.Tween.removeTweens(this);
this.switchAni('Jump', 1, false);
};
Player.prototype.onEnterFrame = function (event) {
if (!this.playing) {
return;
}
this.vy += this.g;
this.y += this.vy;
if (this.vy > 0 && this._aniName !== 'Fall') {
this.dispatchEvent('jump-on-top');
this.switchAni('Fall');
}
if (this.y > this.baseY) {
this.y = this.baseY;
this.playing = false;
this.jumpPromise && this.jumpPromise({
aboveBlock: this.aboveBlock,
});
this.jumpPromise = null;
}
};
Player.prototype.changeBaseY = function (v) {
if (this.baseY == v) {
return;
}
this.aboveBlock = true;
this.baseY = v;
};
Player.prototype.jump = function () {
var _this = this;
utils_1.playSound('跳起音效');
this.switchAni('Jump', 1, false);
this._currentAni.play(false, false);
this.aboveBlock = false;
this.playing = true;
this.baseY = this.y;
this.vy = -props_1.props.jumpSpeed;
return new Promise(function (resolve) {
_this.jumpPromise = resolve;
});
};
Player.prototype.playLand = function (type, dir) {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = type;
switch (_a) {
case 0: return [3, 1];
case 1: return [3, 3];
case 2: return [3, 4];
}
return [3, 5];
case 1:
this._prefectLandCounting++;
utils_1.playSound('完美落地音效' + Math.min(4, this._prefectLandCounting));
return [4, this.switchAni('LandPrefect')];
case 2:
_b.sent();
this.switchAni('Jump', 1, false);
return [3, 5];
case 3:
this._prefectLandCounting = 0;
utils_1.playSound('普通落地音效');
this.switchAni('LandNormal');
return [3, 5];
case 4:
this._prefectLandCounting = 0;
utils_1.playSound('边缘落地音效');
this.switchAni('LandSide', dir);
return [3, 5];
case 5: return [2];
}
});
});
};
Player.prototype.hitAway = function (dir) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.jumpPromise && this.jumpPromise();
this.jumpPromise = null;
utils_1.playSound('被撞开音效');
this.switchAni('Hit', dir);
this.vy = 0;
return [4, new Promise(function (resolve) {
engine.Tween.get(_this)
.to({
x: -dir * props_1.props.hitAwayDistance.x,
}, props_1.props.hitAwayDuration, engine.Ease.quartOut);
engine.Tween.get(_this)
.to({
y: _this.y + props_1.props.hitAwayDistance.y,
}, props_1.props.hitAwayDuration, engine.Ease.cubicOut)
.call(resolve);
})];
case 1:
_a.sent();
return [2];
}
});
});
};
Player.prototype.parachute = function () {
var _this = this;
utils_1.playSound('降落伞下落音效');
this.switchAni('Parachute');
return new Promise(function (resolve) {
engine.Tween.get(_this)
.to({ y: _this.y + props_1.props.parachuteDistance }, props_1.props.parachuteDuration)
.set({ anchorOffsetY: 0 })
.call(resolve);
});
};
return Player;
}(engine.Container));
exports.default = Player;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
var props_1 = require("../props");
var Stick = (function (_super) {
__extends(Stick, _super);
function Stick() {
var _this = _super.call(this) || this;
var body = _this._body = new engine.Sprite(utils_1.getTextureByName('口红素材'));
body.anchorY = _this._body.height / 2;
body.x = -body.width / 2;
_this.addChild(body);
return _this;
}
Stick.prototype.reset = function () {
this.visible = true;
this.rotation = 0;
this.anchorOffsetY = 0;
var body = this._body;
body.y = 0;
body.rotation = 0;
};
Stick.prototype.playSend = function (y, callback) {
this._toY = y;
engine.Tween.get(this)
.to({ y: y }, props_1.props.stickSendDuration)
.call(callback);
};
Stick.prototype.stopSend = function () {
engine.Tween.removeTweens(this);
};
Stick.prototype.playFall = function () {
var _this = this;
return new Promise(function (resolve) {
engine.Tween.get(_this, null, null, true)
.to({ rotation: 30, y: _this._toY + props_1.props.stickFallDistance }, 500, engine.Ease.cubicOut)
.call(resolve);
});
};
Object.defineProperty(Stick.prototype, "anchorOffsetY", {
set: function (v) {
this._body.y = v;
},
enumerable: true,
configurable: true
});
return Stick;
}(engine.Container));
exports.Stick = Stick;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../props");
var ObjectPool = engine.ObjectPool;
var object_pool_init_1 = require("./object-pool-init");
var BreakUpPart_1 = require("./BreakUpPart");
var Turntable = (function (_super) {
__extends(Turntable, _super);
function Turntable() {
var _this = _super.call(this) || this;
_this._items = [];
var wrapper = _this._wrapper = new engine.Container();
_this.addChild(wrapper);
var stickContainer = _this._stickContainer = new engine.Container();
wrapper.addChild(stickContainer);
var body = _this._body = new engine.Image();
wrapper.addChild(body);
var breakUpContainer = _this._breakUpContainer = new engine.Container();
for (var i = 0, li = props_1.props.breakUpRatios.length - 1; i < li; i++) {
var part = new BreakUpPart_1.BreakUpPart(_this, props_1.props.breakUpRatios[i], props_1.props.breakUpRatios[i + 1]);
breakUpContainer.addChild(part);
}
breakUpContainer.visible = false;
_this.addChild(breakUpContainer);
return _this;
}
Turntable.prototype.resetAsset = function (body, asset) {
body.source = asset;
body.x = -body.width / 2;
body.y = -body.height / 2;
body.anchorX = -body.x;
body.anchorY = -body.y;
};
Turntable.prototype.reset = function (options) {
var turntableAssetName = options.turntableAssetName;
this.rotationRange = props_1.props.rotationRange;
var body = this._body;
body.visible = true;
this.resetAsset(body, turntableAssetName);
this._radius = body.width / 2;
this.hideSticks();
for (var _i = 0, _a = this._breakUpContainer.children; _i < _a.length; _i++) {
var part = _a[_i];
this.resetAsset(part.body, turntableAssetName);
part.updateMask();
}
this._breakUpContainer.visible = false;
};
Object.defineProperty(Turntable.prototype, "radius", {
get: function () {
return this._radius;
},
enumerable: true,
configurable: true
});
Turntable.prototype.start = function () {
this._dir = 1;
this._items.splice(0);
this.rotateOnce();
};
Turntable.prototype.pause = function () {
engine.Tween.pauseTweens(this._wrapper);
};
Turntable.prototype.resume = function () {
engine.Tween.resumeTweens(this._wrapper);
};
Turntable.prototype.addStick = function (stick) {
var angle = this.parseAngle(this._wrapper.rotation);
var minDis = props_1.props.stickAngle * 2;
var hitOn = false;
for (var _i = 0, _a = this._items; _i < _a.length; _i++) {
var item = _a[_i];
if (Math.abs(item - angle) < minDis) {
hitOn = true;
break;
}
}
if (hitOn) {
this.pause();
}
else {
this._items.push(angle);
stick.anchorOffsetY = stick.y;
stick.y = 0;
stick.rotation = -this._wrapper.rotation;
this._stickContainer.addChild(stick);
this.shake();
}
return hitOn;
};
Turntable.prototype.parseAngle = function (r) {
var round = r % 360;
if (round < 0) {
round += 360;
}
return round;
};
Turntable.prototype.hideSticks = function () {
for (var _i = 0, _a = this._stickContainer.children; _i < _a.length; _i++) {
var stick = _a[_i];
ObjectPool.recycleObject(object_pool_init_1.PoolName, stick);
}
this._stickContainer.removeChildren();
};
Turntable.prototype.playBreakUp = function () {
return __awaiter(this, void 0, void 0, function () {
var p, _i, _a, part;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
this.pause();
this._body.visible = false;
this._breakUpContainer.visible = true;
for (_i = 0, _a = this._breakUpContainer.children; _i < _a.length; _i++) {
part = _a[_i];
p = part.playFall(this._wrapper.rotation);
}
return [4, p];
case 1:
_b.sent();
return [2];
}
});
});
};
Turntable.prototype.shake = function () {
engine.Tween.get(this, null, null, true)
.to({ y: this.y - 5 }, 50)
.to({ y: this.y }, 50);
};
Turntable.prototype.rotateOnce = function () {
var _a = this.rotationRange, min = _a[0], max = _a[1];
var dealtRotation = Math.random() * max + min;
var duration = dealtRotation * (Math.random() * props_1.props.rotationDurationMultipleRandom + props_1.props.rotationDurationMultipleBase);
var rotation = this._wrapper.rotation + this._dir * dealtRotation;
this._dir *= -1;
engine.Tween.get(this._wrapper, null, null, true)
.to({ rotation: rotation }, duration)
.call(this.rotateOnce, this);
};
return Turntable;
}(engine.Container));
exports.Turntable = Turntable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Stick_1 = require("./Stick");
var ObjectPool = engine.ObjectPool;
exports.PoolName = 'stick';
ObjectPool.registerPool(exports.PoolName, function () {
return new Stick_1.Stick();
}, function (item, data) {
item.reset();
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
exports.getTexture = getTexture;
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
exports.getTextureByName = getTextureByName;
function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, { keep: true });
}
exports.playSound = playSound;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameWrapper_1 = require("./game/GameWrapper");
var props_1 = require("./props");
function default_1(props) {
props_1.prepareProps();
props_1.injectProps(props);
var instance = new GameWrapper_1.GameWrapper();
return instance;
}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(exports.props, metaProps);
}
exports.prepareProps = prepareProps;
function injectProps(p) {
engine.injectProp(exports.props, p);
}
exports.injectProps = injectProps;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GameObject_1 = require("./GameObject");
var Collider_1 = require("../Phycics/Collider");
var MConst_1 = require("../Global/MConst");
var Bullet_1 = require("./Bullet");
var SoundMgr_1 = require("../Mgr/SoundMgr");
var MTimer_1 = require("../Global/MTimer");
var props_1 = require("../../props");
var DataMgr_1 = require("../Mgr/DataMgr");
var utils_1 = require("../utils");
var Car = (function (_super) {
__extends(Car, _super);
function Car() {
var _this = _super.call(this) || this;
_this.imgParticel = null;
_this.fireTimer = null;
_this.touchWall = 0;
_this.isDied = false;
_this.fireParticleTimer = 0;
_this.invincible = false;
_this.rowBulletNum = 1;
_this.fireSpeed = MConst_1.MConst.BulletFireSpeed.min;
var carCollidePaddingX = props_1.props.carCollidePaddingX, carCollidePaddingY = props_1.props.carCollidePaddingY;
var sprite = new engine.Sprite(utils_1.getTexture("ddf5128e-be66-4c00-8505-e4167aac37bc"));
sprite.x = 0;
sprite.y = 16;
_this.addChild(sprite);
var particle = new engine.Sprite(utils_1.getTexture("d8daa113-0d75-4139-9e81-c54b7522c890"));
particle.x = (sprite.width - particle.width) / 2;
particle.y = 0;
_this.addChild(particle);
_this.imgParticel = particle;
MTimer_1.default.onFrame("Car", _this.onUpdate, _this);
var collider = _this.collider = _this.addComponent(Collider_1.RectCollider);
collider.setData(carCollidePaddingX, carCollidePaddingY, sprite.width - carCollidePaddingX * 2, sprite.height - carCollidePaddingY * 2);
collider.group = Collider_1.ColliderGroup.Car;
return _this;
}
Car.prototype.fire = function () {
SoundMgr_1.default.instance.playEffect("shoot");
new Bullet_1.BulletGroup(new engine.Point(this.x + this.width / 2, this.y), this.rowBulletNum);
};
Car.prototype.die = function () {
if (this.invincible)
return;
if (this.isDied)
return;
this.isDied = true;
this.onDied && this.onDied();
};
Car.prototype.onCollisionEnter = function (other) {
if (other.group == Collider_1.ColliderGroup.Ball) {
this.die();
}
if (other.group == Collider_1.ColliderGroup.Wall) {
this.touchWall = other.owner.x < 0 ? 1 : -1;
}
};
Car.prototype.onCollisionStay = function (other) {
if (other.group == Collider_1.ColliderGroup.Ball) {
this.die();
}
if (other.group == Collider_1.ColliderGroup.Wall) {
this.touchWall = other.owner.x < 0 ? 1 : -1;
}
};
Car.prototype.onceBlink = function () {
var _this = this;
engine.Tween.get(this)
.to({ alpha: 0 }, 1)
.wait(100)
.to({ alpha: 1 }, 1)
.wait(100)
.call(function () {
_this.onceBlink();
});
};
Car.prototype.revive = function () {
var _this = this;
this.invincible = true;
this.isDied = false;
engine.Tween.removeTweens(this);
this.onceBlink();
MTimer_1.default.setFrameTimer(MConst_1.MConst.ReviveInvincibleDuration * 60, function () {
_this.invincible = false;
_this.alpha = 1;
engine.Tween.removeTweens(_this);
});
};
Car.prototype.move = function (deltaX) {
if (this.touchWall == 1 && deltaX <= 0) {
return;
}
else if (this.touchWall == -1 && deltaX >= 0) {
return;
}
var carCollidePaddingX = props_1.props.carCollidePaddingX;
var _a = this.collider.rect, x = _a.x, width = _a.width;
this.x = Math.max(-x, Math.min(750 - width - carCollidePaddingX, this.x + deltaX));
};
Car.prototype.onCollisionExit = function (other) {
if (other.group == Collider_1.ColliderGroup.Wall) {
this.touchWall = 0;
}
};
Car.prototype.onUpdate = function () {
if (DataMgr_1.DataMgr.game.pause)
return;
var score = DataMgr_1.DataMgr.game.bulletScore;
if (score <= 20) {
var max = MConst_1.MConst.BulletFireSpeed.max;
var min = MConst_1.MConst.BulletFireSpeed.min;
this.fireSpeed = min + (max - min) * (score / 20);
}
else {
this.fireSpeed = MConst_1.MConst.BulletFireSpeed.max;
}
this.rowBulletNum = Math.ceil((utils_1.clamp(score, 15, 140) / 2) / 10);
this.fireTimer += 1 * MTimer_1.default.dtFactor;
if (this.fireTimer >= 60 / this.fireSpeed) {
this.fire();
this.fireTimer = 0;
}
if (this.fireParticleTimer % 3 == 0) {
this.imgParticel.visible = !this.imgParticel.visible;
}
this.fireParticleTimer++;
};
return Car;
}(GameObject_1.default));
exports.default = Car;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var MConfigs_1 = require("../Global/MConfigs");
var MConst_1 = require("../Global/MConst");
var utils_1 = require("../utils");
var props_1 = require("../../props");
var padding = 10;
var GuideMask = (function (_super) {
__extends(GuideMask, _super);
function GuideMask(index, x1, y1) {
var _this = _super.call(this) || this;
var config = MConfigs_1.MConfigs.guide[index];
var mask = new engine.Sprite(utils_1.getTexture("3cc0aa86-0581-4caa-b662-266e58fd39b7"));
var w = mask.width, h = mask.height;
x1 = Math.floor(x1);
y1 = Math.floor(y1);
var x = x1 - w / 2;
var y = y1 - h / 2;
mask.x = x;
mask.y = y;
_this.addChild(mask);
var sw = MConst_1.MConst.DesignResolution.width, sh = MConst_1.MConst.DesignResolution.height;
var color = 0x000000;
var alpha = 0.7;
var top = new engine.Shape();
top.beginFill(color, alpha);
top.drawRect(0, 0, sw, y);
top.endFill();
_this.addChild(top);
var bottom = new engine.Shape();
bottom.beginFill(color, alpha);
bottom.drawRect(x, y + h, w, sh - h - y);
bottom.endFill();
_this.addChild(bottom);
var left = new engine.Shape();
left.beginFill(color, alpha);
left.drawRect(0, y, x, sh - y);
left.endFill();
_this.addChild(left);
var right = new engine.Shape();
right.beginFill(color, alpha);
right.drawRect(x + w, y, sw - x - w, sh - y);
right.endFill();
_this.addChild(right);
var offsetToMask = config.text.offsetToMask;
var label = new engine.Label();
label.text = props_1.props['guideText' + index];
label.size = 24;
label.fillColor = "rgba(255,255,255,1)";
label.x = mask.x + (w - label.width) / 2;
label.y = offsetToMask.y + mask.y;
_this.addChild(label);
if (index == 0) {
var left_1 = new engine.Sprite(utils_1.getTexture("93992a62-e3c4-46d5-99f4-f7ba35fe4f4f"));
left_1.x = x1 + 200;
left_1.y = y1 - left_1.height / 2;
_this.addChild(left_1);
var right_1 = new engine.Sprite(utils_1.getTexture("93992a62-e3c4-46d5-99f4-f7ba35fe4f4f"));
right_1.x = x1 - 200;
right_1.scaleX = -1;
right_1.y = y1 - right_1.height / 2;
_this.addChild(right_1);
}
if (label.x < padding) {
label.x = padding;
}
else if (label.x + label.width > 750 - padding) {
label.x = 750 - label.width - padding;
}
_this.addEventListener(engine.MouseEvent.MOUSE_DOWN, function () {
_this.onClick && _this.onClick(_this);
}, _this);
return _this;
}
return GuideMask;
}(engine.Container));
exports.default = GuideMask;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var MConfigs;
(function (MConfigs) {
function updateConfig() {
var mconfig = window["mconfig"];
if (typeof mconfig != "object")
return;
Object.keys(mconfig).forEach(function (e) {
MConfigs[e] = mconfig[e];
});
}
MConfigs.updateConfig = updateConfig;
MConfigs.size = [0.3125, 0.5357, 0.7321, 1];
MConfigs.drop = [
{
type: "bullet",
value: 1,
textColor: 0x5dcefa,
fileIndex: "0"
},
{
type: "bullet",
value: 2,
textColor: 0x69e7fc,
fileIndex: "1"
},
{
type: "power",
value: 30,
textColor: 0xe83cf7,
fileIndex: "2"
},
{
type: "power",
value: 20,
textColor: 0xeb3924,
fileIndex: "1"
},
{
type: "power",
value: 10,
textColor: 0xfef552,
fileIndex: "0"
}
];
MConfigs.dropPool = {
0: {
num: 3,
factor: {
0: 40,
1: 0,
2: 0,
3: 15,
4: 50
}
},
1: {
num: 2,
factor: {
0: 40,
1: 0,
2: 5,
3: 15,
4: 50
}
},
2: {
num: 1,
factor: {
0: 40,
1: 0,
2: 5,
3: 15,
4: 50
}
}
};
MConfigs.guide = {
0: {
mask: "guide_mask_0_png",
text: {
str: "左右移动炮车进行射击和躲避",
offsetToMask: {
x: 8,
y: 290
}
}
},
1: {
mask: "guide_mask_1_png",
text: {
str: "拾取金币可获得更多的炮弹输出和得分加成",
offsetToMask: {
x: -65,
y: 290
}
}
},
};
})(MConfigs = exports.MConfigs || (exports.MConfigs = {}));
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var props_1 = require("../../props");
var GuideMask_1 = require("../Game/GuideMask");
var DataMgr_1 = require("./DataMgr");
var MConfigs_1 = require("../Global/MConfigs");
var GuideMgr = (function () {
function GuideMgr() {
this.done = [];
this.currentGuideMask = null;
}
Object.defineProperty(GuideMgr, "instance", {
get: function () {
if (!GuideMgr._instance) {
GuideMgr._instance = new GuideMgr();
}
return GuideMgr._instance;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GuideMgr.prototype, "guideFlag", {
get: function () {
return localStorage.getItem("shoot-planet_" + props_1.props.guideFlagKey) != "false";
},
set: function (v) {
localStorage.setItem("shoot-planet_" + props_1.props.guideFlagKey, v ? "true" : "false");
},
enumerable: true,
configurable: true
});
Object.defineProperty(GuideMgr.prototype, "guideDone", {
get: function () {
return !this.guideFlag || this.done.length >= Object.keys(MConfigs_1.MConfigs.guide).length;
},
enumerable: true,
configurable: true
});
GuideMgr.prototype.runGuide = function (index, x, y, end) {
var _this = this;
if (end === void 0) { end = false; }
if (this.done[index] || this.guideFlag == false)
return;
this.done.push(index);
DataMgr_1.DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask_1.default(index, x, y);
this.currentGuideMask.onClick = function (context) {
context.destroy();
DataMgr_1.DataMgr.game.pause = false;
if (_this.done.length >= Object.keys(MConfigs_1.MConfigs.guide).length) {
DataMgr_1.DataMgr.game.onGuideDone();
}
if (end) {
_this.guideFlag = false;
}
};
engine.gameStage.addChild(this.currentGuideMask);
};
GuideMgr._instance = null;
return GuideMgr;
}());
exports.default = GuideMgr;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Game_1 = require("./Game/Game");
var MTimer_1 = require("./Global/MTimer");
var DebugMgr_1 = require("./Mgr/DebugMgr");
var GuideMgr_1 = require("./Mgr/GuideMgr");
var ShootPlanet = (function (_super) {
__extends(ShootPlanet, _super);
function ShootPlanet() {
var _this = _super.call(this) || this;
_this.game = null;
_this.customProperty();
_this.width = 750;
_this.height = 1624;
_this.init();
engine.globalEvent.addEventListener('game-create', _this.onActive, _this);
engine.globalEvent.addEventListener('game-destroy', _this.onSleep, _this);
engine.globalEvent.addEventListener('game-revive', _this.onRevive, _this);
engine.globalEvent.addEventListener('game-pause', _this.onPause, _this);
engine.globalEvent.addEventListener('game-resume', _this.onResume, _this);
return _this;
}
ShootPlanet.prototype.onActive = function () {
this.game = new Game_1.default(this);
if (GuideMgr_1.default.instance.guideFlag == true) {
var car = this.game._car;
GuideMgr_1.default.instance.runGuide(0, car.x + car.width / 2, car.y + car.height / 2);
}
if (GuideMgr_1.default.instance.guideDone) {
this.game.onGuideDone();
}
};
ShootPlanet.prototype.onSleep = function () {
this.game.destroy();
this.game = null;
};
ShootPlanet.prototype.onRevive = function () {
this.game.revive();
};
ShootPlanet.prototype.onPause = function () {
this.game.pause = true;
};
ShootPlanet.prototype.onResume = function () {
this.game.pause = false;
};
ShootPlanet.prototype.init = function () {
MTimer_1.default.init();
DebugMgr_1.default.instance.init(this);
};
ShootPlanet.prototype.customProperty = function () {
Object.defineProperty(engine.Point.prototype, 'length', {
get: function () {
return Math.sqrt(this.x * this.x + this.y * this.y);
}
});
engine.DisplayObject.prototype.destroy = function () {
this.parent.removeChild(this);
};
};
return ShootPlanet;
}(engine.Container));
exports.ShootPlanet = ShootPlanet;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ShootPlanet_1 = require("./game/ShootPlanet");
var props_1 = require("./props");
function default_1(props) {
props_1.prepareProps();
props_1.injectProps(props);
var instance = new ShootPlanet_1.ShootPlanet();
return instance;
}
exports.default = default_1;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(exports.props, metaProps);
}
exports.prepareProps = prepareProps;
function injectProps(p) {
engine.injectProp(exports.props, p);
}
exports.injectProps = injectProps;
var replace = engine.findVariable('replace', args, props);
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}
else {
var gameStage = engine.gameStage;
var view = gameStage.instantiateView(props.viewName);
if (view) {
if (replace) {
gameStage.sceneContainer.replace(view);
}
else {
gameStage.sceneContainer.push(view);
}
}
next('complete');
}
declare module svga {
export class BezierPath {
_d: any;
_transform: any;
_styles: any;
_shape: any;
constructor(d?: any, transform?: any, styles?: any);
}
export class FrameEntity {
alpha: number;
transform: {
a: number;
b: number;
c: number;
d: number;
tx: number;
ty: number;
};
layout: {
x: number;
y: number;
width: number;
height: number;
};
nx: number;
ny: number;
/**
* BezierPath
*/
maskPath: any;
/**
* Object[]
*/
shapes: any[];
constructor(spec: any);
static lastShapes: any;
}
export class SpriteEntity {
/**
* string
*/
matteKey: any;
/**
* string
*/
imageKey: any;
/**
* FrameEntity[]
*/
frames: any[];
constructor(spec: any);
}
export class VideoEntity extends engine.HashObject {
/**
* SVGA 文件版本
*/
version: string;
/**
* 影片尺寸
*/
videoSize: {
width: number;
height: number;
};
/**
* 帧率
*/
FPS: number;
/**
* 帧数
*/
frames: number;
/**
* Bitmaps
*/
images: {};
/**
* 图片是否已被缓存,缓存全局,注意名字覆盖
*/
hasBeenCached: boolean;
/**
* SpriteEntity[]
*/
sprites: SpriteEntity[];
/**
* AudioEntity[]
*/
audios: any[];
constructor(spec: any, images: any);
resetSprites(spec: any): void;
destroy(): void;
}
export class MovieClip extends engine.Container {
/**
* 锁步将按时间间隔来执行动画
*/
lockStep: boolean;
/**
* mc的当前帧,从1开始
* @property currentFrame
* @public
* @since 1.0.0
* @type {number}
* @default 1
* @readonly
*/
get currentFrame(): number;
/**
* @property _curFrame
* @type {number}
* @private
* @since 2.0.0
* @default 1
*/
private _curFrame;
/**
* 当前动画是否处于播放状态
* @property isPlaying
* @readOnly
* @public
* @since 1.0.0
* @type {boolean}
* @default true
* @readonly
*/
get isPlaying(): boolean;
/**
* @property _isPlaying
* @type {boolean}
* @private
* @since 2.0.0
* @default true
*/
private _isPlaying;
/**
* 动画的播放方向,是顺着播还是在倒着播
* @property isFront
* @public
* @since 1.0.0
* @type {boolean}
* @default true
* @readonly
*/
get isFront(): boolean;
/**
* @property _isFront
* @type {boolean}
* @private
* @default true
*/
private _isFront;
/**
* 当前动画的总帧数
* @property totalFrames
* @public
* @since 1.0.0
* @type {number}
* @default 1
* @readonly
*/
totalFrames: number;
loops: number;
/**
* 所有textures缓存
*/
private textures;
/**
* 锁步的时间间隔,按fps定,毫秒
*/
private timeInterval;
/**
* 前提引擎按60设置
*/
private deltaFrame;
/**
* 中间帧计时
*/
private frameCount;
/**
* 构造函数
* @method MovieClip
* @public
* @since 1.0.0
*/
constructor(mv?: VideoEntity);
/**
* 可以手动用init,
* @param mv
*/
init(mv: VideoEntity): void;
private initChildren;
/**
* 用基础属性重置
* @param display
* @param transform
*/
private resetTransform;
/**
* 用基础属性重置所有的待frame的children
* @param frameIndex 帧 1到total
*/
resetTransformAll(frameIndex: number): void;
/**
*
* @param imagekey 对应的imagekey
* @param imageUrl 图片路径,以后考虑支持多种形式
*/
setImage(imagekey: any, imageUrl: string): void;
/**
* 调用止方法将停止当前帧
* @method stop
* @public
* @since 1.0.0
*/
stop(): void;
/**
* 将播放头向后移一帧并停在下一帧,如果本身在最后一帧则不做任何反应
* @method nextFrame
* @since 1.0.0
* @public
*/
nextFrame(): void;
/**
* 将播放头向前移一帧并停在下一帧,如果本身在第一帧则不做任何反应
* @method prevFrame
* @since 1.0.0
* @public
*/
prevFrame(): void;
/**
* 将播放头跳转到指定帧并停在那一帧,如果本身在第一帧则不做任何反应
* @method gotoAndStop
* @public
* @since 1.0.0
* @param {number} frameIndex 批定帧的帧数或指定帧的标签名
*/
gotoAndStop(frameIndex: number): void;
/**
* 如果当前时间轴停在某一帧,调用此方法将继续播放.
* @method play
* @public
* @since 1.0.0
*/
play(isFront?: boolean, loop?: boolean): void;
/**
* @property _lastFrame
* @type {number}
* @private
* @default 0
*/
private _lastFrame;
/**
* 刚执行到的帧数,用于帧监听时判断用,刚好执行到当前帧,而不是之前保留的状态
* 不是60fps的videoItem的中间有几帧curFrame会不变,判断只执行一次监听时会出错,刚好动画满帧60fps时就无所谓
*/
get isInTimeFrame(): boolean;
/**
* 将播放头跳转到指定帧并从那一帧开始继续播放
* @method gotoAndPlay
* @public
* @since 1.0.0
* @param {number} frameIndex 批定帧的帧数或指定帧的标签名
* @param {boolean} isFront 跳到指定帧后是向前播放, 还是向后播放.不设置些参数将默认向前播放
*/
gotoAndPlay(frameIndex: number, isFront?: boolean): void;
/**
* 优先级最高,会覆盖
* @param beginFrame 默认1
* @param endFrame 默认 this.totalFrames
* @param loops 默认1 0
*/
startAniRange(beginFrame?: number, endFrame?: number, loops?: number, callback?: Function): void;
/**
* 开始时间,每次有play的时候就需要重置now
* 锁步思想,设置开始时间,后面每帧实际时间与开始时间相减,得到当前帧数
*
*/
private startTime;
/**
* 开始时的frame
*/
private startFrame;
/**
* 与startFrame相间隔的帧数量,绝对值
*/
private lastDeltaFrame;
/**
* 锁步时的每次end的标识
*/
private _endMark;
commonDeltaTime: number;
updateFrame(): void;
private getCurFrameWhenLockStep;
/**
* 重写刷新
* @method update
* @public
* @since 1.0.0
*/
update(deltaTime: number): void;
destroy(): void;
}
export class Svga extends MovieClip {
private _source;
autoPlay: boolean;
get source(): string;
set source(v: string);
private _setSource;
private _dataInitialized;
}
export class Parser {
/**
* url: 资源路径
* success(VideoEntity videoItem)
*/
load(url, success, failure);
loadViaWorker(url, success, failure);
}
}
......@@ -3,6 +3,8 @@ declare module engine {
export const devicePixelRatio: number;
export function computeProps(props, options);
export let StageScaleMode: {
EXACT_FIT: string;
NO_BORDER: string;
......@@ -10,7 +12,7 @@ declare module engine {
SHOW_ALL: string;
FIXED_WIDTH: string;
FIXED_HEIGHT: string;
}
};
export const osType: string;
......@@ -24,6 +26,8 @@ declare module engine {
export const DEG_TO_RAD: number;
export function transPoint(str, sep = ',');
export enum RENDERER_TYPE {
UNKNOWN = "unknown",
WEBGL = "webgl",
......@@ -8378,6 +8382,8 @@ declare module engine {
export function stopSound(name: any): void;
export function mute(muted: boolean): void;
export function destroySound(name: any): void;
export const _default: {
......
......@@ -6,38 +6,76 @@ const {compile} = require('./rollup-compiler');
const fs = require('fs-extra');
const path = require('path');
const glob = require('glob');
const watchr = require('watchr');
const program = require('commander');
const [_, __, sourcePath, outputPath = 'dist/customs'] = process.argv;
program
.option('-s, --source [string]', 'Source path')
.option('-o, --output [string]', 'Output path', 'dist/customs')
.option('-w, --watch', 'Auto build', false)
.option('-p, --prod', 'Pack with production env', false)
.parse(process.argv);
(async function(){
if (sourcePath) {
await compileProcess(sourcePath, outputPath);
(async function () {
if (program.source) {
await watchWrapper(program.source, program.output);
} else {
const files = glob.sync('*', {cwd: process.cwd() + '/src/custom'});
for (let file of files) {
await compileProcess(file, outputPath);
await compileProcess(file, program.output);
}
}
console.log('complete!');
})();
async function compileProcess(sourcePath, output) {
const id = sourcePath;
const meta = fs.readJsonSync(path.join('src/custom/' + sourcePath, 'meta.json'));
const result = await compile('src/custom/' + sourcePath + '/index.ts', false);
async function watchWrapper(sourcePath, output) {
if (program.watch) {
let srcPath = 'src/custom/' + sourcePath + '/src';
let stalker = watchr.open(srcPath, function (changeType, fullPath, currentStat, previousStat) {
console.log('watch:', fullPath);
compileProcess(sourcePath, output)
}, next);
stalker.setConfig({
interval: 100,
});
compileProcess(sourcePath, output)
} else {
await compileProcess(file, program.output)
}
}
function next(err) {
if (err) return console.log('watch failed on', path, 'with error', err);
}
async function compileProcess(id, output) {
const meta = fs.readJsonSync(path.join('src/custom/' + id, 'meta.json'));
const result = await compile('src/custom/' + id + '/src/index.ts', {
prod: program.prod,
moduleName: id,
});
meta.id = id;
if(result){
let code;
if (result) {
code = result.code;
meta.code = result.code;
}
const outputPath = path.join(output, sourcePath);
const outputPath = path.join(output, id);
console.log(outputPath);
fs.ensureDirSync(path.dirname(outputPath));
fs.writeJsonSync(outputPath + '.json', meta, {spaces: ' '});
/*fs.writeFileSync(outputPath + '.js', result.code);
fs.writeJsonSync(outputPath + '-req.json', {
let debugOutputPath = 'src/custom/' + id + '/debug/main';
if (result && result.map) {
fs.writeFileSync(debugOutputPath + '.js.map', result.map.toString());
code += `\n//# sourceMappingURL=` + 'main' + '.js.map';
}
fs.writeFileSync(debugOutputPath + '.js', code);
/*fs.writeJsonSync(outputPath + '-req.json', {
data: JSON.stringify(meta)
});*/
console.log(`compile custom [${sourcePath}] successfully!`);
console.log(`compile custom [${id}] successfully!`);
}
......@@ -9,8 +9,10 @@ const typescript = require('rollup-plugin-typescript');
const {uglify} = require('rollup-plugin-uglify');
const rollup = require('rollup');
let cache;
exports.compile = async function (file, options) {
const {prod = false} = options;
const {prod = false, moduleName} = options;
let plugins = [
progress(),
......@@ -28,20 +30,29 @@ exports.compile = async function (file, options) {
}
let writeConfig = {
format: 'cjs',
format: prod ? 'cjs' : 'umd',
name: moduleName,
sourcemap: !prod,
globals: {
tslib: 'tslib'
},
};
const bundle = await rollup.rollup({
input: file,
plugins,
onwarn: warning => {
console.log(warning);
},
external: ['tslib'],
});
const bundle = await buildWithCache();
const {output: [result]} = await bundle.generate(writeConfig);
return result;
async function buildWithCache() {
const bundle = await rollup.rollup({
input: file,
plugins,
onwarn: warning => {
console.log(warning);
},
external: ['tslib'],
cache,
});
cache = bundle.cache;
return bundle;
}
};
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'jump-high';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
engine.globalEvent.addEventListener('update-game-status', (e) => {
console.log(e.type, e.data);
});
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const {props: propsOption, assets} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('jump-high-start', {level: 1});
}, 500);
});
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>叠叠高</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "方块素材0",
"url": "//yun.duiba.com.cn/aurora/assets/0307ca8906e9f553e6873c346ae5c6ec3655db59.svga",
"uuid": "4e31f5d7-bd03-41a3-873c-3755fe4862e6",
"ext": '.svga'
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
(global = global || self, global['jump-high'] = factory(global.tslib));
}(this, (function (tslib) { 'use strict';
var props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(props, metaProps);
}
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
function getBlockAsset(type) {
return engine.getAssetByName(props.blockAssets[type]);
}
function createSvga(name, anchorName) {
var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
var anchor = props[(anchorName)];
if (anchor) {
inst.x = -anchor.x;
inst.y = -anchor.y;
inst.anchorX = anchor.x;
inst.anchorY = anchor.y;
}
return inst;
}
function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, { keep: true });
}
//# sourceMappingURL=utils.js.map
var Block = (function (_super) {
tslib.__extends(Block, _super);
function Block() {
var _this = _super.call(this) || this;
var body = _this.body = new svga.Svga();
body.x = -props.blockWidth / 2;
body.y = -props.blockHitHeight - props.blockPaddingTop;
_this.addChild(body);
return _this;
}
Block.prototype.reset = function (_a) {
var type = _a.type;
this.dir = Math.random() > 0.5 ? 1 : -1;
if (this.type != type) {
this.type = type;
var asset = getBlockAsset(type);
this.body.source = 'asset://' + asset.uuid;
}
this.scaleX = this.dir;
this.body.gotoAndStop(1);
};
Block.prototype.playEnter = function (index, animation) {
var _this = this;
this.visible = true;
this.x = this.dir * this.stage.width;
var _a = props.blockDurationRange, min = _a[0], max = _a[1];
var duration = Math.max(max - index * props.blockDurationStep, min);
duration = duration + max * Math.random() * props.blockDurationRandom * (Math.random() > 0.5 ? 1 : -1);
return new Promise(function (resolve) {
if (animation) {
engine.Tween.get(_this, null, null, true)
.to({ x: 0, }, duration)
.call(resolve);
}
else {
_this.x = 0;
setTimeout(function () {
console.log(_this.body);
}, 200);
resolve();
}
});
};
Block.prototype.playLeave = function () {
this.visible = false;
};
Block.prototype.playEffect = function () {
var body = this.body;
body.play(true, false);
body.once(engine.Event.END_FRAME, function () {
body.gotoAndStop(1);
}, this);
};
Block.prototype.stop = function () {
engine.Tween.removeTweens(this);
};
return Block;
}(engine.Container));
//# sourceMappingURL=Block.js.map
var Background = (function (_super) {
tslib.__extends(Background, _super);
function Background() {
return _super.call(this) || this;
}
Background.prototype.setup = function () {
var _a = this.stage, width = _a.width, height = _a.height;
var bg = this._bg = new engine.Image(getTextureByName('背景图'));
bg.anchorX = bg.width / 2;
bg.anchorY = bg.height / 2;
bg.x = -(bg.width - width) / 2;
bg.y = -(bg.height - height) / 2;
this.addChild(bg);
this._minScale = width / bg.width;
};
Background.prototype.playZoom = function (type, duration) {
var _this = this;
if (duration === void 0) { duration = 700; }
return new Promise(function (resolve) {
var scale = type === 'in' ? 1 : _this._minScale;
engine.Tween.get(_this._bg, null, null, true)
.to({ scaleX: scale, scaleY: scale }, duration, engine.Ease.cubicInOut)
.call(resolve);
});
};
return Background;
}(engine.Container));
//# sourceMappingURL=Background.js.map
var svgaAssets = {
aniReady: { name: '准备立正', dir: 1 },
aniJump: { name: '跳上升', dir: 1 },
aniFall: { name: '跳下落', dir: 1 },
aniLandNormal: { name: '普通着地', dir: 1 },
aniLandSide: { name: '边缘着地', dir: -1 },
aniHit: { name: '被撞开', dir: -1 },
aniParachute: { name: '降落', dir: -1 },
};
var Player = (function (_super) {
tslib.__extends(Player, _super);
function Player() {
var _this = _super.call(this) || this;
_this.g = props.gravity;
_this.addEventListener(engine.Event.ENTER_FRAME, _this.onEnterFrame, _this);
return _this;
}
Player.prototype.switchAni = function (name, dir, play, loop) {
var _this = this;
if (dir === void 0) { dir = 1; }
if (play === void 0) { play = true; }
if (loop === void 0) { loop = false; }
return new Promise(function (resolve) {
_this.scaleX = dir;
if (_this._aniName !== name) {
_this._aniName = name;
var oldAni = _this.removeChild(_this.getChildByName('body'));
if (oldAni) {
oldAni.stop();
}
var ani = _this._currentAni = _this['ani' + name];
_this.addChild(ani);
if (play) {
ani.play(false, loop);
if (loop) {
resolve();
}
else {
ani.once(engine.Event.END_FRAME, resolve);
}
}
else {
ani.gotoAndStop(1);
resolve();
}
}
});
};
Player.prototype.setup = function () {
this.prefectEffect = createSvga('完美着地特效', 'playerLandPrefectAnchor');
this.landEffect = createSvga('着地特效', 'playerLandEffectAnchor');
for (var key in svgaAssets) {
var _a = svgaAssets[key], name = _a.name, dir = _a.dir;
var body = this[key] = createSvga(name, key.replace('ani', 'player') + 'Anchor');
body.name = 'body';
body.scaleX = dir;
}
};
Player.prototype.reset = function (revive) {
this.x = 0;
this.rotation = 0;
this.scaleX = this.scaleY = 1;
this._prefectLandCounting = 0;
engine.Tween.removeTweens(this);
if (revive) {
this.switchAni('Jump', 1, false);
}
};
Player.prototype.playReady = function () {
var _this = this;
return new Promise(function (resolve) {
_this.switchAni('Ready', 1);
_this._currentAni.once(engine.Event.END_FRAME, function () {
this.switchAni('Jump', 1, false);
resolve();
}, _this);
});
};
Player.prototype.onEnterFrame = function (event) {
if (!this.playing) {
return;
}
this.vy += this.g;
this.y += this.vy;
if (this.vy > 0 && this._aniName !== 'Fall') {
this.dispatchEvent('jump-on-top');
this.switchAni('Fall');
}
if (this.y > this.baseY) {
this.y = this.baseY;
this.playing = false;
this.jumpPromise && this.jumpPromise({
aboveBlock: this.aboveBlock,
});
this.jumpPromise = null;
}
};
Player.prototype.changeBaseY = function (v) {
if (this.baseY == v) {
return;
}
this.aboveBlock = true;
this.baseY = v;
};
Player.prototype.jump = function () {
var _this = this;
playSound('跳起音效');
this.switchAni('Jump', 1, false);
this._currentAni.play(false, false);
this.aboveBlock = false;
this.playing = true;
this.baseY = this.y;
this.vy = -props.jumpSpeed;
return new Promise(function (resolve) {
_this.jumpPromise = resolve;
});
};
Player.prototype.playLand = function (type, dir) {
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, prefectEffect_1, landEffect_1;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = type;
switch (_a) {
case 0: return [3, 1];
case 1: return [3, 3];
case 2: return [3, 3];
case 3: return [3, 4];
}
return [3, 5];
case 1:
this._prefectLandCounting++;
playSound('完美落地音效' + Math.min(4, this._prefectLandCounting));
prefectEffect_1 = this.prefectEffect;
this.addChildAt(prefectEffect_1, 0);
prefectEffect_1.gotoAndPlay(1);
prefectEffect_1.once(engine.Event.END_FRAME, function () {
this.removeChild(prefectEffect_1);
}, this);
landEffect_1 = this.landEffect;
this.addChildAt(landEffect_1, 0);
landEffect_1.gotoAndPlay(1);
landEffect_1.once(engine.Event.END_FRAME, function () {
this.removeChild(landEffect_1);
}, this);
return [4, this.switchAni('LandNormal')];
case 2:
_b.sent();
return [3, 5];
case 3:
this._prefectLandCounting = 0;
playSound('普通落地音效');
this.switchAni('LandNormal');
return [3, 5];
case 4:
this._prefectLandCounting = 0;
playSound('边缘落地音效');
this.switchAni('LandSide', dir);
return [3, 5];
case 5: return [2];
}
});
});
};
Player.prototype.hitAway = function (dir) {
return tslib.__awaiter(this, void 0, void 0, function () {
var _this = this;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this.jumpPromise && this.jumpPromise();
this.jumpPromise = null;
playSound('被撞开音效');
this.switchAni('Hit', dir);
this.vy = 0;
return [4, new Promise(function (resolve) {
engine.Tween.get(_this)
.to({
x: -dir * props.hitAwayDistance.x,
}, props.hitAwayDuration, engine.Ease.quartOut);
engine.Tween.get(_this)
.to({
y: _this.y + props.hitAwayDistance.y,
}, props.hitAwayDuration, engine.Ease.cubicOut)
.call(resolve);
})];
case 1:
_a.sent();
return [2];
}
});
});
};
Player.prototype.parachute = function (dir) {
var _this = this;
this.switchAni('Parachute', dir);
return new Promise(function (resolve) {
engine.Tween.get(_this)
.wait(200)
.call(function () {
playSound('降落伞下落音效');
})
.wait(300)
.to({ y: _this.y + props.parachuteDistance }, props.parachuteDuration)
.set({ anchorOffsetY: 0 })
.call(resolve);
});
};
return Player;
}(engine.Container));
//# sourceMappingURL=Player.js.map
var Base = (function (_super) {
tslib.__extends(Base, _super);
function Base() {
return _super.call(this, getTextureByName('底座')) || this;
}
Base.prototype.setup = function () {
this.x = -(this.width) / 2;
};
Base.prototype.reset = function () {
this.y = -props.baseOffset;
};
return Base;
}(engine.Image));
//# sourceMappingURL=Base.js.map
var GuideLayer = (function (_super) {
tslib.__extends(GuideLayer, _super);
function GuideLayer() {
var _this = _super.call(this) || this;
_this.setup();
return _this;
}
GuideLayer.prototype.setup = function () {
};
GuideLayer.prototype.show = function (id, options) {
var _this = this;
return new Promise(function (resolve) {
_this.visible = true;
if (!_this.guideMask) {
var _a = _this.stage, width = _a.width, height = _a.height;
var guideMask = _this.guideMask = new engine.Container();
var guideHole = new engine.Image(getTextureByName('引导遮罩'));
guideHole.x = (width - guideHole.width) / 2;
guideHole.y = options.y;
guideMask.addChild(guideHole);
_this.createRect(guideMask, 0, 0, width, guideHole.y);
_this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);
_this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);
_this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);
var label = _this.label = new engine.Label();
label.fillColor = 'white';
label.size = 25;
label.text = props.guideText;
label.x = (width - label.width) / 2;
label.y = guideHole.y + guideHole.height + 50;
guideMask.addChild(label);
_this.addChild(guideMask);
}
_this.once(engine.MouseEvent.CLICK, function () {
this.visible = false;
resolve();
}, _this);
});
};
GuideLayer.prototype.createRect = function (container, x, y, width, height) {
var rect = new engine.Rect();
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
rect.fillColor = 'black';
rect.alpha = 0.7;
container.addChild(rect);
};
return GuideLayer;
}(engine.Container));
//# sourceMappingURL=GuideLayer.js.map
var GoldBag = (function (_super) {
tslib.__extends(GoldBag, _super);
function GoldBag() {
var _this = _super.call(this) || this;
_this.setup();
return _this;
}
GoldBag.prototype.setup = function () {
var avatar = this.avatar = new engine.Sprite(getTextureByName('钱袋-静态'));
avatar.x = -props.goldPackAvatarAnchor.x;
avatar.y = -props.goldPackAvatarAnchor.y;
this.addChild(avatar);
var svga = this.svga = createSvga('钱袋', 'goldPackAnchor');
svga.visible = false;
this.addChild(svga);
};
GoldBag.prototype.reset = function (data) {
this.y = data.y;
this.avatar.visible = true;
this.svga.visible = false;
this.svga.gotoAndStop(1);
this.remain = data.remain;
};
GoldBag.prototype.playOpen = function () {
var _this = this;
this.avatar.visible = false;
this.svga.visible = true;
return new Promise(function (resolve) {
_this.svga.play(true, false);
_this.svga.once(engine.Event.END_FRAME, function () {
this.svga.visible = false;
resolve();
}, _this);
});
};
return GoldBag;
}(engine.Container));
//# sourceMappingURL=GoldBag.js.map
var ObjectPool = engine.ObjectPool;
var PoolName = 'gold-bag';
ObjectPool.registerPool(PoolName, function () {
return new GoldBag();
}, function (item, data) {
item.reset(data);
});
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
function GameView() {
var _this = _super.call(this) || this;
_this.index = -1;
_this.goldBags = [];
_this.baseOffset = -props.baseOffset + props.playerOffset;
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
GameView.prototype.setup = function () {
if (this._hasSetup) {
return;
}
this._hasSetup = true;
var _a = this.stage, width = _a.width, height = _a.height;
var background = this.background = new Background();
this.addChild(background);
background.setup();
var frontContainer = this.frontContainer = new engine.Container();
frontContainer.x = width / 2;
this.addChild(frontContainer);
var guideLayer = this.guideLayer = new GuideLayer();
this.addChild(guideLayer);
var base = this.base = new Base();
frontContainer.addChild(base);
base.setup();
var blockContainer = this.blockContainer = new engine.Container();
frontContainer.addChild(blockContainer);
var player = this.player = new Player();
frontContainer.addChild(player);
player.setup();
player.addEventListener('jump-on-top', this.onPlayerJumpOnTop, this);
ObjectPool.recycleObject(PoolName, ObjectPool.getObject(PoolName, {
y: 0,
remain: 0,
}));
this.hitEffect = createSvga('被撞烟雾', 'hitEffectAnchor');
this.pos = 0;
this.background.setup();
this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
this.reset();
};
GameView.prototype.reset = function (revive) {
if (revive === void 0) { revive = false; }
return tslib.__awaiter(this, void 0, void 0, function () {
var blockContainer, i, li, block, i, i, li, goldBag;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this.base.reset();
this.index = -1;
this._score = 0;
if (revive) ;
else {
this.pos = 0;
blockContainer = this.blockContainer;
for (i = 0, li = blockContainer.children.length; i < li; i++) {
block = blockContainer.getChildAt(i);
block.playLeave();
}
}
for (i = 0; i < props.initBlockCount; i++) {
this.addBlock(false);
}
for (i = 0, li = this.goldBags.length; i < li; i++) {
goldBag = this.goldBags[i];
this.frontContainer.removeChild(goldBag);
ObjectPool.recycleObject(PoolName, goldBag);
}
this.goldBags.splice(0);
this.playZoom('in');
return [4, this.resetPlayer(revive)];
case 1:
_a.sent();
return [2];
}
});
});
};
GameView.prototype.resetPlayer = function (revive) {
if (revive === void 0) { revive = false; }
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
this.player.reset(revive);
this.player.y = this.baseOffset - (this.index + 1) * props.blockHitHeight;
return [2];
});
});
};
GameView.prototype.start = function (revive) {
if (revive === void 0) { revive = false; }
return tslib.__awaiter(this, void 0, void 0, function () {
var guideFlagKey, guideFlag;
var _this = this;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!revive) return [3, 2];
return [4, this.player.playReady()];
case 1:
_a.sent();
_a.label = 2;
case 2:
guideFlagKey = 'jump-high-guide_' + props.guideFlagKey;
guideFlag = localStorage.getItem(guideFlagKey);
if (!!guideFlag) return [3, 4];
localStorage.setItem(guideFlagKey, '1');
return [4, this.guideLayer.show('', { y: this.stage.height + this.player.y - 280 })];
case 3:
_a.sent();
_a.label = 4;
case 4:
this.lastLandType = 0;
this._remainToShowGoldBag = props.goldBagScoreMultiple - props.goldBagScoreSubtraction;
this._touchEnabled = true;
setTimeout(function () {
_this.addBlock();
}, 100);
engine.globalEvent.dispatchEvent('jump-high-game-start');
return [2];
}
});
});
};
GameView.prototype.pause = function () {
if (this.currentBlock) {
engine.Tween.pauseTweens(this.currentBlock);
}
engine.Tween.pauseTweens(this.player);
};
GameView.prototype.resume = function () {
if (this.currentBlock) {
engine.Tween.resumeTweens(this.currentBlock);
}
engine.Tween.resumeTweens(this.player);
};
GameView.prototype.revive = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this.blockContainer.getChildAt(this.index).visible = false;
this.index--;
return [4, this.resetPlayer(true)];
case 1:
_a.sent();
return [4, this.playZoom('in')];
case 2:
_a.sent();
this.start(true);
return [2];
}
});
});
};
GameView.prototype.addBlock = function (animation) {
var _this = this;
if (animation === void 0) { animation = true; }
this.index++;
var blockContainer = this.blockContainer;
var block;
if (blockContainer.children.length > this.index) {
block = blockContainer.getChildAt(this.index);
block.visible = true;
}
else {
block = new Block();
blockContainer.addChild(block);
}
block.reset({
type: Math.floor(Math.random() * props.blockAssets.length),
});
block.y = this.baseOffset - this.index * props.blockHitHeight;
this.blockComplete = false;
block.playEnter(this.index, animation).then(function (data) {
_this.blockComplete = true;
});
if (animation) {
this.needHitTest = true;
}
this.currentBlock = block;
};
GameView.prototype.addGoldBag = function () {
var goldBag = ObjectPool.getObject(PoolName, {
y: this.baseOffset - (this.blockCount + props.goldBagDistance + props.goldBagJumpSubtraction) * props.blockHitHeight,
remain: props.goldBagDistance,
});
this.frontContainer.addChild(goldBag);
this.goldBags.push(goldBag);
};
GameView.prototype.playOpenGoldBag = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
var i, li, goldBag;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
i = 0, li = this.goldBags.length;
_a.label = 1;
case 1:
if (!(i < li)) return [3, 4];
goldBag = this.goldBags[i];
goldBag.remain--;
if (!(goldBag.remain <= 0)) return [3, 3];
this.goldBags.splice(i, 1);
i--;
li--;
this.nextToUpdateScore = true;
return [4, goldBag.playOpen()];
case 2:
_a.sent();
this.frontContainer.removeChild(goldBag);
ObjectPool.recycleObject(PoolName, goldBag);
_a.label = 3;
case 3:
i++;
return [3, 1];
case 4: return [2];
}
});
});
};
GameView.prototype.onPlayerJumpOnTop = function () {
if (this.nextToUpdateScore) {
this.nextToUpdateScore = false;
this.scoreChange(4);
playSound('撞击钱袋音效');
}
};
Object.defineProperty(GameView.prototype, "blockCount", {
get: function () {
return this.index - props.initBlockCount + 1;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GameView.prototype, "pos", {
get: function () {
return this._pos;
},
set: function (v) {
this._pos = v;
this.updatePos();
},
enumerable: true,
configurable: true
});
GameView.prototype.updatePos = function () {
this.frontContainer.y = this.stage.height + this._pos;
};
GameView.prototype.onEnterFrame = function (event) {
if (this.needHitTest) {
if (this.currentBlock) {
var _a = this.currentBlock, bx = _a.x, by = _a.y, dir = _a.dir;
var _b = this.player, px = _b.x, py = _b.y;
var blockHitWidth = props.blockHitWidth, blockHitHeight = props.blockHitHeight, playerWidth = props.playerWidth;
var hitOn = false;
if (Math.abs(px - bx) < (blockHitWidth + playerWidth) / 2) {
this.player.changeBaseY(by - blockHitHeight);
if (py > by - blockHitHeight) {
hitOn = true;
}
}
if (hitOn) {
this.onHitOn(dir);
}
}
}
};
GameView.prototype.onHitOn = function (dir) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this._touchEnabled = false;
this.needHitTest = false;
clearInterval(this.timer);
this.currentBlock.stop();
this.playHitEffect(dir);
return [4, this.player.hitAway(dir)];
case 1:
_a.sent();
this.playZoom('out');
return [4, this.player.parachute(dir)];
case 2:
_a.sent();
engine.globalEvent.dispatchEvent('jump-high-game-end');
return [2];
}
});
});
};
GameView.prototype.jump = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
var result, pos, type, lastLandType;
var _this = this;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this._touchEnabled) {
return [2];
}
this._touchEnabled = false;
this.playOpenGoldBag();
return [4, this.player.jump()];
case 1:
result = _a.sent();
if (!result) return [3, 5];
if (!result.aboveBlock) return [3, 4];
pos = Math.abs(this.currentBlock.x);
type = 0;
if (pos > 0) {
type = pos > 0 && pos < props.scoreThreshold ? 2 : 3;
}
lastLandType = this.lastLandType;
this.lastLandType = type;
if (type === 0) {
if (lastLandType !== type) {
type = 1;
}
}
if (type < 3) {
this.currentBlock.playEffect();
}
this.player.playLand(type, this.currentBlock.dir);
this.currentBlock.stop();
this.scoreChange(type);
return [4, this.playShake()];
case 2:
_a.sent();
return [4, new Promise(function (resolve) {
engine.Tween.get(_this, null, null, true)
.to({ pos: props.blockHitHeight * _this.index }, 300, engine.Ease.cubicOut)
.call(resolve);
})];
case 3:
_a.sent();
this.addBlock();
_a.label = 4;
case 4:
this._touchEnabled = true;
_a.label = 5;
case 5: return [2];
}
});
});
};
GameView.prototype.scoreChange = function (type) {
var scoreAdd = props.scoreWeights[type];
this._score += scoreAdd;
this._remainToShowGoldBag -= scoreAdd;
var score = this._score;
engine.globalEvent.dispatchEvent('jump-high-score', {
type: type,
score: score,
scoreAdd: scoreAdd,
});
console.log(score, this._remainToShowGoldBag);
if (this._remainToShowGoldBag <= 0) {
this._remainToShowGoldBag += props.goldBagScoreMultiple;
this.addGoldBag();
console.log('addGoldBag');
}
};
GameView.prototype.playHitEffect = function (dir) {
var hitEffect = this.hitEffect;
hitEffect.scaleX = dir;
hitEffect.y = this.player.y - props.hitEffectAnchor.y;
hitEffect.play(true, false);
hitEffect.once(engine.Event.END_FRAME, function () {
this.frontContainer.removeChild(hitEffect);
}, this);
this.frontContainer.addChild(hitEffect);
};
GameView.prototype.playZoom = function (type, duration) {
var _this = this;
if (duration === void 0) { duration = 700; }
this.background.playZoom(type, duration);
var count = this.stage.height / props.blockHitHeight;
return new Promise(function (resolve) {
_this.frontContainer.anchorY = -props.blockHitHeight * (_this.index + count * 1.3) + props.baseOffset;
var scale = type === 'in' ? 1 : Math.min((_this.stage.height / props.blockHitHeight / (_this.index + count)), props.maxScale);
console.log(scale);
engine.Tween.get(_this.frontContainer, null, null, true)
.to({ scaleX: scale, scaleY: scale }, duration, engine.Ease.cubicInOut)
.call(resolve);
});
};
GameView.prototype.playShake = function () {
var _this = this;
var _a = this.frontContainer, x = _a.x, y = _a.y;
return new Promise(function (resolve) {
var shakeOffset = 7;
var duration = 30;
engine.Tween.get(_this.frontContainer, null, null, true)
.to({ x: x, y: y - shakeOffset }, duration)
.to({ x: x, y: y + shakeOffset }, duration)
.to({ x: x + shakeOffset, y: y }, duration)
.to({ x: x - shakeOffset, y: y }, duration)
.to({ x: x, y: y }, duration)
.call(resolve);
});
};
return GameView;
}(engine.Container));
var JumpHigh = (function (_super) {
tslib.__extends(JumpHigh, _super);
function JumpHigh() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('jump-high-reset', _this.reset, _this);
engine.globalEvent.addEventListener('jump-high-start', _this.start, _this);
engine.globalEvent.addEventListener('jump-high-pause', _this.pause, _this);
engine.globalEvent.addEventListener('jump-high-resume', _this.resume, _this);
engine.globalEvent.addEventListener('jump-high-revive', _this.revive, _this);
_this.addEventListener(engine.MouseEvent.MOUSE_DOWN, _this.onTap, _this);
var gameView = _this._gameView = new GameView();
_this.addChild(gameView);
return _this;
}
JumpHigh.prototype.reset = function () {
this._gameView.reset();
};
JumpHigh.prototype.start = function (event) {
{
injectProps(event.data);
}
this._status = 1;
this._gameView.start();
};
JumpHigh.prototype.pause = function () {
this._gameView.pause();
};
JumpHigh.prototype.resume = function () {
this._gameView.resume();
};
JumpHigh.prototype.revive = function () {
this._gameView.revive();
};
JumpHigh.prototype.onTap = function (event) {
this._gameView.jump();
};
return JumpHigh;
}(engine.Container));
//# sourceMappingURL=JumpHigh.js.map
function index (props) {
prepareProps();
injectProps(props);
var instance = new JumpHigh();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/jump-high/src/props.ts","src/custom/jump-high/src/game/utils.ts","src/custom/jump-high/src/game/Block.ts","src/custom/jump-high/src/game/Background.ts","src/custom/jump-high/src/game/Player.ts","src/custom/jump-high/src/game/Base.ts","src/custom/jump-high/src/game/GuideLayer.ts","src/custom/jump-high/src/game/GoldBag.ts","src/custom/jump-high/src/game/GameView.ts","src/custom/jump-high/src/game/JumpHigh.ts","src/custom/jump-high/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\nimport {props} from \"../props\";\n\nexport function getTexture(uuid) {\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\n}\n\nexport function getTextureByName(name) {\n\treturn getTexture(engine.getAssetByName(name).uuid);\n}\n\nexport function getBlockAsset(type) {\n\treturn engine.getAssetByName(props.blockAssets[type]);\n}\n\nexport function createSvga(name, anchorName) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + engine.getAssetByName(name).uuid;\n\tlet anchor = props[(anchorName)];\n\tif (anchor) {\n\t\tinst.x = -anchor.x;\n\t\tinst.y = -anchor.y;\n\n\t\tinst.anchorX = anchor.x;\n\t\tinst.anchorY = anchor.y;\n\t}\n\treturn inst;\n}\n\nexport function playSound(name) {\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\n}\n","/**\n * Created by rockyl on 2018/8/17.\n * 障碍块\n */\n\nimport {getBlockAsset} from \"./utils\";\nimport {props} from \"../props\";\n\nexport default class Block extends engine.Container {\n\tprivate body: svga.Svga;\n\n\ttype;\n\tdir;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body = this.body = new svga.Svga();\n\t\tbody.x = -props.blockWidth / 2;\n\t\tbody.y = -props.blockHitHeight - props.blockPaddingTop;\n\t\tthis.addChild(body);\n\t}\n\n\treset({type,}) {\n\t\tthis.dir = Math.random() > 0.5 ? 1 : -1;\n\n\t\tif (this.type != type) {\n\t\t\tthis.type = type;\n\n\t\t\tlet asset = getBlockAsset(type);\n\t\t\tthis.body.source = 'asset://' + asset.uuid;\n\t\t}\n\t\tthis.scaleX = this.dir;\n\t\tthis.body.gotoAndStop(1);\n\t}\n\n\tplayEnter(index, animation) {\n\t\tthis.visible = true;\n\t\tthis.x = this.dir * this.stage.width;\n\t\tconst [min, max] = props.blockDurationRange;\n\t\tlet duration = Math.max(max - index * props.blockDurationStep, min);\n\t\tduration = duration + max * Math.random() * props.blockDurationRandom * (Math.random() > 0.5 ? 1 : -1);\n\t\treturn new Promise(resolve => {\n\t\t\tif (animation) {\n\t\t\t\tengine.Tween.get(this, null, null, true)\n\t\t\t\t\t.to({x: 0,}, duration)\n\t\t\t\t\t.call(resolve);\n\t\t\t} else {\n\t\t\t\tthis.x = 0;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconsole.log(this.body);\n\t\t\t\t}, 200);\n\t\t\t\tresolve();\n\t\t\t}\n\t\t})\n\t}\n\n\tplayLeave() {\n\t\tthis.visible = false;\n\t}\n\n\tplayEffect() {\n\t\tlet body = this.body;\n\t\tbody.play(true, false);\n\t\tbody.once(engine.Event.END_FRAME, function () {\n\t\t\tbody.gotoAndStop(1);\n\t\t}, this);\n\t}\n\n\tstop() {\n\t\tengine.Tween.removeTweens(this);\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\nimport {getTextureByName} from \"./utils\";\n\nexport class Background extends engine.Container {\n\tprivate _bg: engine.Image;\n\tprivate _minScale: number;\n\n\tconstructor() {\n\t\tsuper();\n\n\t}\n\n\tsetup() {\n\t\tconst {width, height} = this.stage;\n\n\t\tlet bg = this._bg = new engine.Image(getTextureByName('背景图'));\n\t\tbg.anchorX = bg.width / 2;\n\t\tbg.anchorY = bg.height / 2;\n\t\tbg.x = -(bg.width - width) / 2;\n\t\tbg.y = -(bg.height - height) / 2;\n\t\tthis.addChild(bg);\n\n\t\tthis._minScale = width / bg.width;\n\t}\n\n\tplayZoom(type: 'in' | 'out', duration = 700) {\n\t\treturn new Promise(resolve => {\n\t\t\tlet scale = type === 'in' ? 1 : this._minScale;\n\t\t\tengine.Tween.get(this._bg, null, null, true)\n\t\t\t\t.to({scaleX: scale, scaleY: scale}, duration, engine.Ease.cubicInOut)\n\t\t\t\t.call(resolve);\n\t\t})\n\t}\n}\n","/**\n * Created by rockyl on 2018/8/17.\n */\n\nimport {props} from \"../props\";\nimport {createSvga, playSound} from \"./utils\";\n\nconst svgaAssets = {\n\taniReady: {name: '准备立正', dir: 1},\n\taniJump: {name: '跳上升', dir: 1},\n\taniFall: {name: '跳下落', dir: 1},\n\taniLandNormal: {name: '普通着地', dir: 1},\n\taniLandSide: {name: '边缘着地', dir: -1},\n\taniHit: {name: '被撞开', dir: -1},\n\taniParachute: {name: '降落', dir: -1},\n};\n\nexport default class Player extends engine.Container {\n\tprivate jumpPromise;\n\tprivate playing;\n\tprivate vy;\n\tprivate g = props.gravity;\n\tprivate baseY;\n\n\tprivate aboveBlock;\n\n\tprivate _aniName;\n\n\tprivate _currentAni: svga.Svga;\n\tprivate _prefectLandCounting;\n\n\tprivate aniJump: svga.Svga;\n\tprivate aniFall: svga.Svga;\n\tprivate aniLandNormal: svga.Svga;\n\tprivate aniLandSide: svga.Svga;\n\tprivate aniHit: svga.Svga;\n\tprivate aniParachute: svga.Svga;\n\n\tprivate prefectEffect: svga.Svga;\n\tprivate landEffect: svga.Svga;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);\n\t}\n\n\tswitchAni(name, dir = 1, play = true, loop = false) {\n\t\treturn new Promise(resolve => {\n\t\t\tthis.scaleX = dir;\n\t\t\tif (this._aniName !== name) {\n\t\t\t\tthis._aniName = name;\n\t\t\t\tlet oldAni = <svga.Svga>this.removeChild(this.getChildByName('body'));\n\t\t\t\tif (oldAni) {\n\t\t\t\t\toldAni.stop();\n\t\t\t\t}\n\t\t\t\tlet ani: svga.Svga = this._currentAni = this['ani' + name];\n\t\t\t\tthis.addChild(ani);\n\n\t\t\t\tif (play) {\n\t\t\t\t\tani.play(false, loop);\n\t\t\t\t\tif (loop) {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tani.once(engine.Event.END_FRAME, resolve);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tani.gotoAndStop(1);\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tsetup() {\n\t\tthis.prefectEffect = createSvga('完美着地特效', 'playerLandPrefectAnchor');\n\t\tthis.landEffect = createSvga('着地特效', 'playerLandEffectAnchor');\n\n\t\tfor (let key in svgaAssets) {\n\t\t\tlet {name, dir} = svgaAssets[key];\n\t\t\tlet body = this[key] = createSvga(name, key.replace('ani', 'player') + 'Anchor');\n\n\t\t\tbody.name = 'body';\n\t\t\tbody.scaleX = dir;\n\t\t}\n\t}\n\n\treset(revive) {\n\t\tthis.x = 0;\n\t\tthis.rotation = 0;\n\t\tthis.scaleX = this.scaleY = 1;\n\t\tthis._prefectLandCounting = 0;\n\n\t\tengine.Tween.removeTweens(this);\n\t\tif(revive){\n\t\t\tthis.switchAni('Jump', 1, false);\n\t\t}\n\t}\n\n\tplayReady() {\n\t\treturn new Promise(resolve => {\n\t\t\tthis.switchAni('Ready', 1);\n\t\t\tthis._currentAni.once(engine.Event.END_FRAME, function () {\n\t\t\t\tthis.switchAni('Jump', 1, false);\n\t\t\t\tresolve();\n\t\t\t}, this);\n\t\t})\n\t}\n\n\tprivate onEnterFrame(event) {\n\t\tif (!this.playing) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.vy += this.g;\n\t\tthis.y += this.vy;\n\n\t\tif (this.vy > 0 && this._aniName !== 'Fall') {\n\t\t\tthis.dispatchEvent('jump-on-top');\n\t\t\tthis.switchAni('Fall');\n\t\t}\n\n\t\tif (this.y > this.baseY) {\n\t\t\tthis.y = this.baseY;\n\n\t\t\tthis.playing = false;\n\t\t\t//this.aniDown.play(0);\n\n\t\t\tthis.jumpPromise && this.jumpPromise({\n\t\t\t\taboveBlock: this.aboveBlock,\n\t\t\t});\n\t\t\tthis.jumpPromise = null;\n\t\t}\n\t}\n\n\tchangeBaseY(v) {\n\t\tif (this.baseY == v) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.aboveBlock = true;\n\t\tthis.baseY = v;\n\t}\n\n\tjump() {\n\t\tplaySound('跳起音效');\n\t\tthis.switchAni('Jump', 1, false);\n\t\tthis._currentAni.play(false, false);\n\n\t\tthis.aboveBlock = false;\n\t\tthis.playing = true;\n\n\t\tthis.baseY = this.y;\n\t\tthis.vy = -props.jumpSpeed;\n\n\t\treturn new Promise(resolve => {\n\t\t\tthis.jumpPromise = resolve;\n\t\t})\n\t}\n\n\tasync playLand(type, dir) {\n\t\tswitch (type) {\n\t\t\tcase 0:\n\t\t\t\tthis._prefectLandCounting++;\n\t\t\t\tplaySound('完美落地音效' + Math.min(4, this._prefectLandCounting));\n\n\t\t\t\tlet prefectEffect = this.prefectEffect;\n\t\t\t\tthis.addChildAt(prefectEffect, 0);\n\t\t\t\tprefectEffect.gotoAndPlay(1);\n\t\t\t\tprefectEffect.once(engine.Event.END_FRAME, function () {\n\t\t\t\t\tthis.removeChild(prefectEffect);\n\t\t\t\t}, this);\n\n\t\t\t\tlet landEffect = this.landEffect;\n\t\t\t\tthis.addChildAt(landEffect, 0);\n\t\t\t\tlandEffect.gotoAndPlay(1);\n\t\t\t\tlandEffect.once(engine.Event.END_FRAME, function () {\n\t\t\t\t\tthis.removeChild(landEffect);\n\t\t\t\t}, this);\n\n\t\t\t\tawait this.switchAni('LandNormal');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\t\tthis._prefectLandCounting = 0;\n\t\t\t\tplaySound('普通落地音效');\n\t\t\t\tthis.switchAni('LandNormal');\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tthis._prefectLandCounting = 0;\n\t\t\t\tplaySound('边缘落地音效');\n\t\t\t\tthis.switchAni('LandSide', dir);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tasync hitAway(dir) {\n\t\tthis.jumpPromise && this.jumpPromise();\n\t\tthis.jumpPromise = null;\n\n\t\tplaySound('被撞开音效');\n\t\tthis.switchAni('Hit', dir);\n\n\t\tthis.vy = 0;\n\t\tawait new Promise(resolve => {\n\t\t\tengine.Tween.get(this)\n\t\t\t\t.to({\n\t\t\t\t\tx: -dir * props.hitAwayDistance.x,\n\t\t\t\t}, props.hitAwayDuration, engine.Ease.quartOut);\n\t\t\tengine.Tween.get(this)\n\t\t\t\t.to({\n\t\t\t\t\ty: this.y + props.hitAwayDistance.y,\n\t\t\t\t}, props.hitAwayDuration, engine.Ease.cubicOut)\n\t\t\t\t.call(resolve)\n\t\t});\n\t}\n\n\tparachute(dir) {\n\t\tthis.switchAni('Parachute', dir);\n\n\t\treturn new Promise(resolve => {\n\t\t\tengine.Tween.get(this)\n\t\t\t\t.wait(200)\n\t\t\t\t.call(function () {\n\t\t\t\t\tplaySound('降落伞下落音效');\n\t\t\t\t})\n\t\t\t\t.wait(300)\n\t\t\t\t.to({y: this.y + props.parachuteDistance}, props.parachuteDuration)\n\t\t\t\t.set({anchorOffsetY: 0})\n\t\t\t\t.call(resolve)\n\t\t});\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\n\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Base extends engine.Image{\n\tconstructor(){\n\t\tsuper(getTextureByName('底座'));\n\t}\n\n\tsetup(){\n\t\tthis.x = -(this.width) / 2;\n\t}\n\n\treset(){\n\t\tthis.y = - props.baseOffset;\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-30.\n */\nimport {props} from \"../props\";\nimport {getTextureByName} from \"./utils\";\n\nexport class GuideLayer extends engine.Container {\n\tprivate guideMask: engine.Container;\n\tprivate label: engine.Label;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.setup();\n\t}\n\n\tprivate setup() {\n\n\t}\n\n\tshow(id, options) {\n\t\treturn new Promise(resolve => {\n\t\t\tthis.visible = true;\n\t\t\tif (!this.guideMask) {\n\t\t\t\tconst {width, height} = this.stage;\n\t\t\t\tlet guideMask = this.guideMask = new engine.Container();\n\n\t\t\t\tlet guideHole = new engine.Image(getTextureByName('引导遮罩'));\n\t\t\t\tguideHole.x = (width - guideHole.width) / 2;\n\t\t\t\tguideHole.y = options.y;\n\t\t\t\tguideMask.addChild(guideHole);\n\n\t\t\t\tthis.createRect(guideMask, 0, 0, width, guideHole.y);\n\t\t\t\tthis.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);\n\t\t\t\tthis.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);\n\t\t\t\tthis.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);\n\n\t\t\t\tlet label = this.label = new engine.Label();\n\t\t\t\tlabel.fillColor = 'white';\n\t\t\t\tlabel.size = 25;\n\t\t\t\tlabel.text = props.guideText;\n\t\t\t\tlabel.x = (width - label.width) / 2;\n\t\t\t\tlabel.y = guideHole.y + guideHole.height + 50;\n\t\t\t\tguideMask.addChild(label);\n\n\t\t\t\tthis.addChild(guideMask);\n\t\t\t}\n\t\t\tthis.once(engine.MouseEvent.CLICK, function(){\n\t\t\t\tthis.visible = false;\n\t\t\t\tresolve();\n\t\t\t}, this);\n\t\t})\n\t}\n\n\tcreateRect(container, x, y, width, height) {\n\t\tlet rect = new engine.Rect();\n\t\trect.x = x;\n\t\trect.y = y;\n\t\trect.width = width;\n\t\trect.height = height;\n\t\trect.fillColor = 'black';\n\t\trect.alpha = 0.7;\n\n\t\tcontainer.addChild(rect);\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\n\nimport {props} from '../props'\nimport {createSvga, getTextureByName} from \"./utils\";\n\nexport class GoldBag extends engine.Container {\n\tprivate svga: svga.Svga;\n\tprivate avatar: engine.Sprite;\n\n\tremain: number;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.setup();\n\t}\n\n\tsetup() {\n\t\tlet avatar = this.avatar = new engine.Sprite(getTextureByName('钱袋-静态'));\n\t\tavatar.x = -props.goldPackAvatarAnchor.x;\n\t\tavatar.y = -props.goldPackAvatarAnchor.y;\n\t\tthis.addChild(avatar);\n\t\tlet svga = this.svga = createSvga('钱袋', 'goldPackAnchor');\n\t\tsvga.visible = false;\n\t\tthis.addChild(svga);\n\t}\n\n\treset(data) {\n\t\tthis.y = data.y;\n\t\tthis.avatar.visible = true;\n\t\tthis.svga.visible = false;\n\t\tthis.svga.gotoAndStop(1);\n\t\tthis.remain = data.remain;\n\t}\n\n\tplayOpen() {\n\t\tthis.avatar.visible = false;\n\t\tthis.svga.visible = true;\n\t\treturn new Promise(resolve => {\n\t\t\tthis.svga.play(true, false);\n\t\t\tthis.svga.once(engine.Event.END_FRAME, function () {\n\t\t\t\tthis.svga.visible = false;\n\t\t\t\tresolve();\n\t\t\t}, this);\n\t\t})\n\t}\n}\n","/**\n * Created by rockyl on 2018/8/16.\n */\nimport Block from \"./Block\";\nimport {Background} from \"./Background\";\nimport Player from \"./Player\";\nimport {props} from \"../props\";\nimport {createSvga, getTextureByName, playSound} from \"./utils\";\nimport {Base} from \"./Base\";\nimport {GuideLayer} from \"./GuideLayer\";\nimport {GoldBag} from \"./GoldBag\";\nimport ObjectPool = engine.ObjectPool;\n\nconst PoolName: string = 'gold-bag';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new GoldBag();\n}, function (item: GoldBag, data) {\n\titem.reset(data);\n});\n\nexport default class GameView extends engine.Container {\n\tbackground: Background;\n\tbase: Base;\n\tfrontContainer: engine.Container;\n\tblockContainer: engine.Container;\n\tguideLayer: GuideLayer;\n\tplayer: Player;\n\thitEffect: svga.Svga;\n\n\tcurrentBlock: Block;\n\tneedHitTest;\n\n\tindex = -1;\n\tblockComplete;\n\n\tbaseOffset: number;\n\n\ttimer;\n\n\t_pos;\n\t_score;\n\t_remainToShowGoldBag;\n\tlastLandType;\n\n\t_touchEnabled;\n\tprivate _hasSetup;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.baseOffset = -props.baseOffset + props.playerOffset;\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\n\t\tconst {width, height} = this.stage;\n\n\t\tconst background = this.background = new Background();\n\t\tthis.addChild(background);\n\t\tbackground.setup();\n\n\t\tconst frontContainer = this.frontContainer = new engine.Container();\n\t\tfrontContainer.x = width / 2;\n\t\tthis.addChild(frontContainer);\n\n\t\tconst guideLayer = this.guideLayer = new GuideLayer();\n\t\tthis.addChild(guideLayer);\n\n\t\tconst base = this.base = new Base();\n\t\tfrontContainer.addChild(base);\n\t\tbase.setup();\n\n\t\tconst blockContainer = this.blockContainer = new engine.Container();\n\t\tfrontContainer.addChild(blockContainer);\n\n\t\tconst player = this.player = new Player();\n\t\tfrontContainer.addChild(player);\n\t\tplayer.setup();\n\t\tplayer.addEventListener('jump-on-top', this.onPlayerJumpOnTop, this);\n\n\t\tObjectPool.recycleObject(PoolName, ObjectPool.getObject(PoolName, {\n\t\t\ty: 0,\n\t\t\tremain: 0,\n\t\t}));\n\n\t\tthis.hitEffect = createSvga('被撞烟雾', 'hitEffectAnchor');\n\n\t\tthis.pos = 0;\n\n\t\tthis.background.setup();\n\t\tthis.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);\n\n\t\tthis.reset();\n\t}\n\n\tasync reset(revive = false) {\n\t\tthis.base.reset();\n\t\tthis.index = -1;\n\t\tthis._score = 0;\n\n\t\tif (revive) {\n\t\t} else {\n\t\t\tthis.pos = 0;\n\t\t\tconst blockContainer = this.blockContainer;\n\t\t\tfor (let i = 0, li = blockContainer.children.length; i < li; i++) {\n\t\t\t\tconst block = <Block>blockContainer.getChildAt(i);\n\t\t\t\tblock.playLeave();\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < props.initBlockCount; i++) {\n\t\t\tthis.addBlock(false);\n\t\t}\n\n\t\tfor (let i = 0, li = this.goldBags.length; i < li; i++) {\n\t\t\tconst goldBag = this.goldBags[i];\n\t\t\tthis.frontContainer.removeChild(goldBag);\n\t\t\tObjectPool.recycleObject(PoolName, goldBag);\n\t\t}\n\t\tthis.goldBags.splice(0);\n\t\t//this.addGoldBag();\n\n\t\tthis.playZoom('in');\n\t\tawait this.resetPlayer(revive);\n\t}\n\n\tasync resetPlayer(revive = false) {\n\t\tthis.player.reset(revive);\n\t\tthis.player.y = this.baseOffset - (this.index + 1) * props.blockHitHeight;\n\t}\n\n\tasync start(revive = false) {\n\t\tif (!revive) {\n\t\t\tawait this.player.playReady();\n\t\t}\n\n\t\tlet guideFlagKey = 'jump-high-guide_' + props.guideFlagKey;\n\t\tlet guideFlag = localStorage.getItem(guideFlagKey);\n\t\tif (!guideFlag) {\n\t\t\tlocalStorage.setItem(guideFlagKey, '1');\n\t\t\tawait this.guideLayer.show('', {y: this.stage.height + this.player.y - 280});\n\t\t}\n\n\t\tthis.lastLandType = 0;\n\t\tthis._remainToShowGoldBag = props.goldBagScoreMultiple - props.goldBagScoreSubtraction;\n\t\tthis._touchEnabled = true;\n\t\tsetTimeout(() => {\n\t\t\tthis.addBlock();\n\t\t}, 100);\n\t\tengine.globalEvent.dispatchEvent('jump-high-game-start');\n\t}\n\n\tpause() {\n\t\tif (this.currentBlock) {\n\t\t\tengine.Tween.pauseTweens(this.currentBlock);\n\t\t}\n\t\tengine.Tween.pauseTweens(this.player);\n\t}\n\n\tresume() {\n\t\tif (this.currentBlock) {\n\t\t\tengine.Tween.resumeTweens(this.currentBlock);\n\t\t}\n\t\tengine.Tween.resumeTweens(this.player);\n\t}\n\n\tasync revive() {\n\t\tthis.blockContainer.getChildAt(this.index).visible = false;\n\t\tthis.index--;\n\t\tawait this.resetPlayer(true);\n\t\tawait this.playZoom('in');\n\t\tthis.start(true);\n\t}\n\n\taddBlock(animation = true) {\n\t\tthis.index++;\n\n\t\tconst blockContainer = this.blockContainer;\n\t\tlet block: Block;\n\n\t\tif (blockContainer.children.length > this.index) {\n\t\t\tblock = <Block>blockContainer.getChildAt(this.index);\n\t\t\tblock.visible = true;\n\t\t} else {\n\t\t\tblock = new Block();\n\t\t\tblockContainer.addChild(block);\n\t\t}\n\t\tblock.reset({\n\t\t\ttype: Math.floor(Math.random() * props.blockAssets.length),\n\t\t});\n\t\tblock.y = this.baseOffset - this.index * props.blockHitHeight;\n\n\t\tthis.blockComplete = false;\n\t\tblock.playEnter(this.index, animation).then(\n\t\t\t(data) => {\n\t\t\t\tthis.blockComplete = true;\n\t\t\t}\n\t\t);\n\n\t\tif (animation) {\n\t\t\tthis.needHitTest = true;\n\t\t}\n\t\tthis.currentBlock = block;\n\n\t\t/*if (this.blockCount > 0 && this.blockCount % props.goldBagMultiple === 0) {\n\t\t\tthis.addGoldBag();\n\t\t}*/\n\t}\n\n\tprivate goldBags: GoldBag[] = [];\n\n\taddGoldBag() {\n\t\tlet goldBag = <GoldBag>ObjectPool.getObject(PoolName, {\n\t\t\ty: this.baseOffset - (this.blockCount + props.goldBagDistance + props.goldBagJumpSubtraction) * props.blockHitHeight,\n\t\t\tremain: props.goldBagDistance,\n\t\t});\n\t\tthis.frontContainer.addChild(goldBag);\n\t\tthis.goldBags.push(goldBag);\n\t}\n\n\tprivate nextToUpdateScore;\n\n\tasync playOpenGoldBag() {\n\t\tfor (let i = 0, li = this.goldBags.length; i < li; i++) {\n\t\t\tconst goldBag = this.goldBags[i];\n\t\t\tgoldBag.remain--;\n\n\t\t\tif (goldBag.remain <= 0) {\n\t\t\t\tthis.goldBags.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tli--;\n\n\t\t\t\tthis.nextToUpdateScore = true;\n\t\t\t\tawait goldBag.playOpen();\n\t\t\t\tthis.frontContainer.removeChild(goldBag);\n\t\t\t\tObjectPool.recycleObject(PoolName, goldBag);\n\t\t\t}\n\t\t}\n\t}\n\n\tonPlayerJumpOnTop() {\n\t\tif (this.nextToUpdateScore) {\n\t\t\tthis.nextToUpdateScore = false;\n\t\t\tthis.scoreChange(4);\n\t\t\tplaySound('撞击钱袋音效');\n\t\t}\n\t}\n\n\tget blockCount() {\n\t\treturn this.index - props.initBlockCount + 1;\n\t}\n\n\tget pos() {\n\t\treturn this._pos;\n\t}\n\n\tset pos(v) {\n\t\tthis._pos = v;\n\t\tthis.updatePos();\n\t}\n\n\tupdatePos() {\n\t\tthis.frontContainer.y = this.stage.height + this._pos;\n\t}\n\n\tprivate onEnterFrame(event) {\n\t\tif (this.needHitTest) {\n\t\t\tif (this.currentBlock) {\n\t\t\t\tconst {x: bx, y: by, dir} = this.currentBlock;\n\t\t\t\tconst {x: px, y: py} = this.player;\n\t\t\t\tconst {blockHitWidth, blockHitHeight, playerWidth} = props;\n\n\t\t\t\tlet hitOn = false;\n\t\t\t\tif (Math.abs(px - bx) < (blockHitWidth + playerWidth) / 2) {\n\t\t\t\t\tthis.player.changeBaseY(by - blockHitHeight);\n\t\t\t\t\tif (py > by - blockHitHeight) {\n\t\t\t\t\t\thitOn = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hitOn) {\n\t\t\t\t\tthis.onHitOn(dir);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tasync onHitOn(dir) {\n\t\tthis._touchEnabled = false;\n\t\tthis.needHitTest = false;\n\n\t\tclearInterval(this.timer);\n\n\t\tthis.currentBlock.stop();\n\t\tthis.playHitEffect(dir);\n\t\tawait this.player.hitAway(dir);\n\t\tthis.playZoom('out');\n\t\tawait this.player.parachute(dir);\n\n\t\tengine.globalEvent.dispatchEvent('jump-high-game-end');\n\t}\n\n\tasync jump() {\n\t\tif (!this._touchEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tthis._touchEnabled = false;\n\t\tthis.playOpenGoldBag();\n\t\tconst result: any = await this.player.jump();\n\t\tif (result) {\n\t\t\tif (result.aboveBlock) {\n\t\t\t\tlet pos = Math.abs(this.currentBlock.x);\n\t\t\t\tlet type = 0;\n\t\t\t\tif (pos > 0) {\n\t\t\t\t\ttype = pos > 0 && pos < props.scoreThreshold ? 2 : 3;\n\t\t\t\t}\n\t\t\t\tlet lastLandType = this.lastLandType;\n\t\t\t\tthis.lastLandType = type;\n\t\t\t\tif (type === 0) {\n\t\t\t\t\tif (lastLandType !== type) { //如果前一次不是完美落地说明block没到正中间,所以没有重叠\n\t\t\t\t\t\ttype = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (type < 3) {\n\t\t\t\t\tthis.currentBlock.playEffect();\n\t\t\t\t}\n\t\t\t\tthis.player.playLand(type, this.currentBlock.dir);\n\t\t\t\tthis.currentBlock.stop();\n\t\t\t\tthis.scoreChange(type);\n\t\t\t\tawait this.playShake();\n\t\t\t\tawait new Promise(resolve => {\n\t\t\t\t\tengine.Tween.get(this, null, null, true)\n\t\t\t\t\t\t.to({pos: props.blockHitHeight * this.index}, 300, engine.Ease.cubicOut)\n\t\t\t\t\t\t.call(resolve)\n\t\t\t\t});\n\t\t\t\tthis.addBlock();\n\t\t\t}\n\t\t\tthis._touchEnabled = true;\n\t\t}\n\t}\n\n\tprivate scoreChange(type) {\n\t\tlet scoreAdd = props.scoreWeights[type];\n\t\tthis._score += scoreAdd;\n\t\tthis._remainToShowGoldBag -= scoreAdd;\n\t\tlet score = this._score;\n\t\tengine.globalEvent.dispatchEvent('jump-high-score', {\n\t\t\ttype,\n\t\t\tscore,\n\t\t\tscoreAdd,\n\t\t});\n\n\t\tconsole.log(score, this._remainToShowGoldBag);\n\n\t\tif (this._remainToShowGoldBag <= 0) {\n\t\t\tthis._remainToShowGoldBag += props.goldBagScoreMultiple;\n\t\t\tthis.addGoldBag();\n\t\t\tconsole.log('addGoldBag');\n\t\t}\n\t}\n\n\tplayHitEffect(dir) {\n\t\tlet hitEffect = this.hitEffect;\n\t\thitEffect.scaleX = dir;\n\t\thitEffect.y = this.player.y - props.hitEffectAnchor.y;\n\t\thitEffect.play(true, false);\n\t\thitEffect.once(engine.Event.END_FRAME, function () {\n\t\t\tthis.frontContainer.removeChild(hitEffect);\n\t\t}, this);\n\t\tthis.frontContainer.addChild(hitEffect);\n\t}\n\n\tplayZoom(type: 'in' | 'out', duration = 700) {\n\t\tthis.background.playZoom(type, duration);\n\t\tlet count = this.stage.height / props.blockHitHeight;\n\t\treturn new Promise(resolve => {\n\t\t\tthis.frontContainer.anchorY = -props.blockHitHeight * (this.index + count * 1.3) + props.baseOffset;\n\t\t\tlet scale = type === 'in' ? 1 : /*Math.max(*/Math.min((this.stage.height / props.blockHitHeight / (this.index + count)), props.maxScale)/*, props.minScale)*/;\n\t\t\tconsole.log(scale);\n\t\t\tengine.Tween.get(this.frontContainer, null, null, true)\n\t\t\t\t.to({scaleX: scale, scaleY: scale}, duration, engine.Ease.cubicInOut)\n\t\t\t\t.call(resolve);\n\t\t})\n\t}\n\n\tplayShake(){\n\t\tconst {x, y} = this.frontContainer;\n\t\treturn new Promise(resolve => {\n\t\t\tconst shakeOffset = 7;\n\t\t\tconst duration = 30;\n\t\t\tengine.Tween.get(this.frontContainer, null, null, true)\n\t\t\t\t.to({x: x, y: y - shakeOffset}, duration)\n\t\t\t\t.to({x: x, y: y + shakeOffset}, duration)\n\t\t\t\t.to({x: x + shakeOffset, y: y}, duration)\n\t\t\t\t.to({x: x - shakeOffset, y: y}, duration)\n\t\t\t\t.to({x: x, y: y}, duration)\n\t\t\t\t.call(resolve)\n\t\t})\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\nexport class JumpHigh extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tengine.globalEvent.addEventListener('jump-high-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('jump-high-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('jump-high-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('jump-high-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('jump-high-revive', this.revive, this);\n\n\t\tthis.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onTap, this);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\t}\n\n\treset() {\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tif ('jump-high-start') {\n\t\t\tinjectProps(event.data);\n\t\t}\n\n\t\tthis._status = 1;\n\n\t\tthis._gameView.start();\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tprivate onTap(event) {\n\t\tthis._gameView.jump();\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {JumpHigh} from \"./game/JumpHigh\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance = new JumpHigh();\n\treturn instance;\n}\n"],"names":["__extends"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;UCTe,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,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Props = {
};
{
"name": "叠叠高",
"desc": "叠叠高模块",
"props": {
"guideText": {
"alias": "引导文本",
"type": "string",
"default": "点击屏幕跳跃躲避飞来的钞票"
},
"guideFlagKey": {
"alias": "引导标识名",
"type": "string",
"default": "test"
},
"scoreWeights": {
"alias": "分值权重(完美,仅中央,正常,边缘,福袋)",
"type": "array<number>",
"default": "4,2,1,1,5"
},
"goldBagScoreMultiple": {
"alias": "出现钱袋的分数倍数",
"type": "number",
"default": 30
},
"goldBagScoreSubtraction": {
"alias": "出现钱袋的分数补偿",
"type": "number",
"default": 5
},
"goldBagDistance": {
"alias": "出现钱袋的距离",
"type": "number",
"default": 10
},
"goldBagJumpSubtraction": {
"alias": "跳起触碰钱袋高度偏差",
"type": "number",
"default": 6
},
"blockAssets": {
"alias": "方块素材组",
"type": "array<string>",
"default": "方块素材0"
},
"blockDurationRange": {
"alias": "方块进入时间范围",
"type": "array<number>",
"default": "500,1500"
},
"blockDurationRandom": {
"alias": "方块进入时间随机系数",
"type": "number",
"default": 0.2
},
"blockDurationStep": {
"alias": "方块进入时间递减",
"type": "number",
"default": 20
},
"gravity": {
"alias": "下落加速度",
"type": "number",
"default": 1.8
},
"scoreThreshold": {
"alias": "分数阈值数组",
"type": "number",
"default": 130
},
"blockWidth": {
"alias": "方块宽度",
"type": "number",
"default": 396
},
"blockHitWidth": {
"alias": "方块碰撞宽度",
"type": "number",
"default": 312
},
"blockHitHeight": {
"alias": "方块碰撞高度",
"type": "number",
"default": 66
},
"blockPaddingTop": {
"alias": "方块上边距",
"type": "number",
"default": 100
},
"blockPaddingBottom": {
"alias": "方块下边距",
"type": "number",
"default": 64
},
"minScale": {
"alias": "最小缩放比例",
"type": "number",
"default": 0.4
},
"maxScale": {
"alias": "最大缩放比例",
"type": "number",
"default": 0.7
},
"baseOffset": {
"alias": "底座偏移",
"type": "number",
"default": 500
},
"playerOffset": {
"alias": "角色偏移",
"type": "number",
"default": 120
},
"initBlockCount": {
"alias": "初始方块数量",
"type": "number",
"default": 1
},
"playerWidth": {
"alias": "角色宽度",
"type": "number",
"default": 100
},
"parachuteDistance": {
"alias": "降落距离",
"type": "number",
"default": 250
},
"jumpSpeed": {
"alias": "挑起速度",
"type": "number",
"default": 30
},
"parachuteDuration": {
"alias": "降落时间",
"type": "number",
"default": 3000
},
"hitAwayDistance": {
"alias": "撞开距离",
"type": "vector2",
"default": "250,50"
},
"hitAwayDuration": {
"alias": "撞开时间",
"type": "number",
"default": 1000
},
"playerReadyAnchor": {
"alias": "角色准备锚点",
"type": "vector2",
"default": "167,242"
},
"playerJumpAnchor": {
"alias": "角色跳起锚点",
"type": "vector2",
"default": "150,190"
},
"playerFallAnchor": {
"alias": "角色下落锚点",
"type": "vector2",
"default": "150,190"
},
"playerHitAnchor": {
"alias": "角色撞开锚点",
"type": "vector2",
"default": "200,290"
},
"playerParachuteAnchor": {
"alias": "角色降落锚点",
"type": "vector2",
"default": "160,310"
},
"playerLandNormalAnchor": {
"alias": "角色正常落地锚点",
"type": "vector2",
"default": "155,245"
},
"playerLandEffectAnchor": {
"alias": "角色落地特效锚点",
"type": "vector2",
"default": "310,100"
},
"playerLandSideAnchor": {
"alias": "角色边缘落地锚点",
"type": "vector2",
"default": "155,245"
},
"playerLandPrefectAnchor": {
"alias": "角色完美落地锚点",
"type": "vector2",
"default": "225,900"
},
"hitEffectAnchor": {
"alias": "被撞烟雾锚点",
"type": "vector2",
"default": "200,300"
},
"goldPackAnchor": {
"alias": "钱袋锚点",
"type": "vector2",
"default": "375,300"
},
"goldPackAvatarAnchor": {
"alias": "静态钱袋锚点",
"type": "vector2",
"default": "850,598"
}
},
"assets": [
{
"name": "背景图",
"url": "//yun.duiba.com.cn/aurora/assets/e6df446ccda45e3e6b6af8471dd1d27b4b3ea016.jpg",
"uuid": "43618417-f27f-429c-bba3-e0715e552ca2",
"ext": ".jpg"
},
{
"name": "底座",
"url": "//yun.duiba.com.cn/aurora/assets/1c0ba12a718076601b24ff63e5ab7ee59462deaa.png",
"uuid": "a6b3f654-2c26-434a-a873-aabc12cd1d80",
"ext": ".png"
},
{
"name": "引导遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/75cc4ea91654fd1e9900d071cac5ca5296b1bd19.png",
"uuid": "6879e370-59c1-453c-8d61-cd3d724ea650",
"ext": ".png"
},
{
"name": "准备立正",
"url": "//yun.duiba.com.cn/aurora/assets/883c41459f1700a17dd20a75b49717fc1b732030.svga",
"uuid": "25dc07d0-b223-4bab-8ea6-2f3282d4eb44",
"ext": ".svga"
},
{
"name": "跳上升",
"url": "//yun.duiba.com.cn/aurora/assets/5b7950568fdc540aad6444a944274ba0bf27571d.svga",
"uuid": "d0a20432-023b-4fd4-8595-f3bb726dfd5e",
"ext": ".svga"
},
{
"name": "跳下落",
"url": "//yun.duiba.com.cn/aurora/assets/7e2c1f241bf2cdcda5614b145910f3f2440ac473.svga",
"uuid": "f3b46174-3353-40c1-957f-fcd9c0227e04",
"ext": ".svga"
},
{
"name": "普通着地",
"url": "//yun.duiba.com.cn/aurora/assets/f7171bff5d525950b02dd578d705054c4ac09ad0.svga",
"uuid": "67b427ed-7dc6-475e-bcc3-a45554629d91",
"ext": ".svga"
},
{
"name": "着地特效",
"url": "//yun.duiba.com.cn/aurora/assets/f5a28ac3ef8acb9adc1ea59faf93213b56a797a0.svga",
"uuid": "cc3f6f1b-1dad-4023-a040-0c7c2ef0ca41",
"ext": ".svga"
},
{
"name": "完美着地特效",
"url": "//yun.duiba.com.cn/aurora/assets/27fa0246bb6e6af977fb29aebe19fbdb30ec03f5.svga",
"uuid": "839215b0-e5df-49db-852d-472a6a78510e",
"ext": ".svga"
},
{
"name": "边缘着地",
"url": "//yun.duiba.com.cn/aurora/assets/1eb7d525c85671c4ec3a40ab923c3142027d0d9e.svga",
"uuid": "33fabc67-c475-44bd-b403-9653abdf2d13",
"ext": ".svga"
},
{
"name": "被撞开",
"url": "//yun.duiba.com.cn/aurora/assets/30864d1f89748d1476232403ad6ab582cc806606.svga",
"uuid": "ecf58409-ecda-40f3-b152-70b0eb285caf",
"ext": ".svga"
},
{
"name": "被撞烟雾",
"url": "//yun.duiba.com.cn/aurora/assets/91841eb45559ee7f1f43378b74be10d9234aac61.svga",
"uuid": "5497949d-1f04-4403-acd8-e0191631f016",
"ext": ".svga"
},
{
"name": "降落",
"url": "//yun.duiba.com.cn/aurora/assets/eea97e28c37a2da354021f697476c7a31c8362f5.svga",
"uuid": "82b514a9-69c4-425c-a77d-f34efeef1997",
"ext": ".svga"
},
{
"name": "钱袋",
"url": "//yun.duiba.com.cn/aurora/assets/12d46f318471f2cff30306f3c0b0c506d67ee166.svga",
"uuid": "3b7feeae-ebb5-49cf-b838-64f46c585978",
"ext": ".svga"
},
{
"name": "钱袋-静态",
"url": "//yun.duiba.com.cn/aurora/assets/35116c957aa4161ea3444611530c0110a69919cf.png",
"uuid": "80a6f0f2-7934-4b2b-a1af-c566dae1040f",
"ext": ".png"
},
{
"name": "跳起音效",
"url": "//yun.duiba.com.cn/aurora/assets/8e3c6af83c20daff6ad34ff198413f0be4903039.mp3",
"uuid": "f9826065-0815-4b6d-be7f-b28478975c68",
"ext": ".mp3"
},
{
"name": "普通落地音效",
"url": "//yun.duiba.com.cn/aurora/assets/b83729366abd4c6aed590bf40bb3ad15e806c8d5.mp3",
"uuid": "dd2a8a0b-18ea-49a7-841d-221e1a3d2d50",
"ext": ".mp3"
},
{
"name": "边缘落地音效",
"url": "//yun.duiba.com.cn/aurora/assets/069079dea1901151594684de3ef294925556c1c3.mp3",
"uuid": "44bfc5ac-0093-4b40-8c8f-cef3000fb436",
"ext": ".mp3"
},
{
"name": "被撞开音效",
"url": "//yun.duiba.com.cn/aurora/assets/6f19e09e8a5300d59b069ed55b82ab8f8b876dc6.mp3",
"uuid": "f7cbf9ef-76b5-4ae8-9e05-680a3b0d223f",
"ext": ".mp3"
},
{
"name": "完美落地音效1",
"url": "//yun.duiba.com.cn/aurora/assets/c492aa71c3f385ae179977b328ec3d93c4c085e2.mp3",
"uuid": "8f5fea1d-d11f-4fd1-a27a-85b0145d54e5",
"ext": ".mp3"
},
{
"name": "完美落地音效2",
"url": "//yun.duiba.com.cn/aurora/assets/317e268d07cefddc69309941e38dbcf7d48f8ebc.mp3",
"uuid": "7452d198-9ab2-46e2-99e2-877fdce9fbe1",
"ext": ".mp3"
},
{
"name": "完美落地音效3",
"url": "//yun.duiba.com.cn/aurora/assets/5e7795c318bdf5357441085d0c681221274a72a9.mp3",
"uuid": "81209b74-d23a-4250-8695-284e9d9a6c00",
"ext": ".mp3"
},
{
"name": "完美落地音效4",
"url": "//yun.duiba.com.cn/aurora/assets/7a62f51f550ea3968fe080ee56abf28be8a92f8c.mp3",
"uuid": "ff87ce4f-c3bd-49ec-b890-4215bedb921d",
"ext": ".mp3"
},
{
"name": "降落伞下落音效",
"url": "//yun.duiba.com.cn/aurora/assets/eb4246b47a8fc2c5707d764bee2cd6a710bdc13e.mp3",
"uuid": "adb5d3ab-143f-4648-a2c4-ff794aceb2fd",
"ext": ".mp3"
},
{
"name": "撞击钱袋音效",
"url": "//yun.duiba.com.cn/aurora/assets/a6e1c99e49f258a42d65ac00b81c5a2b103aa172.mp3",
"uuid": "f06fb9b4-ef76-43ff-80ad-0f920e2ce69c",
"ext": ".mp3"
}
],
"events": {
"in": {
"jump-high-reset": {
"alias": "重置"
},
"jump-high-start": {
"alias": "开始"
},
"jump-high-revive": {
"alias": "复活"
},
"jump-high-pause": {
"alias": "暂停"
},
"jump-high-resume": {
"alias": "恢复"
}
},
"out": {
"jump-high-game-start": {
"alias": "游戏开始",
"data": {
}
},
"jump-high-game-end": {
"alias": "游戏结束",
"data": {
}
},
"jump-high-score": {
"alias": "分数变化",
"data": {
"type": "类型(0:完美,1:仅中央,2:正常,3:边缘,4:钱袋)",
"score": "分数",
"scoreAdd": "增值分数"
}
}
}
}
}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
import {getTextureByName} from "./utils";
export class Background extends engine.Container {
private _bg: engine.Image;
private _minScale: number;
constructor() {
super();
}
setup() {
const {width, height} = this.stage;
let bg = this._bg = new engine.Image(getTextureByName('背景图'));
bg.anchorX = bg.width / 2;
bg.anchorY = bg.height / 2;
bg.x = -(bg.width - width) / 2;
bg.y = -(bg.height - height) / 2;
this.addChild(bg);
this._minScale = width / bg.width;
}
playZoom(type: 'in' | 'out', duration = 700) {
return new Promise(resolve => {
let scale = type === 'in' ? 1 : this._minScale;
engine.Tween.get(this._bg, null, null, true)
.to({scaleX: scale, scaleY: scale}, duration, engine.Ease.cubicInOut)
.call(resolve);
})
}
}
/**
* Created by rockyl on 2020-01-21.
*/
import {getTextureByName} from "./utils";
import {props} from "../props";
export class Base extends engine.Image{
constructor(){
super(getTextureByName('底座'));
}
setup(){
this.x = -(this.width) / 2;
}
reset(){
this.y = - props.baseOffset;
}
}
/**
* Created by rockyl on 2018/8/17.
* 障碍块
*/
import {getBlockAsset} from "./utils";
import {props} from "../props";
export default class Block extends engine.Container {
private body: svga.Svga;
type;
dir;
constructor() {
super();
let body = this.body = new svga.Svga();
body.x = -props.blockWidth / 2;
body.y = -props.blockHitHeight - props.blockPaddingTop;
this.addChild(body);
}
reset({type,}) {
this.dir = Math.random() > 0.5 ? 1 : -1;
if (this.type != type) {
this.type = type;
let asset = getBlockAsset(type);
this.body.source = 'asset://' + asset.uuid;
}
this.scaleX = this.dir;
this.body.gotoAndStop(1);
}
playEnter(index, animation) {
this.visible = true;
this.x = this.dir * this.stage.width;
const [min, max] = props.blockDurationRange;
let duration = Math.max(max - index * props.blockDurationStep, min);
duration = duration + max * Math.random() * props.blockDurationRandom * (Math.random() > 0.5 ? 1 : -1);
return new Promise(resolve => {
if (animation) {
engine.Tween.get(this, null, null, true)
.to({x: 0,}, duration)
.call(resolve);
} else {
this.x = 0;
setTimeout(() => {
console.log(this.body);
}, 200);
resolve();
}
})
}
playLeave() {
this.visible = false;
}
playEffect() {
let body = this.body;
body.play(true, false);
body.once(engine.Event.END_FRAME, function () {
body.gotoAndStop(1);
}, this);
}
stop() {
engine.Tween.removeTweens(this);
}
}
/**
* Created by rockyl on 2018/8/16.
*/
import Block from "./Block";
import {Background} from "./Background";
import Player from "./Player";
import {props} from "../props";
import {createSvga, getTextureByName, playSound} from "./utils";
import {Base} from "./Base";
import {GuideLayer} from "./GuideLayer";
import {GoldBag} from "./GoldBag";
import ObjectPool = engine.ObjectPool;
const PoolName: string = 'gold-bag';
ObjectPool.registerPool(PoolName, function () {
return new GoldBag();
}, function (item: GoldBag, data) {
item.reset(data);
});
export default class GameView extends engine.Container {
background: Background;
base: Base;
frontContainer: engine.Container;
blockContainer: engine.Container;
guideLayer: GuideLayer;
player: Player;
hitEffect: svga.Svga;
currentBlock: Block;
needHitTest;
index = -1;
blockComplete;
baseOffset: number;
timer;
_pos;
_score;
_remainToShowGoldBag;
lastLandType;
_touchEnabled;
private _hasSetup;
constructor() {
super();
this.baseOffset = -props.baseOffset + props.playerOffset;
this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
setup() {
if (this._hasSetup) {
return;
}
this._hasSetup = true;
const {width, height} = this.stage;
const background = this.background = new Background();
this.addChild(background);
background.setup();
const frontContainer = this.frontContainer = new engine.Container();
frontContainer.x = width / 2;
this.addChild(frontContainer);
const guideLayer = this.guideLayer = new GuideLayer();
this.addChild(guideLayer);
const base = this.base = new Base();
frontContainer.addChild(base);
base.setup();
const blockContainer = this.blockContainer = new engine.Container();
frontContainer.addChild(blockContainer);
const player = this.player = new Player();
frontContainer.addChild(player);
player.setup();
player.addEventListener('jump-on-top', this.onPlayerJumpOnTop, this);
ObjectPool.recycleObject(PoolName, ObjectPool.getObject(PoolName, {
y: 0,
remain: 0,
}));
this.hitEffect = createSvga('被撞烟雾', 'hitEffectAnchor');
this.pos = 0;
this.background.setup();
this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
this.reset();
}
async reset(revive = false) {
this.base.reset();
this.index = -1;
this._score = 0;
if (revive) {
} else {
this.pos = 0;
const blockContainer = this.blockContainer;
for (let i = 0, li = blockContainer.children.length; i < li; i++) {
const block = <Block>blockContainer.getChildAt(i);
block.playLeave();
}
}
for (let i = 0; i < props.initBlockCount; i++) {
this.addBlock(false);
}
for (let i = 0, li = this.goldBags.length; i < li; i++) {
const goldBag = this.goldBags[i];
this.frontContainer.removeChild(goldBag);
ObjectPool.recycleObject(PoolName, goldBag);
}
this.goldBags.splice(0);
//this.addGoldBag();
this.playZoom('in');
await this.resetPlayer(revive);
}
async resetPlayer(revive = false) {
this.player.reset(revive);
this.player.y = this.baseOffset - (this.index + 1) * props.blockHitHeight;
}
async start(revive = false) {
if (!revive) {
await this.player.playReady();
}
let guideFlagKey = 'jump-high-guide_' + props.guideFlagKey;
let guideFlag = localStorage.getItem(guideFlagKey);
if (!guideFlag) {
localStorage.setItem(guideFlagKey, '1');
await this.guideLayer.show('', {y: this.stage.height + this.player.y - 280});
}
this.lastLandType = 0;
this._remainToShowGoldBag = props.goldBagScoreMultiple - props.goldBagScoreSubtraction;
this._touchEnabled = true;
setTimeout(() => {
this.addBlock();
}, 100);
engine.globalEvent.dispatchEvent('jump-high-game-start');
}
pause() {
if (this.currentBlock) {
engine.Tween.pauseTweens(this.currentBlock);
}
engine.Tween.pauseTweens(this.player);
}
resume() {
if (this.currentBlock) {
engine.Tween.resumeTweens(this.currentBlock);
}
engine.Tween.resumeTweens(this.player);
}
async revive() {
this.blockContainer.getChildAt(this.index).visible = false;
this.index--;
await this.resetPlayer(true);
await this.playZoom('in');
this.start(true);
}
addBlock(animation = true) {
this.index++;
const blockContainer = this.blockContainer;
let block: Block;
if (blockContainer.children.length > this.index) {
block = <Block>blockContainer.getChildAt(this.index);
block.visible = true;
} else {
block = new Block();
blockContainer.addChild(block);
}
block.reset({
type: Math.floor(Math.random() * props.blockAssets.length),
});
block.y = this.baseOffset - this.index * props.blockHitHeight;
this.blockComplete = false;
block.playEnter(this.index, animation).then(
(data) => {
this.blockComplete = true;
}
);
if (animation) {
this.needHitTest = true;
}
this.currentBlock = block;
/*if (this.blockCount > 0 && this.blockCount % props.goldBagMultiple === 0) {
this.addGoldBag();
}*/
}
private goldBags: GoldBag[] = [];
addGoldBag() {
let goldBag = <GoldBag>ObjectPool.getObject(PoolName, {
y: this.baseOffset - (this.blockCount + props.goldBagDistance + props.goldBagJumpSubtraction) * props.blockHitHeight,
remain: props.goldBagDistance,
});
this.frontContainer.addChild(goldBag);
this.goldBags.push(goldBag);
}
private nextToUpdateScore;
async playOpenGoldBag() {
for (let i = 0, li = this.goldBags.length; i < li; i++) {
const goldBag = this.goldBags[i];
goldBag.remain--;
if (goldBag.remain <= 0) {
this.goldBags.splice(i, 1);
i--;
li--;
this.nextToUpdateScore = true;
await goldBag.playOpen();
this.frontContainer.removeChild(goldBag);
ObjectPool.recycleObject(PoolName, goldBag);
}
}
}
onPlayerJumpOnTop() {
if (this.nextToUpdateScore) {
this.nextToUpdateScore = false;
this.scoreChange(4);
playSound('撞击钱袋音效');
}
}
get blockCount() {
return this.index - props.initBlockCount + 1;
}
get pos() {
return this._pos;
}
set pos(v) {
this._pos = v;
this.updatePos();
}
updatePos() {
this.frontContainer.y = this.stage.height + this._pos;
}
private onEnterFrame(event) {
if (this.needHitTest) {
if (this.currentBlock) {
const {x: bx, y: by, dir} = this.currentBlock;
const {x: px, y: py} = this.player;
const {blockHitWidth, blockHitHeight, playerWidth} = props;
let hitOn = false;
if (Math.abs(px - bx) < (blockHitWidth + playerWidth) / 2) {
this.player.changeBaseY(by - blockHitHeight);
if (py > by - blockHitHeight) {
hitOn = true;
}
}
if (hitOn) {
this.onHitOn(dir);
}
}
}
}
async onHitOn(dir) {
this._touchEnabled = false;
this.needHitTest = false;
clearInterval(this.timer);
this.currentBlock.stop();
this.playHitEffect(dir);
await this.player.hitAway(dir);
this.playZoom('out');
await this.player.parachute(dir);
engine.globalEvent.dispatchEvent('jump-high-game-end');
}
async jump() {
if (!this._touchEnabled) {
return;
}
this._touchEnabled = false;
this.playOpenGoldBag();
const result: any = await this.player.jump();
if (result) {
if (result.aboveBlock) {
let pos = Math.abs(this.currentBlock.x);
let type = 0;
if (pos > 0) {
type = pos > 0 && pos < props.scoreThreshold ? 2 : 3;
}
let lastLandType = this.lastLandType;
this.lastLandType = type;
if (type === 0) {
if (lastLandType !== type) { //如果前一次不是完美落地说明block没到正中间,所以没有重叠
type = 1;
}
}
if (type < 3) {
this.currentBlock.playEffect();
}
this.player.playLand(type, this.currentBlock.dir);
this.currentBlock.stop();
this.scoreChange(type);
await this.playShake();
await new Promise(resolve => {
engine.Tween.get(this, null, null, true)
.to({pos: props.blockHitHeight * this.index}, 300, engine.Ease.cubicOut)
.call(resolve)
});
this.addBlock();
}
this._touchEnabled = true;
}
}
private scoreChange(type) {
let scoreAdd = props.scoreWeights[type];
this._score += scoreAdd;
this._remainToShowGoldBag -= scoreAdd;
let score = this._score;
engine.globalEvent.dispatchEvent('jump-high-score', {
type,
score,
scoreAdd,
});
console.log(score, this._remainToShowGoldBag);
if (this._remainToShowGoldBag <= 0) {
this._remainToShowGoldBag += props.goldBagScoreMultiple;
this.addGoldBag();
console.log('addGoldBag');
}
}
playHitEffect(dir) {
let hitEffect = this.hitEffect;
hitEffect.scaleX = dir;
hitEffect.y = this.player.y - props.hitEffectAnchor.y;
hitEffect.play(true, false);
hitEffect.once(engine.Event.END_FRAME, function () {
this.frontContainer.removeChild(hitEffect);
}, this);
this.frontContainer.addChild(hitEffect);
}
playZoom(type: 'in' | 'out', duration = 700) {
this.background.playZoom(type, duration);
let count = this.stage.height / props.blockHitHeight;
return new Promise(resolve => {
this.frontContainer.anchorY = -props.blockHitHeight * (this.index + count * 1.3) + props.baseOffset;
let scale = type === 'in' ? 1 : /*Math.max(*/Math.min((this.stage.height / props.blockHitHeight / (this.index + count)), props.maxScale)/*, props.minScale)*/;
console.log(scale);
engine.Tween.get(this.frontContainer, null, null, true)
.to({scaleX: scale, scaleY: scale}, duration, engine.Ease.cubicInOut)
.call(resolve);
})
}
playShake(){
const {x, y} = this.frontContainer;
return new Promise(resolve => {
const shakeOffset = 7;
const duration = 30;
engine.Tween.get(this.frontContainer, null, null, true)
.to({x: x, y: y - shakeOffset}, duration)
.to({x: x, y: y + shakeOffset}, duration)
.to({x: x + shakeOffset, y: y}, duration)
.to({x: x - shakeOffset, y: y}, duration)
.to({x: x, y: y}, duration)
.call(resolve)
})
}
}
/**
* Created by rockyl on 2020-01-21.
*/
import {props} from '../props'
import {createSvga, getTextureByName} from "./utils";
export class GoldBag extends engine.Container {
private svga: svga.Svga;
private avatar: engine.Sprite;
remain: number;
constructor() {
super();
this.setup();
}
setup() {
let avatar = this.avatar = new engine.Sprite(getTextureByName('钱袋-静态'));
avatar.x = -props.goldPackAvatarAnchor.x;
avatar.y = -props.goldPackAvatarAnchor.y;
this.addChild(avatar);
let svga = this.svga = createSvga('钱袋', 'goldPackAnchor');
svga.visible = false;
this.addChild(svga);
}
reset(data) {
this.y = data.y;
this.avatar.visible = true;
this.svga.visible = false;
this.svga.gotoAndStop(1);
this.remain = data.remain;
}
playOpen() {
this.avatar.visible = false;
this.svga.visible = true;
return new Promise(resolve => {
this.svga.play(true, false);
this.svga.once(engine.Event.END_FRAME, function () {
this.svga.visible = false;
resolve();
}, this);
})
}
}
/**
* Created by rockyl on 2020-01-30.
*/
import {props} from "../props";
import {getTextureByName} from "./utils";
export class GuideLayer extends engine.Container {
private guideMask: engine.Container;
private label: engine.Label;
constructor() {
super();
this.setup();
}
private setup() {
}
show(id, options) {
return new Promise(resolve => {
this.visible = true;
if (!this.guideMask) {
const {width, height} = this.stage;
let guideMask = this.guideMask = new engine.Container();
let guideHole = new engine.Image(getTextureByName('引导遮罩'));
guideHole.x = (width - guideHole.width) / 2;
guideHole.y = options.y;
guideMask.addChild(guideHole);
this.createRect(guideMask, 0, 0, width, guideHole.y);
this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);
this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);
this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);
let label = this.label = new engine.Label();
label.fillColor = 'white';
label.size = 25;
label.text = props.guideText;
label.x = (width - label.width) / 2;
label.y = guideHole.y + guideHole.height + 50;
guideMask.addChild(label);
this.addChild(guideMask);
}
this.once(engine.MouseEvent.CLICK, function(){
this.visible = false;
resolve();
}, this);
})
}
createRect(container, x, y, width, height) {
let rect = new engine.Rect();
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
rect.fillColor = 'black';
rect.alpha = 0.7;
container.addChild(rect);
}
}
/**
* Created by rockyl on 2020-01-09.
*/
import GameView from "./GameView";
import {injectProps} from "../props";
export class JumpHigh extends engine.Container {
private _status;
private _gameView: GameView;
constructor() {
super();
engine.globalEvent.addEventListener('jump-high-reset', this.reset, this);
engine.globalEvent.addEventListener('jump-high-start', this.start, this);
engine.globalEvent.addEventListener('jump-high-pause', this.pause, this);
engine.globalEvent.addEventListener('jump-high-resume', this.resume, this);
engine.globalEvent.addEventListener('jump-high-revive', this.revive, this);
this.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onTap, this);
let gameView = this._gameView = new GameView();
this.addChild(gameView);
}
reset() {
this._gameView.reset();
}
start(event: engine.Event) {
if ('jump-high-start') {
injectProps(event.data);
}
this._status = 1;
this._gameView.start();
}
pause() {
this._gameView.pause();
}
resume() {
this._gameView.resume();
}
revive() {
this._gameView.revive();
}
private onTap(event) {
this._gameView.jump();
}
}
/**
* Created by rockyl on 2018/8/17.
*/
import {props} from "../props";
import {createSvga, playSound} from "./utils";
const svgaAssets = {
aniReady: {name: '准备立正', dir: 1},
aniJump: {name: '跳上升', dir: 1},
aniFall: {name: '跳下落', dir: 1},
aniLandNormal: {name: '普通着地', dir: 1},
aniLandSide: {name: '边缘着地', dir: -1},
aniHit: {name: '被撞开', dir: -1},
aniParachute: {name: '降落', dir: -1},
};
export default class Player extends engine.Container {
private jumpPromise;
private playing;
private vy;
private g = props.gravity;
private baseY;
private aboveBlock;
private _aniName;
private _currentAni: svga.Svga;
private _prefectLandCounting;
private aniJump: svga.Svga;
private aniFall: svga.Svga;
private aniLandNormal: svga.Svga;
private aniLandSide: svga.Svga;
private aniHit: svga.Svga;
private aniParachute: svga.Svga;
private prefectEffect: svga.Svga;
private landEffect: svga.Svga;
constructor() {
super();
this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
}
switchAni(name, dir = 1, play = true, loop = false) {
return new Promise(resolve => {
this.scaleX = dir;
if (this._aniName !== name) {
this._aniName = name;
let oldAni = <svga.Svga>this.removeChild(this.getChildByName('body'));
if (oldAni) {
oldAni.stop();
}
let ani: svga.Svga = this._currentAni = this['ani' + name];
this.addChild(ani);
if (play) {
ani.play(false, loop);
if (loop) {
resolve();
} else {
ani.once(engine.Event.END_FRAME, resolve);
}
} else {
ani.gotoAndStop(1);
resolve();
}
}
})
}
setup() {
this.prefectEffect = createSvga('完美着地特效', 'playerLandPrefectAnchor');
this.landEffect = createSvga('着地特效', 'playerLandEffectAnchor');
for (let key in svgaAssets) {
let {name, dir} = svgaAssets[key];
let body = this[key] = createSvga(name, key.replace('ani', 'player') + 'Anchor');
body.name = 'body';
body.scaleX = dir;
}
}
reset(revive) {
this.x = 0;
this.rotation = 0;
this.scaleX = this.scaleY = 1;
this._prefectLandCounting = 0;
engine.Tween.removeTweens(this);
if(revive){
this.switchAni('Jump', 1, false);
}
}
playReady() {
return new Promise(resolve => {
this.switchAni('Ready', 1);
this._currentAni.once(engine.Event.END_FRAME, function () {
this.switchAni('Jump', 1, false);
resolve();
}, this);
})
}
private onEnterFrame(event) {
if (!this.playing) {
return;
}
this.vy += this.g;
this.y += this.vy;
if (this.vy > 0 && this._aniName !== 'Fall') {
this.dispatchEvent('jump-on-top');
this.switchAni('Fall');
}
if (this.y > this.baseY) {
this.y = this.baseY;
this.playing = false;
//this.aniDown.play(0);
this.jumpPromise && this.jumpPromise({
aboveBlock: this.aboveBlock,
});
this.jumpPromise = null;
}
}
changeBaseY(v) {
if (this.baseY == v) {
return;
}
this.aboveBlock = true;
this.baseY = v;
}
jump() {
playSound('跳起音效');
this.switchAni('Jump', 1, false);
this._currentAni.play(false, false);
this.aboveBlock = false;
this.playing = true;
this.baseY = this.y;
this.vy = -props.jumpSpeed;
return new Promise(resolve => {
this.jumpPromise = resolve;
})
}
async playLand(type, dir) {
switch (type) {
case 0:
this._prefectLandCounting++;
playSound('完美落地音效' + Math.min(4, this._prefectLandCounting));
let prefectEffect = this.prefectEffect;
this.addChildAt(prefectEffect, 0);
prefectEffect.gotoAndPlay(1);
prefectEffect.once(engine.Event.END_FRAME, function () {
this.removeChild(prefectEffect);
}, this);
let landEffect = this.landEffect;
this.addChildAt(landEffect, 0);
landEffect.gotoAndPlay(1);
landEffect.once(engine.Event.END_FRAME, function () {
this.removeChild(landEffect);
}, this);
await this.switchAni('LandNormal');
break;
case 1:
case 2:
this._prefectLandCounting = 0;
playSound('普通落地音效');
this.switchAni('LandNormal');
break;
case 3:
this._prefectLandCounting = 0;
playSound('边缘落地音效');
this.switchAni('LandSide', dir);
break;
}
}
async hitAway(dir) {
this.jumpPromise && this.jumpPromise();
this.jumpPromise = null;
playSound('被撞开音效');
this.switchAni('Hit', dir);
this.vy = 0;
await new Promise(resolve => {
engine.Tween.get(this)
.to({
x: -dir * props.hitAwayDistance.x,
}, props.hitAwayDuration, engine.Ease.quartOut);
engine.Tween.get(this)
.to({
y: this.y + props.hitAwayDistance.y,
}, props.hitAwayDuration, engine.Ease.cubicOut)
.call(resolve)
});
}
parachute(dir) {
this.switchAni('Parachute', dir);
return new Promise(resolve => {
engine.Tween.get(this)
.wait(200)
.call(function () {
playSound('降落伞下落音效');
})
.wait(300)
.to({y: this.y + props.parachuteDistance}, props.parachuteDuration)
.set({anchorOffsetY: 0})
.call(resolve)
});
}
}
/**
* Created by rockyl on 2020-01-21.
*/
import {props} from "../props";
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
export function getBlockAsset(type) {
return engine.getAssetByName(props.blockAssets[type]);
}
export function createSvga(name, anchorName) {
let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
let anchor = props[(anchorName)];
if (anchor) {
inst.x = -anchor.x;
inst.y = -anchor.y;
inst.anchorX = anchor.x;
inst.anchorY = anchor.y;
}
return inst;
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
/**
* Created by rockyl on 2019-11-20.
*/
import {JumpHigh} from "./game/JumpHigh";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new JumpHigh();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'lipstick-turntable';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const {props: propsOption, assets} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
properties: {
x: 375,
y: 400,
}
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('lipstick-turntable-reset', {
turntableAssetName: '橘色转盘',
countDown: 5,
});
engine.globalEvent.dispatchEvent('lipstick-turntable-start');
}, 500);
});
engine.globalEvent.addEventListener('lipstick-turntable-game-success', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('lipstick-turntable-game-failed', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('lipstick-turntable-hit', (e) => {
console.log(e.type, e.data);
});
engine.globalEvent.addEventListener('lipstick-turntable-countdown', (e) => {
console.log(e.type, e.data);
});
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>口红机</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "橘色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/9dfdf39ce4f4693c336cbdd996e05bd392921e0e.png",
"uuid": "b6ed99bc-2da1-4e6d-840e-54371be041aa",
"ext": '.png'
},
{
"name": "蓝色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/088cff75c4035b87ff421c2dd87391c6a7bea607.png",
"uuid": "4d8e2af4-4f8e-4f84-ab05-8ae172bbf8a6",
"ext": '.png'
},
{
"name": "紫色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/e0ac6904227d8e3878ed23be33e58d3ce2180f2d.png",
"uuid": "c3dd14af-1b98-4cb8-b725-fa75cf15e96d",
"ext": '.png'
},
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
(global = global || self, global['lipstick-turntable'] = factory(global.tslib));
}(this, (function (tslib) { 'use strict';
var props = {};
function prepareProps() {
var metaProps = getProps();
engine.injectProp(props, metaProps);
}
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
var GuideLayer = (function (_super) {
tslib.__extends(GuideLayer, _super);
function GuideLayer() {
var _this = _super.call(this) || this;
_this.setup();
return _this;
}
GuideLayer.prototype.setup = function () {
};
GuideLayer.prototype.show = function (id, options) {
var _this = this;
return new Promise(function (resolve) {
_this.visible = true;
if (!_this.guideMask) {
var _a = _this.stage, width = _a.width, height = _a.height;
var guideMask = _this.guideMask = new engine.Container();
var guideHole = new engine.Image(getTextureByName('引导遮罩'));
guideHole.x = (width - guideHole.width) / 2;
guideHole.y = options.y;
guideMask.addChild(guideHole);
_this.createRect(guideMask, 0, 0, width, guideHole.y);
_this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);
_this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);
_this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);
var label = _this.label = new engine.Label();
label.fillColor = 'white';
label.size = 25;
label.text = props.guideText;
label.x = (width - label.width) / 2;
label.y = guideHole.y + guideHole.height + 50;
guideMask.addChild(label);
_this.addChild(guideMask);
}
_this.once(engine.MouseEvent.CLICK, function () {
this.visible = false;
resolve();
}, _this);
});
};
GuideLayer.prototype.createRect = function (container, x, y, width, height) {
var rect = new engine.Rect();
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
rect.fillColor = 'black';
rect.alpha = 0.7;
container.addChild(rect);
};
return GuideLayer;
}(engine.Container));
//# sourceMappingURL=GuideLayer.js.map
var Stick = (function (_super) {
tslib.__extends(Stick, _super);
function Stick() {
var _this = _super.call(this) || this;
var body = _this._body = new engine.Sprite(getTextureByName('口红素材'));
body.anchorY = _this._body.height / 2;
body.x = -body.width / 2;
_this.addChild(body);
return _this;
}
Stick.prototype.reset = function () {
this.visible = true;
this.rotation = 0;
this.anchorOffsetY = 0;
var body = this._body;
body.y = 0;
body.rotation = 0;
};
Stick.prototype.playSend = function (y, callback) {
this._toY = y;
engine.Tween.get(this)
.to({ y: y }, props.stickSendDuration)
.call(callback);
};
Stick.prototype.stopSend = function () {
engine.Tween.removeTweens(this);
};
Stick.prototype.playFall = function () {
var _this = this;
return new Promise(function (resolve) {
engine.Tween.get(_this, null, null, true)
.to({ rotation: 30, y: _this._toY + props.stickFallDistance }, 500, engine.Ease.cubicOut)
.call(resolve);
});
};
Object.defineProperty(Stick.prototype, "anchorOffsetY", {
set: function (v) {
this._body.y = v;
},
enumerable: true,
configurable: true
});
return Stick;
}(engine.Container));
//# sourceMappingURL=Stick.js.map
var ObjectPool = engine.ObjectPool;
var PoolName = 'stick';
ObjectPool.registerPool(PoolName, function () {
return new Stick();
}, function (item, data) {
item.reset();
});
//# sourceMappingURL=object-pool-init.js.map
var BreakUpPart = (function (_super) {
tslib.__extends(BreakUpPart, _super);
function BreakUpPart(turntable, from, to) {
var _this = _super.call(this) || this;
var body = _this._body = new engine.Image();
_this.addChild(body);
var mask = _this._body.mask = new engine.Graphics();
_this.addChild(mask);
_this._turntable = turntable;
_this._from = from;
_this._to = to;
_this._fromR = from * Math.PI / 180;
_this._toR = to * Math.PI / 180;
return _this;
}
BreakUpPart.prototype.updateMask = function () {
var mask = this._body.mask;
mask.beginFill(0xff0000);
mask.moveTo(0, 0);
mask.arc(0, 0, this._turntable.radius + 5, this._fromR, this._toR);
mask.endFill();
var _a = props.breakUpDistanceRange, min = _a[0], max = _a[1];
var mid = (this._toR - this._fromR) / 2 + this._fromR;
this.x = Math.cos(mid) * Math.random() * max + min;
this.y = Math.sin(mid) * Math.random() * max + min;
this.alpha = 1;
this.rotation = 0;
};
BreakUpPart.prototype.playFall = function (rotation) {
var _this = this;
this._body.rotation = rotation;
return new Promise(function (resolve) {
var angle = (_this._to - _this._from) / 2 + _this._from;
var rotation = (angle > 270 ? 360 : 0) + 90 - angle;
engine.Tween.get(_this, null, null, true)
.to({ y: _this.y + props.turntableFallDistance, alpha: 0, rotation: rotation }, props.turntableFallDuration, engine.Ease.cubicIn)
.call(resolve);
});
};
Object.defineProperty(BreakUpPart.prototype, "body", {
get: function () {
return this._body;
},
enumerable: true,
configurable: true
});
return BreakUpPart;
}(engine.Container));
//# sourceMappingURL=BreakUpPart.js.map
var ObjectPool$1 = engine.ObjectPool;
var Turntable = (function (_super) {
tslib.__extends(Turntable, _super);
function Turntable() {
var _this = _super.call(this) || this;
_this._items = [];
var wrapper = _this._wrapper = new engine.Container();
_this.addChild(wrapper);
var stickContainer = _this._stickContainer = new engine.Container();
wrapper.addChild(stickContainer);
var body = _this._body = new engine.Image();
wrapper.addChild(body);
var breakUpContainer = _this._breakUpContainer = new engine.Container();
for (var i = 0, li = props.breakUpRatios.length - 1; i < li; i++) {
var part = new BreakUpPart(_this, props.breakUpRatios[i], props.breakUpRatios[i + 1]);
breakUpContainer.addChild(part);
}
breakUpContainer.visible = false;
_this.addChild(breakUpContainer);
return _this;
}
Turntable.prototype.resetAsset = function (body, asset) {
body.source = asset;
body.x = -body.width / 2;
body.y = -body.height / 2;
body.anchorX = -body.x;
body.anchorY = -body.y;
};
Turntable.prototype.reset = function (options) {
var turntableAssetName = options.turntableAssetName;
this.rotationRange = props.rotationRange;
var body = this._body;
body.visible = true;
this.resetAsset(body, turntableAssetName);
this._radius = body.width / 2;
this.hideSticks();
for (var _i = 0, _a = this._breakUpContainer.children; _i < _a.length; _i++) {
var part = _a[_i];
this.resetAsset(part.body, turntableAssetName);
part.updateMask();
}
this._breakUpContainer.visible = false;
};
Object.defineProperty(Turntable.prototype, "radius", {
get: function () {
return this._radius;
},
enumerable: true,
configurable: true
});
Turntable.prototype.start = function () {
this._dir = 1;
this._items.splice(0);
this.rotateOnce();
};
Turntable.prototype.pause = function () {
engine.Tween.pauseTweens(this._wrapper);
};
Turntable.prototype.resume = function () {
engine.Tween.resumeTweens(this._wrapper);
};
Turntable.prototype.addStick = function (stick) {
var angle = this.parseAngle(this._wrapper.rotation);
var minDis = props.stickAngle * 2;
var hitOn = false;
for (var _i = 0, _a = this._items; _i < _a.length; _i++) {
var item = _a[_i];
if (Math.abs(item - angle) < minDis) {
hitOn = true;
break;
}
}
if (hitOn) {
this.pause();
}
else {
this._items.push(angle);
stick.anchorOffsetY = stick.y;
stick.y = 0;
stick.rotation = -this._wrapper.rotation;
this._stickContainer.addChild(stick);
this.shake();
}
return hitOn;
};
Turntable.prototype.parseAngle = function (r) {
var round = r % 360;
if (round < 0) {
round += 360;
}
return round;
};
Turntable.prototype.hideSticks = function () {
for (var _i = 0, _a = this._stickContainer.children; _i < _a.length; _i++) {
var stick = _a[_i];
ObjectPool$1.recycleObject(PoolName, stick);
}
this._stickContainer.removeChildren();
};
Turntable.prototype.playBreakUp = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
var p, _i, _a, part;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
this.pause();
this._body.visible = false;
this._breakUpContainer.visible = true;
for (_i = 0, _a = this._breakUpContainer.children; _i < _a.length; _i++) {
part = _a[_i];
p = part.playFall(this._wrapper.rotation);
}
return [4, p];
case 1:
_b.sent();
return [2];
}
});
});
};
Turntable.prototype.shake = function () {
engine.Tween.get(this, null, null, true)
.to({ y: this.y - 5 }, 50)
.to({ y: this.y }, 50);
};
Turntable.prototype.rotateOnce = function () {
var _a = this.rotationRange, min = _a[0], max = _a[1];
var dealtRotation = Math.random() * max + min;
var duration = dealtRotation * (Math.random() * props.rotationDurationMultipleRandom + props.rotationDurationMultipleBase);
var rotation = this._wrapper.rotation + this._dir * dealtRotation;
this._dir *= -1;
engine.Tween.get(this._wrapper, null, null, true)
.to({ rotation: rotation }, duration)
.call(this.rotateOnce, this);
};
return Turntable;
}(engine.Container));
//# sourceMappingURL=Turntable.js.map
var ObjectPool$2 = engine.ObjectPool;
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
function GameView() {
var _this = _super.call(this) || this;
_this.countDownStep = function (decrease) {
if (decrease === void 0) { decrease = true; }
if (decrease) {
_this._countdown--;
if (_this._countdown <= 0) {
_this.stopCountDown();
_this.onTimeout();
}
}
engine.globalEvent.dispatchEvent('lipstick-turntable-countdown', {
second: _this._countdown,
});
};
_this.onHit = function () { return tslib.__awaiter(_this, void 0, void 0, function () {
var stick;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
stick = this._stick;
if (!this.turntable.addStick(stick)) return [3, 2];
this.stopCountDown();
return [4, stick.playFall()];
case 1:
_a.sent();
engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {
reason: 2,
});
return [3, 5];
case 2:
this._counting--;
engine.globalEvent.dispatchEvent('lipstick-turntable-hit', {
remain: this._counting,
});
if (!(this._counting === 0)) return [3, 4];
this.turntable.hideSticks();
this.stopCountDown();
return [4, this.turntable.playBreakUp()];
case 3:
_a.sent();
engine.globalEvent.dispatchEvent('lipstick-turntable-game-success');
return [3, 5];
case 4:
this.prepareStick();
_a.label = 5;
case 5: return [2];
}
});
}); };
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
return _this;
}
GameView.prototype.setup = function () {
if (this._hasSetup) {
return;
}
this._hasSetup = true;
var turntable = this.turntable = new Turntable();
this.addChild(turntable);
var guideLayer = this.guideLayer = new GuideLayer();
this.addChild(guideLayer);
};
GameView.prototype.reset = function (revive, options) {
if (options === void 0) { options = null; }
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
if (options) {
this.turntable.reset(options);
this.recycleStick();
}
else {
this.prepareStick();
}
return [2];
});
});
};
GameView.prototype.start = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
this._countdown = props.countDown;
this._counting = props.lipstickCount;
this.turntable.start();
this.prepareStick();
this.countDownStep(false);
this.startCountDown();
return [2];
});
});
};
GameView.prototype.startCountDown = function () {
this._timer = setInterval(this.countDownStep, 1000);
};
GameView.prototype.stopCountDown = function () {
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
};
GameView.prototype.prepareStick = function () {
var stick = this._stick = ObjectPool$2.getObject(PoolName);
stick.y = props.stickDistance;
this.addChildAt(stick, 0);
this._touchEnabled = true;
};
GameView.prototype.recycleStick = function () {
var stick = this._stick;
if (stick) {
this._stick = null;
this.removeChild(stick);
ObjectPool$2.recycleObject(PoolName, stick);
}
};
GameView.prototype.pause = function () {
this.turntable.pause();
this._stick.stopSend();
this._stick.playFall();
this.stopCountDown();
};
GameView.prototype.resume = function () {
this.recycleStick();
this.turntable.resume();
this.startCountDown();
};
GameView.prototype.revive = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
this.recycleStick();
this.prepareStick();
this.turntable.resume();
return [2];
});
});
};
GameView.prototype.onTimeout = function () {
this.pause();
this._touchEnabled = false;
engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {
reason: 1,
});
};
GameView.prototype.tap = function (e) {
if (!this._touchEnabled) {
return;
}
this._touchEnabled = false;
this._stick.playSend(this.turntable.radius - props.stickInsertDepth, this.onHit);
};
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
function GameWrapper() {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener('lipstick-turntable-reset', _this.reset, _this);
engine.globalEvent.addEventListener('lipstick-turntable-start', _this.start, _this);
engine.globalEvent.addEventListener('lipstick-turntable-pause', _this.pause, _this);
engine.globalEvent.addEventListener('lipstick-turntable-resume', _this.resume, _this);
engine.globalEvent.addEventListener('lipstick-turntable-revive', _this.revive, _this);
engine.globalEvent.addEventListener('lipstick-turntable-clear', _this.clear, _this);
_this.addEventListener(engine.MouseEvent.CLICK, _this.onTap, _this);
var gameView = _this._gameView = new GameView();
_this.addChild(gameView);
return _this;
}
GameWrapper.prototype.reset = function (event) {
injectProps(event.data);
this._gameView.visible = true;
this._gameView.reset(false, event.data);
};
GameWrapper.prototype.start = function (event) {
injectProps(event.data);
this._status = 1;
this._gameView.start();
};
GameWrapper.prototype.pause = function () {
this._gameView.pause();
};
GameWrapper.prototype.resume = function () {
this._gameView.resume();
};
GameWrapper.prototype.revive = function () {
this._gameView.revive();
};
GameWrapper.prototype.clear = function () {
this._gameView.visible = false;
};
GameWrapper.prototype.onTap = function (event) {
this._gameView.tap(event);
};
return GameWrapper;
}(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) {
prepareProps();
injectProps(props);
var instance = new GameWrapper();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sources":["src/custom/lipstick-turntable/src/props.ts","src/custom/lipstick-turntable/src/game/utils.ts","src/custom/lipstick-turntable/src/game/GuideLayer.ts","src/custom/lipstick-turntable/src/game/Stick.ts","src/custom/lipstick-turntable/src/game/object-pool-init.ts","src/custom/lipstick-turntable/src/game/BreakUpPart.ts","src/custom/lipstick-turntable/src/game/Turntable.ts","src/custom/lipstick-turntable/src/game/GameView.ts","src/custom/lipstick-turntable/src/game/GameWrapper.ts","src/custom/lipstick-turntable/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport function getTexture(uuid) {\n\treturn engine.Texture.from(getAssetByUUID(uuid).uuid);\n}\n\nexport function getTextureByName(name) {\n\treturn getTexture(engine.getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(engine.getAssetByName(name).uuid, {keep: true});\n}\n","/**\n * Created by rockyl on 2020-01-30.\n */\nimport {props} from \"../props\";\nimport {getTextureByName} from \"./utils\";\n\nexport class GuideLayer extends engine.Container {\n\tprivate guideMask: engine.Container;\n\tprivate label: engine.Label;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.setup();\n\t}\n\n\tprivate setup() {\n\n\t}\n\n\tshow(id, options) {\n\t\treturn new Promise(resolve => {\n\t\t\tthis.visible = true;\n\t\t\tif (!this.guideMask) {\n\t\t\t\tconst {width, height} = this.stage;\n\t\t\t\tlet guideMask = this.guideMask = new engine.Container();\n\n\t\t\t\tlet guideHole = new engine.Image(getTextureByName('引导遮罩'));\n\t\t\t\tguideHole.x = (width - guideHole.width) / 2;\n\t\t\t\tguideHole.y = options.y;\n\t\t\t\tguideMask.addChild(guideHole);\n\n\t\t\t\tthis.createRect(guideMask, 0, 0, width, guideHole.y);\n\t\t\t\tthis.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);\n\t\t\t\tthis.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);\n\t\t\t\tthis.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);\n\n\t\t\t\tlet label = this.label = new engine.Label();\n\t\t\t\tlabel.fillColor = 'white';\n\t\t\t\tlabel.size = 25;\n\t\t\t\tlabel.text = props.guideText;\n\t\t\t\tlabel.x = (width - label.width) / 2;\n\t\t\t\tlabel.y = guideHole.y + guideHole.height + 50;\n\t\t\t\tguideMask.addChild(label);\n\n\t\t\t\tthis.addChild(guideMask);\n\t\t\t}\n\t\t\tthis.once(engine.MouseEvent.CLICK, function(){\n\t\t\t\tthis.visible = false;\n\t\t\t\tresolve();\n\t\t\t}, this);\n\t\t})\n\t}\n\n\tcreateRect(container, x, y, width, height) {\n\t\tlet rect = new engine.Rect();\n\t\trect.x = x;\n\t\trect.y = y;\n\t\trect.width = width;\n\t\trect.height = height;\n\t\trect.fillColor = 'black';\n\t\trect.alpha = 0.7;\n\n\t\tcontainer.addChild(rect);\n\t}\n}\n","/**\n * Created by rockyl on 2020-02-02.\n *\n * 口红\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Stick extends engine.Container {\n\tprivate _body: engine.Sprite;\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body = this._body = new engine.Sprite(getTextureByName('口红素材'));\n\t\tbody.anchorY = this._body.height / 2;\n\t\tbody.x = -body.width / 2;\n\t\tthis.addChild(body);\n\t}\n\n\treset() {\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tlet body = this._body;\n\t\tbody.y = 0;\n\t\tbody.rotation = 0;\n\t}\n\n\tplaySend(y, callback) {\n\t\tthis._toY = y;\n\t\tengine.Tween.get(this)\n\t\t\t.to({y}, props.stickSendDuration)\n\t\t\t.call(callback);\n\t}\n\n\tstopSend() {\n\t\tengine.Tween.removeTweens(this);\n\t}\n\n\tplayFall() {\n\t\treturn new Promise(resolve => {\n\t\t\tengine.Tween.get(this, null, null, true)\n\t\t\t\t.to({rotation: 30, y: this._toY + props.stickFallDistance}, 500, engine.Ease.cubicOut)\n\t\t\t\t.call(resolve);\n\t\t})\n\n\t}\n\n\tset anchorOffsetY(v) {\n\t\tthis._body.y = v;\n\t}\n}\n","/**\n * Created by rockyl on 2020-02-03.\n */\n\nimport {Stick} from \"./Stick\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'stick';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Stick();\n}, function (item: Stick, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2020-02-03.\n */\nimport {props} from \"../props\";\nimport {Turntable} from \"./Turntable\";\n\nexport class BreakUpPart extends engine.Container {\n\tprivate _body: engine.Image;\n\n\tprivate _turntable: Turntable;\n\tprivate _from;\n\tprivate _to;\n\tprivate _fromR;\n\tprivate _toR;\n\n\tconstructor(turntable: Turntable, from, to) {\n\t\tsuper();\n\n\t\tlet body = this._body = new engine.Image();\n\t\tthis.addChild(body);\n\n\t\tlet mask = this._body.mask = new engine.Graphics();\n\t\tthis.addChild(mask);\n\n\t\tthis._turntable = turntable;\n\t\tthis._from = from;\n\t\tthis._to = to;\n\t\tthis._fromR = from * Math.PI / 180;\n\t\tthis._toR = to * Math.PI / 180;\n\t}\n\n\tupdateMask() {\n\t\tlet mask = this._body.mask;\n\t\tmask.beginFill(0xff0000);\n\t\tmask.moveTo(0, 0);\n\t\tmask.arc(0, 0, this._turntable.radius + 5, this._fromR, this._toR);\n\t\tmask.endFill();\n\n\t\tlet [min, max] = props.breakUpDistanceRange;\n\t\tlet mid = (this._toR - this._fromR) / 2 + this._fromR;\n\t\tthis.x = Math.cos(mid) * Math.random() * max + min;\n\t\tthis.y = Math.sin(mid) * Math.random() * max + min;\n\n\t\tthis.alpha = 1;\n\t\tthis.rotation = 0;\n\t}\n\n\tplayFall(rotation) {\n\t\tthis._body.rotation = rotation;\n\t\treturn new Promise(resolve => {\n\t\t\tlet angle = (this._to - this._from) / 2 + this._from;\n\t\t\tlet rotation = (angle > 270 ? 360 : 0) + 90 - angle;\n\t\t\tengine.Tween.get(this, null, null, true)\n\t\t\t\t.to({y: this.y + props.turntableFallDistance, alpha: 0, rotation}, props.turntableFallDuration, engine.Ease.cubicIn)\n\t\t\t\t.call(resolve)\n\t\t})\n\t}\n\n\tget body() {\n\t\treturn this._body;\n\t}\n}\n","/**\n * Created by rockyl on 2020-02-02.\n *\n * 转盘\n */\n\nimport {props} from '../props'\nimport {Stick} from \"./Stick\";\nimport ObjectPool = engine.ObjectPool;\nimport {PoolName} from \"./object-pool-init\";\nimport {BreakUpPart} from \"./BreakUpPart\";\n\nexport class Turntable extends engine.Container {\n\tprivate _wrapper: engine.Container;\n\tprivate _stickContainer: engine.Container;\n\tprivate _body: engine.Image;\n\tprivate _breakUpContainer: engine.Container;\n\tprivate _dir;\n\tprivate _radius;\n\tprivate _items = [];\n\n\tprivate rotationRange;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet wrapper = this._wrapper = new engine.Container();\n\t\tthis.addChild(wrapper);\n\n\t\tlet stickContainer = this._stickContainer = new engine.Container();\n\t\twrapper.addChild(stickContainer);\n\n\t\tlet body = this._body = new engine.Image();\n\t\twrapper.addChild(body);\n\n\t\tlet breakUpContainer = this._breakUpContainer = new engine.Container();\n\t\tfor (let i = 0, li = props.breakUpRatios.length - 1; i < li; i++) {\n\t\t\tlet part = new BreakUpPart(this, props.breakUpRatios[i], props.breakUpRatios[i + 1]);\n\t\t\tbreakUpContainer.addChild(part);\n\t\t}\n\t\tbreakUpContainer.visible = false;\n\t\tthis.addChild(breakUpContainer);\n\n\t\t/*let dot = new engine.Rect();\n\t\tdot.x = 150;\n\t\tdot.y = -5;\n\t\tdot.width = 10;\n\t\tdot.height = 10;\n\t\tdot.fillColor = 'red';\n\t\twrapper.addChild(dot);*/\n\t}\n\n\tprivate resetAsset(body, asset) {\n\t\tbody.source = asset;//'asset://' +\n\t\tbody.x = -body.width / 2;\n\t\tbody.y = -body.height / 2;\n\t\tbody.anchorX = -body.x;\n\t\tbody.anchorY = -body.y;\n\t}\n\n\treset(options) {\n\t\tconst {turntableAssetName} = options;\n\t\tthis.rotationRange = props.rotationRange;\n\n\t\tlet body = this._body;\n\t\tbody.visible = true;\n\t\tthis.resetAsset(body, turntableAssetName);\n\t\tthis._radius = body.width / 2;\n\n\t\tthis.hideSticks();\n\n\t\tfor (let part of this._breakUpContainer.children) {\n\t\t\tthis.resetAsset(part.body, turntableAssetName);\n\t\t\tpart.updateMask();\n\t\t}\n\t\tthis._breakUpContainer.visible = false;\n\t}\n\n\tget radius() {\n\t\treturn this._radius;\n\t}\n\n\tstart() {\n\t\tthis._dir = 1;\n\t\tthis._items.splice(0);\n\t\tthis.rotateOnce();\n\t}\n\n\tpause() {\n\t\tengine.Tween.pauseTweens(this._wrapper);\n\t}\n\n\tresume() {\n\t\tengine.Tween.resumeTweens(this._wrapper);\n\t}\n\n\taddStick(stick: Stick) {\n\t\tlet angle = this.parseAngle(this._wrapper.rotation);\n\n\t\tlet minDis = props.stickAngle * 2;\n\t\tlet hitOn = false;\n\t\tfor (let item of this._items) {\n\t\t\tif (Math.abs(item - angle) < minDis) {\n\t\t\t\thitOn = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (hitOn) {\n\t\t\tthis.pause();\n\t\t} else {\n\t\t\tthis._items.push(angle);\n\n\t\t\tstick.anchorOffsetY = stick.y;\n\t\t\tstick.y = 0;\n\t\t\tstick.rotation = -this._wrapper.rotation;\n\t\t\tthis._stickContainer.addChild(stick);\n\t\t\tthis.shake();\n\t\t}\n\n\t\treturn hitOn;\n\t}\n\n\tparseAngle(r) {\n\t\tlet round = r % 360;\n\t\tif (round < 0) {\n\t\t\tround += 360;\n\t\t}\n\t\treturn round;\n\t}\n\n\thideSticks() {\n\t\tfor (let stick of this._stickContainer.children) {\n\t\t\tObjectPool.recycleObject(PoolName, stick);\n\t\t}\n\t\tthis._stickContainer.removeChildren();\n\t}\n\n\tasync playBreakUp() {\n\t\tthis.pause();\n\t\tthis._body.visible = false;\n\t\tthis._breakUpContainer.visible = true;\n\n\t\tlet p;\n\t\tfor (let part of this._breakUpContainer.children) {\n\t\t\tp = part.playFall(this._wrapper.rotation);\n\t\t}\n\n\t\tawait p;\n\t}\n\n\tprivate shake() {\n\t\tengine.Tween.get(this, null, null, true)\n\t\t\t.to({y: this.y - 5}, 50)\n\t\t\t.to({y: this.y}, 50)\n\t}\n\n\tprivate rotateOnce() {\n\t\tlet [min, max] = this.rotationRange;\n\t\tlet dealtRotation = Math.random() * max + min;\n\t\tlet duration = dealtRotation * (Math.random() * props.rotationDurationMultipleRandom + props.rotationDurationMultipleBase);\n\t\tlet rotation = this._wrapper.rotation + this._dir * dealtRotation;\n\t\tthis._dir *= -1;\n\t\tengine.Tween.get(this._wrapper, null, null, true)\n\t\t\t.to({rotation}, duration)\n\t\t\t.call(this.rotateOnce, this);\n\t}\n}\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport {props} from \"../props\";\nimport {playSound} from \"./utils\";\nimport {GuideLayer} from \"./GuideLayer\";\nimport ObjectPool = engine.ObjectPool;\nimport {Turntable} from \"./Turntable\";\nimport {Stick} from \"./Stick\";\nimport {PoolName} from \"./object-pool-init\";\n\nexport default class GameView extends engine.Container {\n\tturntable: Turntable;\n\tguideLayer: GuideLayer;\n\n\tprivate _counting;\n\t_touchEnabled;\n\tprivate _hasSetup;\n\tprivate _countdown;\n\n\tprivate _stick: Stick;\n\tprivate _timer;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\n\t\tconst turntable = this.turntable = new Turntable();\n\t\tthis.addChild(turntable);\n\n\t\tconst guideLayer = this.guideLayer = new GuideLayer();\n\t\tthis.addChild(guideLayer);\n\n\t\t//this.reset();\n\t}\n\n\tasync reset(revive = false, options = null) {\n\t\tif (options) {\n\t\t\tthis.turntable.reset(options);\n\t\t\tthis.recycleStick();\n\t\t} else {\n\t\t\tthis.prepareStick();\n\t\t}\n\t}\n\n\tasync start() {\n\t\t/*let guideFlagKey = 'lipstick-turntable-guide_' + props.guideFlagKey;\n\t\tlet guideFlag = localStorage.getItem(guideFlagKey);\n\t\tif (!guideFlag) {\n\t\t\tlocalStorage.setItem(guideFlagKey, '1');\n\t\t\tawait this.guideLayer.show('', {y: 100});\n\t\t}*/\n\n\t\tthis._countdown = props.countDown;\n\t\tthis._counting = props.lipstickCount;\n\t\tthis.turntable.start();\n\t\tthis.prepareStick();\n\t\tthis.countDownStep(false);\n\n\t\tthis.startCountDown();\n\t}\n\n\tstartCountDown() {\n\t\tthis._timer = setInterval(this.countDownStep, 1000);\n\t}\n\n\tstopCountDown() {\n\t\tif (this._timer) {\n\t\t\tclearInterval(this._timer);\n\t\t\tthis._timer = null;\n\t\t}\n\t}\n\n\tprepareStick() {\n\t\tlet stick = this._stick = <Stick>ObjectPool.getObject(PoolName);\n\t\tstick.y = props.stickDistance;\n\t\tthis.addChildAt(stick, 0);\n\n\t\tthis._touchEnabled = true;\n\t}\n\n\trecycleStick() {\n\t\tlet stick = this._stick;\n\t\tif (stick) {\n\t\t\tthis._stick = null;\n\t\t\tthis.removeChild(stick);\n\t\t\tObjectPool.recycleObject(PoolName, stick);\n\t\t}\n\t}\n\n\tpause() {\n\t\tthis.turntable.pause();\n\t\tthis._stick.stopSend();\n\t\tthis._stick.playFall();\n\t\tthis.stopCountDown();\n\t}\n\n\tresume() {\n\t\tthis.recycleStick();\n\t\tthis.turntable.resume();\n\t\tthis.startCountDown();\n\t}\n\n\tasync revive() {\n\t\tthis.recycleStick();\n\t\tthis.prepareStick();\n\t\tthis.turntable.resume();\n\t}\n\n\tprivate countDownStep = (decrease = true) => {\n\t\tif (decrease) {\n\t\t\tthis._countdown--;\n\t\t\tif (this._countdown <= 0) {\n\t\t\t\tthis.stopCountDown();\n\t\t\t\tthis.onTimeout();\n\t\t\t}\n\t\t}\n\t\tengine.globalEvent.dispatchEvent('lipstick-turntable-countdown', {\n\t\t\tsecond: this._countdown,\n\t\t});\n\t};\n\n\tprivate onTimeout() {\n\t\tthis.pause();\n\t\tthis._touchEnabled = false;\n\n\t\tengine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {\n\t\t\treason: 1,\n\t\t});\n\t}\n\n\tprivate onHit = async () => {\n\t\tlet stick = this._stick;\n\t\tif (this.turntable.addStick(stick)) {\n\t\t\tthis.stopCountDown();\n\t\t\tawait stick.playFall();\n\t\t\tengine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {\n\t\t\t\treason: 2,\n\t\t\t});\n\t\t} else {\n\t\t\tthis._counting--;\n\t\t\tengine.globalEvent.dispatchEvent('lipstick-turntable-hit', {\n\t\t\t\tremain: this._counting,\n\t\t\t});\n\t\t\tif (this._counting === 0) {\n\t\t\t\tthis.turntable.hideSticks();\n\t\t\t\tthis.stopCountDown();\n\t\t\t\tawait this.turntable.playBreakUp();\n\t\t\t\tengine.globalEvent.dispatchEvent('lipstick-turntable-game-success');\n\t\t\t} else {\n\t\t\t\tthis.prepareStick();\n\t\t\t}\n\t\t}\n\t};\n\n\ttap(e) {\n\t\tif (!this._touchEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._touchEnabled = false;\n\n\t\tthis._stick.playSend(this.turntable.radius - props.stickInsertDepth, this.onHit);\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tengine.globalEvent.addEventListener('lipstick-turntable-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('lipstick-turntable-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('lipstick-turntable-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('lipstick-turntable-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('lipstick-turntable-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('lipstick-turntable-clear', this.clear, this);\n\n\t\tthis.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\t}\n\n\treset(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset(false, event.data);\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\n\t\tthis._status = 1;\n\n\t\tthis._gameView.start();\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tclear() {\n\t\tthis._gameView.visible = false;\n\t}\n\n\tprivate onTap(event) {\n\t\tthis._gameView.tap(event);\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {GameWrapper} from \"./game/GameWrapper\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance = new GameWrapper();\n\treturn instance;\n}\n"],"names":["__extends","ObjectPool"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;UCVe,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AAED,UAAgB,gBAAgB,CAAC,IAAI;KACpC,OAAO,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;;CCJD;KAAgCA,oCAAgB;KAI/C;SAAA,YACC,iBAAO,SAGP;SADA,KAAI,CAAC,KAAK,EAAE,CAAC;;MACb;KAEO,0BAAK,GAAb;MAEC;KAED,yBAAI,GAAJ,UAAK,EAAE,EAAE,OAAO;SAAhB,iBAgCC;SA/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9B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;MACxC;KAED,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAExB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;SAEjB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;SAClB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;MAC1B;KACF,kBAAC;CAAD,CAAC,CArDgC,MAAM,CAAC,SAAS,GAqDhD;;;iBCrDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
{
"name": "口红机",
"desc": "口红机模块",
"props": {
"guideText": {
"alias": "引导文本",
"type": "string",
"default": "点击屏幕将口红插到水果盘上\n射击时不可碰到口红"
},
"guideFlagKey": {
"alias": "引导标识名",
"type": "string",
"default": "test"
},
"rotationRange": {
"alias": "旋转角度范围",
"type": "array<number>",
"default": "90,360"
},
"rotationDurationMultipleRandom": {
"alias": "旋转时间是角度差的随机值",
"type": "number",
"default": 5
},
"rotationDurationMultipleBase": {
"alias": "旋转时间是角度差的倍数基数",
"type": "number",
"default": 3
},
"breakUpRatios": {
"alias": "圆盘破裂角度比例",
"type": "array<number>",
"default": "10,170,270,370"
},
"breakUpDistanceRange": {
"alias": "圆盘裂开距离",
"type": "array<number>",
"default": "10,20"
},
"turntableFallDuration": {
"alias": "圆盘掉落时间",
"type": "number",
"default": 800
},
"turntableFallDistance": {
"alias": "圆盘掉落距离",
"type": "number",
"default": 600
},
"stickInsertDepth": {
"alias": "口红插入深度",
"type": "number",
"default": 20
},
"stickAngle": {
"alias": "口红所占角度",
"type": "number",
"default": 4.5
},
"stickDistance": {
"alias": "口红到圆盘的距离",
"type": "number",
"default": 400
},
"stickSendDuration": {
"alias": "口红发射时间",
"type": "number",
"default": 200
},
"stickFallDistance": {
"alias": "口红掉落距离",
"type": "number",
"default": 400
},
"lipstickCount": {
"alias": "口红数量",
"type": "number",
"default": 2
}
},
"assets": [
{
"name": "引导遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/75cc4ea91654fd1e9900d071cac5ca5296b1bd19.png",
"uuid": "6879e370-59c1-453c-8d61-cd3d724ea650",
"ext": ".png"
},
{
"name": "口红素材",
"url": "//yun.duiba.com.cn/aurora/assets/7afc62bec2625dbd45f54c5a3564c40e73122b51.png",
"uuid": "bc4a0ad3-0d5a-4082-a6da-5f5ede371ed5",
"ext": ".png"
}
],
"events": {
"in": {
"lipstick-turntable-reset": {
"alias": "重置",
"data": {
"turntableAssetName": "转盘素材名",
"lipstickCount": "口红数量",
"countDown": "倒计时(s)"
}
},
"lipstick-turntable-start": {
"alias": "开始"
},
"lipstick-turntable-revive": {
"alias": "复活"
},
"lipstick-turntable-pause": {
"alias": "暂停"
},
"lipstick-turntable-resume": {
"alias": "恢复"
},
"lipstick-turntable-clear": {
"alias": "清空,通过reset事件恢复"
}
},
"out": {
"lipstick-turntable-game-success": {
"alias": "游戏成功",
"data": {
}
},
"lipstick-turntable-game-failed": {
"alias": "游戏失败",
"data": {
"reason": "失败原因(1:超时,2:碰到口红)"
}
},
"lipstick-turntable-hit": {
"alias": "成功射中",
"data": {
"remain": "剩余口红数"
}
},
"lipstick-turntable-countdown": {
"alias": "倒计时",
"data": {
"second": "倒计时秒数"
}
}
}
}
}
\ No newline at end of file
/**
* Created by rockyl on 2020-02-03.
*/
import {props} from "../props";
import {Turntable} from "./Turntable";
export class BreakUpPart extends engine.Container {
private _body: engine.Image;
private _turntable: Turntable;
private _from;
private _to;
private _fromR;
private _toR;
constructor(turntable: Turntable, from, to) {
super();
let body = this._body = new engine.Image();
this.addChild(body);
let mask = this._body.mask = new engine.Graphics();
this.addChild(mask);
this._turntable = turntable;
this._from = from;
this._to = to;
this._fromR = from * Math.PI / 180;
this._toR = to * Math.PI / 180;
}
updateMask() {
let mask = this._body.mask;
mask.beginFill(0xff0000);
mask.moveTo(0, 0);
mask.arc(0, 0, this._turntable.radius + 5, this._fromR, this._toR);
mask.endFill();
let [min, max] = props.breakUpDistanceRange;
let mid = (this._toR - this._fromR) / 2 + this._fromR;
this.x = Math.cos(mid) * Math.random() * max + min;
this.y = Math.sin(mid) * Math.random() * max + min;
this.alpha = 1;
this.rotation = 0;
}
playFall(rotation) {
this._body.rotation = rotation;
return new Promise(resolve => {
let angle = (this._to - this._from) / 2 + this._from;
let rotation = (angle > 270 ? 360 : 0) + 90 - angle;
engine.Tween.get(this, null, null, true)
.to({y: this.y + props.turntableFallDistance, alpha: 0, rotation}, props.turntableFallDuration, engine.Ease.cubicIn)
.call(resolve)
})
}
get body() {
return this._body;
}
}
/**
* Created by rockyl on 2018/8/16.
*/
import {props} from "../props";
import {playSound} from "./utils";
import {GuideLayer} from "./GuideLayer";
import ObjectPool = engine.ObjectPool;
import {Turntable} from "./Turntable";
import {Stick} from "./Stick";
import {PoolName} from "./object-pool-init";
export default class GameView extends engine.Container {
turntable: Turntable;
guideLayer: GuideLayer;
private _counting;
_touchEnabled;
private _hasSetup;
private _countdown;
private _stick: Stick;
private _timer;
constructor() {
super();
this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
setup() {
if (this._hasSetup) {
return;
}
this._hasSetup = true;
const turntable = this.turntable = new Turntable();
this.addChild(turntable);
const guideLayer = this.guideLayer = new GuideLayer();
this.addChild(guideLayer);
//this.reset();
}
async reset(revive = false, options = null) {
if (options) {
this.turntable.reset(options);
this.recycleStick();
} else {
this.prepareStick();
}
}
async start() {
/*let guideFlagKey = 'lipstick-turntable-guide_' + props.guideFlagKey;
let guideFlag = localStorage.getItem(guideFlagKey);
if (!guideFlag) {
localStorage.setItem(guideFlagKey, '1');
await this.guideLayer.show('', {y: 100});
}*/
this._countdown = props.countDown;
this._counting = props.lipstickCount;
this.turntable.start();
this.prepareStick();
this.countDownStep(false);
this.startCountDown();
}
startCountDown() {
this._timer = setInterval(this.countDownStep, 1000);
}
stopCountDown() {
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
}
prepareStick() {
let stick = this._stick = <Stick>ObjectPool.getObject(PoolName);
stick.y = props.stickDistance;
this.addChildAt(stick, 0);
this._touchEnabled = true;
}
recycleStick() {
let stick = this._stick;
if (stick) {
this._stick = null;
this.removeChild(stick);
ObjectPool.recycleObject(PoolName, stick);
}
}
pause() {
this.turntable.pause();
this._stick.stopSend();
this._stick.playFall();
this.stopCountDown();
}
resume() {
this.recycleStick();
this.turntable.resume();
this.startCountDown();
}
async revive() {
this.recycleStick();
this.prepareStick();
this.turntable.resume();
}
private countDownStep = (decrease = true) => {
if (decrease) {
this._countdown--;
if (this._countdown <= 0) {
this.stopCountDown();
this.onTimeout();
}
}
engine.globalEvent.dispatchEvent('lipstick-turntable-countdown', {
second: this._countdown,
});
};
private onTimeout() {
this.pause();
this._touchEnabled = false;
engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {
reason: 1,
});
}
private onHit = async () => {
let stick = this._stick;
if (this.turntable.addStick(stick)) {
this.stopCountDown();
await stick.playFall();
engine.globalEvent.dispatchEvent('lipstick-turntable-game-failed', {
reason: 2,
});
} else {
this._counting--;
engine.globalEvent.dispatchEvent('lipstick-turntable-hit', {
remain: this._counting,
});
if (this._counting === 0) {
this.turntable.hideSticks();
this.stopCountDown();
await this.turntable.playBreakUp();
engine.globalEvent.dispatchEvent('lipstick-turntable-game-success');
} else {
this.prepareStick();
}
}
};
tap(e) {
if (!this._touchEnabled) {
return;
}
this._touchEnabled = false;
this._stick.playSend(this.turntable.radius - props.stickInsertDepth, this.onHit);
}
}
/**
* Created by rockyl on 2020-01-09.
*/
import GameView from "./GameView";
import {injectProps} from "../props";
export class GameWrapper extends engine.Container {
private _status;
private _gameView: GameView;
constructor() {
super();
engine.globalEvent.addEventListener('lipstick-turntable-reset', this.reset, this);
engine.globalEvent.addEventListener('lipstick-turntable-start', this.start, this);
engine.globalEvent.addEventListener('lipstick-turntable-pause', this.pause, this);
engine.globalEvent.addEventListener('lipstick-turntable-resume', this.resume, this);
engine.globalEvent.addEventListener('lipstick-turntable-revive', this.revive, this);
engine.globalEvent.addEventListener('lipstick-turntable-clear', this.clear, this);
this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);
let gameView = this._gameView = new GameView();
this.addChild(gameView);
}
reset(event: engine.Event) {
injectProps(event.data);
this._gameView.visible = true;
this._gameView.reset(false, event.data);
}
start(event: engine.Event) {
injectProps(event.data);
this._status = 1;
this._gameView.start();
}
pause() {
this._gameView.pause();
}
resume() {
this._gameView.resume();
}
revive() {
this._gameView.revive();
}
clear() {
this._gameView.visible = false;
}
private onTap(event) {
this._gameView.tap(event);
}
}
/**
* Created by rockyl on 2020-01-30.
*/
import {props} from "../props";
import {getTextureByName} from "./utils";
export class GuideLayer extends engine.Container {
private guideMask: engine.Container;
private label: engine.Label;
constructor() {
super();
this.setup();
}
private setup() {
}
show(id, options) {
return new Promise(resolve => {
this.visible = true;
if (!this.guideMask) {
const {width, height} = this.stage;
let guideMask = this.guideMask = new engine.Container();
let guideHole = new engine.Image(getTextureByName('引导遮罩'));
guideHole.x = (width - guideHole.width) / 2;
guideHole.y = options.y;
guideMask.addChild(guideHole);
this.createRect(guideMask, 0, 0, width, guideHole.y);
this.createRect(guideMask, 0, guideHole.y, guideHole.x, guideHole.height);
this.createRect(guideMask, guideHole.x + guideHole.width, guideHole.y, width - guideHole.x - guideHole.width, guideHole.height);
this.createRect(guideMask, 0, guideHole.y + guideHole.height, width, height - guideHole.y - guideHole.height);
let label = this.label = new engine.Label();
label.fillColor = 'white';
label.size = 25;
label.text = props.guideText;
label.x = (width - label.width) / 2;
label.y = guideHole.y + guideHole.height + 50;
guideMask.addChild(label);
this.addChild(guideMask);
}
this.once(engine.MouseEvent.CLICK, function(){
this.visible = false;
resolve();
}, this);
})
}
createRect(container, x, y, width, height) {
let rect = new engine.Rect();
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
rect.fillColor = 'black';
rect.alpha = 0.7;
container.addChild(rect);
}
}
/**
* Created by rockyl on 2020-02-02.
*
* 口红
*/
import {getTextureByName} from "./utils";
import {props} from "../props";
export class Stick extends engine.Container {
private _body: engine.Sprite;
private _toY;
constructor() {
super();
let body = this._body = new engine.Sprite(getTextureByName('口红素材'));
body.anchorY = this._body.height / 2;
body.x = -body.width / 2;
this.addChild(body);
}
reset() {
this.visible = true;
this.rotation = 0;
this.anchorOffsetY = 0;
let body = this._body;
body.y = 0;
body.rotation = 0;
}
playSend(y, callback) {
this._toY = y;
engine.Tween.get(this)
.to({y}, props.stickSendDuration)
.call(callback);
}
stopSend() {
engine.Tween.removeTweens(this);
}
playFall() {
return new Promise(resolve => {
engine.Tween.get(this, null, null, true)
.to({rotation: 30, y: this._toY + props.stickFallDistance}, 500, engine.Ease.cubicOut)
.call(resolve);
})
}
set anchorOffsetY(v) {
this._body.y = v;
}
}
/**
* Created by rockyl on 2020-02-02.
*
* 转盘
*/
import {props} from '../props'
import {Stick} from "./Stick";
import ObjectPool = engine.ObjectPool;
import {PoolName} from "./object-pool-init";
import {BreakUpPart} from "./BreakUpPart";
export class Turntable extends engine.Container {
private _wrapper: engine.Container;
private _stickContainer: engine.Container;
private _body: engine.Image;
private _breakUpContainer: engine.Container;
private _dir;
private _radius;
private _items = [];
private rotationRange;
constructor() {
super();
let wrapper = this._wrapper = new engine.Container();
this.addChild(wrapper);
let stickContainer = this._stickContainer = new engine.Container();
wrapper.addChild(stickContainer);
let body = this._body = new engine.Image();
wrapper.addChild(body);
let breakUpContainer = this._breakUpContainer = new engine.Container();
for (let i = 0, li = props.breakUpRatios.length - 1; i < li; i++) {
let part = new BreakUpPart(this, props.breakUpRatios[i], props.breakUpRatios[i + 1]);
breakUpContainer.addChild(part);
}
breakUpContainer.visible = false;
this.addChild(breakUpContainer);
/*let dot = new engine.Rect();
dot.x = 150;
dot.y = -5;
dot.width = 10;
dot.height = 10;
dot.fillColor = 'red';
wrapper.addChild(dot);*/
}
private resetAsset(body, asset) {
body.source = asset;//'asset://' +
body.x = -body.width / 2;
body.y = -body.height / 2;
body.anchorX = -body.x;
body.anchorY = -body.y;
}
reset(options) {
const {turntableAssetName} = options;
this.rotationRange = props.rotationRange;
let body = this._body;
body.visible = true;
this.resetAsset(body, turntableAssetName);
this._radius = body.width / 2;
this.hideSticks();
for (let part of this._breakUpContainer.children) {
this.resetAsset(part.body, turntableAssetName);
part.updateMask();
}
this._breakUpContainer.visible = false;
}
get radius() {
return this._radius;
}
start() {
this._dir = 1;
this._items.splice(0);
this.rotateOnce();
}
pause() {
engine.Tween.pauseTweens(this._wrapper);
}
resume() {
engine.Tween.resumeTweens(this._wrapper);
}
addStick(stick: Stick) {
let angle = this.parseAngle(this._wrapper.rotation);
let minDis = props.stickAngle * 2;
let hitOn = false;
for (let item of this._items) {
if (Math.abs(item - angle) < minDis) {
hitOn = true;
break;
}
}
if (hitOn) {
this.pause();
} else {
this._items.push(angle);
stick.anchorOffsetY = stick.y;
stick.y = 0;
stick.rotation = -this._wrapper.rotation;
this._stickContainer.addChild(stick);
this.shake();
}
return hitOn;
}
parseAngle(r) {
let round = r % 360;
if (round < 0) {
round += 360;
}
return round;
}
hideSticks() {
for (let stick of this._stickContainer.children) {
ObjectPool.recycleObject(PoolName, stick);
}
this._stickContainer.removeChildren();
}
async playBreakUp() {
this.pause();
this._body.visible = false;
this._breakUpContainer.visible = true;
let p;
for (let part of this._breakUpContainer.children) {
p = part.playFall(this._wrapper.rotation);
}
await p;
}
private shake() {
engine.Tween.get(this, null, null, true)
.to({y: this.y - 5}, 50)
.to({y: this.y}, 50)
}
private rotateOnce() {
let [min, max] = this.rotationRange;
let dealtRotation = Math.random() * max + min;
let duration = dealtRotation * (Math.random() * props.rotationDurationMultipleRandom + props.rotationDurationMultipleBase);
let rotation = this._wrapper.rotation + this._dir * dealtRotation;
this._dir *= -1;
engine.Tween.get(this._wrapper, null, null, true)
.to({rotation}, duration)
.call(this.rotateOnce, this);
}
}
/**
* Created by rockyl on 2020-02-03.
*/
import {Stick} from "./Stick";
import ObjectPool = engine.ObjectPool;
export const PoolName: string = 'stick';
ObjectPool.registerPool(PoolName, function () {
return new Stick();
}, function (item: Stick, data) {
item.reset();
});
/**
* Created by rockyl on 2020-01-21.
*/
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
/**
* Created by rockyl on 2019-11-20.
*/
import {GameWrapper} from "./game/GameWrapper";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new GameWrapper();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'shoot-planet-2';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const {props: propsOption, assets} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('game-create', {
});
}, 500);
engine.globalEvent.addEventListener('game-start', (e) => {
console.log(e.type, e.data);
});
});
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>打星球</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script>
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "橘色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/9dfdf39ce4f4693c336cbdd996e05bd392921e0e.png",
"uuid": "b6ed99bc-2da1-4e6d-840e-54371be041aa",
"ext": '.png'
},
{
"name": "蓝色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/088cff75c4035b87ff421c2dd87391c6a7bea607.png",
"uuid": "4d8e2af4-4f8e-4f84-ab05-8ae172bbf8a6",
"ext": '.png'
},
{
"name": "紫色转盘",
"url": "//yun.duiba.com.cn/aurora/assets/e0ac6904227d8e3878ed23be33e58d3ce2180f2d.png",
"uuid": "c3dd14af-1b98-4cb8-b725-fa75cf15e96d",
"ext": '.png'
},
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
......@@ -2,11 +2,36 @@
"name": "打星球",
"desc": "打星球模块哟",
"props": {
"guideText0": {
"alias": "引导文本0",
"type": "string",
"default": "左右移动炮车进行射击和躲避"
},
"guideText1": {
"alias": "引导文本1",
"type": "string",
"default": "拾取金币可获得更多的炮弹输出和得分加成"
},
"guideFlagKey": {
"alias": "引导标识名",
"type": "string",
"default": "test"
},
"fontName": {
"alias": "字体名",
"type": "string",
"default": "shoot-planet-num",
"desc": "球体上所用位图文本的字体"
},
"carCollidePaddingX": {
"alias": "小车碰撞横向边距",
"type": "number",
"default": 0
},
"carCollidePaddingY": {
"alias": "小车碰撞纵向边距",
"type": "number",
"default": 0
}
},
"events": {
......@@ -28,6 +53,9 @@
}
},
"out": {
"game-start": {
"alias": "游戏开始"
},
"game-update": {
"alias": "游戏更新",
"data": {
......@@ -259,16 +287,10 @@
},
{
"name": "引导遮罩图",
"url": "//yun.duiba.com.cn/aurora/assets/d4ac501c938e2b7cd4beaf737ff07c53afe18c44.png",
"url": "//yun.duiba.com.cn/aurora/assets/27a2114a58406d13df48dfd20fd548a0cf9e964b.png",
"uuid": "3cc0aa86-0581-4caa-b662-266e58fd39b7",
"ext": ".png"
},
{
"name": "背景音乐",
"url": "//yun.duiba.com.cn/aurora/assets/9ace0b569cbc43c61eb18a84f5d36dcd60423819.mp3",
"uuid": "4d07ecdf-c27d-4cb3-b9c9-15398dc93a67",
"ext": ".mp3"
},
{
"name": "子弹发射音效",
"url": "//yun.duiba.com.cn/aurora/assets/78d86205f37e736f922bf476a4b278dd4c5d029c.mp3",
......
......@@ -12,6 +12,7 @@ import {DataMgr} from "../Mgr/DataMgr";
import GuideMgr from "../Mgr/GuideMgr";
import MTimer from "../Global/MTimer";
import {getTexture} from "../utils";
import {props} from "../../props";
let tempPower: number = null;
let tempIndexOffset: number = null;
......@@ -20,7 +21,7 @@ const imageNames = [
"bd94b3e6-3c99-490f-95ef-ca0c056d7727",
"d8eab9fc-104e-4b39-88d6-455ed8632703",
"48f98d84-d30e-4dfe-aa92-c45bde5cefd8",
"8d42fd9e-907b-4587-9a6f-a634909b8b8a"
"8d42fd9e-907b-4587-9a6f-a634909b8b8a",
];
const textureSize = {
......@@ -99,7 +100,7 @@ export default class Ball extends MoveObjcet implements PoolElement {
//创建文字
let labelScore = new engine.BitmapText();
labelScore.font = getProps().fontName || 'shoot-planet-num';
labelScore.font = props.fontName;
labelScore.scaleX = labelScore.scaleY = scaleRatio;
this.addChild(labelScore);
......
......@@ -4,7 +4,7 @@ import {MConst} from "../Global/MConst";
import Bullet, {BulletGroup} from "./Bullet";
import SoundMgr from "../Mgr/SoundMgr";
import MTimer from "../Global/MTimer";
import Game from "./Game";
import {props} from "../../props";
import {DataMgr} from "../Mgr/DataMgr";
import {clamp, getTexture} from "../utils";
......@@ -21,12 +21,15 @@ export default class Car extends GameObject {
/**每排子弹的个数 */
private rowBulletNum: number = 1;
private fireSpeed: number = MConst.BulletFireSpeed.min;
private collider: RectCollider;
constructor() {
super();
// this.x = 124;
// this.y = 145;
const {carCollidePaddingX, carCollidePaddingY} = props;
let sprite = new engine.Sprite(getTexture("ddf5128e-be66-4c00-8505-e4167aac37bc"));
sprite.x = 0;
sprite.y = 16;
......@@ -37,8 +40,8 @@ export default class Car extends GameObject {
this.addChild(particle);
this.imgParticel = particle;
MTimer.onFrame("Car", this.onUpdate, this);
let collider = this.addComponent<RectCollider>(RectCollider);
collider.setData(41, 13, 65, 129);
let collider = this.collider = this.addComponent<RectCollider>(RectCollider);
collider.setData(carCollidePaddingX, carCollidePaddingY, sprite.width - carCollidePaddingX * 2, sprite.height - carCollidePaddingY * 2);
collider.group = ColliderGroup.Car;
}
......@@ -117,7 +120,11 @@ export default class Car extends GameObject {
} else if (this.touchWall == -1 && deltaX >= 0) {
return;
}
this.x += deltaX;
const {carCollidePaddingX} = props;
const {x, width} = this.collider.rect;
this.x = Math.max(-x, Math.min(750 - width - carCollidePaddingX, this.x + deltaX))
//this.x += deltaX;
}
onCollisionExit(other: Collider) {
......
......@@ -127,7 +127,7 @@ export default class Game {
FrameAnimation.loadRes(
getTexture("53c65221-3fbc-41d9-8cef-8a846876fe06"),
getAsset('b82d6a84-8423-4be2-add5-ed9129e8c700')
);
);
}
private initMgrs() {
......@@ -426,6 +426,10 @@ export default class Game {
return this._bulletScore;
}
public onGuideDone() {
engine.globalEvent.dispatchEvent('game-start');
}
public set _BulletScore(v: number) {
if (v == this._bulletScore) return;
v = Math.max(v, 0);
......
import {MConfigs} from "../Global/MConfigs";
import {MConst} from "../Global/MConst";
import {getTexture} from "../utils";
import {props} from "../../props";
const padding = 10;
......@@ -10,47 +11,51 @@ export default class GuideMask extends engine.Container {
const config = MConfigs.guide[index];
let mask = new engine.Sprite(getTexture("3cc0aa86-0581-4caa-b662-266e58fd39b7"));
const w = mask.width, h = mask.height;
x1 = Math.floor(x1);
y1 = Math.floor(y1);
const x = x1 - 320 / 2;
const y = y1 - 290 / 2;
const x = x1 - w / 2;
const y = y1 - h / 2;
mask.x = x;
mask.y = y;
this.addChild(mask);
const w = mask.width, h = mask.height;
const sw = MConst.DesignResolution.width, sh = MConst.DesignResolution.height;
let color = 0x000000;
let alpha = 0.7;
let top = new engine.Shape();
top.beginFill(0x01103a, 0.8);
top.beginFill(color, alpha);
top.drawRect(0, 0, sw, y);
top.endFill();
this.addChild(top);
let bottom = new engine.Shape();
bottom.beginFill(0x01103a, 0.8);
bottom.beginFill(color, alpha);
bottom.drawRect(x, y + h, w, sh - h - y);
bottom.endFill();
this.addChild(bottom);
let left = new engine.Shape();
left.beginFill(0x01103a, 0.8);
left.beginFill(color, alpha);
left.drawRect(0, y, x, sh - y);
left.endFill();
this.addChild(left);
let right = new engine.Shape();
right.beginFill(0x01103a, 0.8);
right.beginFill(color, alpha);
right.drawRect(x + w, y, sw - x - w, sh - y);
right.endFill();
this.addChild(right);
let offsetToMask = config.text.offsetToMask;
let label = new engine.Label();
label.text = config.text.str;
label.text = props['guideText' + index];//config.text.str;
label.size = 24;
label.fillColor = "rgba(255,255,255,1)";
label.x = offsetToMask.x + mask.x;
label.x = mask.x + (w - label.width) / 2;
label.y = offsetToMask.y + mask.y;
this.addChild(label);
......
import SoundMgr from "./SoundMgr";
import {props} from "../../props";
import GuideMask from "../Game/GuideMask";
import { ShootPlanet } from "../ShootPlanet";
import { DataMgr } from "./DataMgr";
import {MConfigs} from "../Global/MConfigs";
export default class GuideMgr {
......@@ -15,14 +16,18 @@ export default class GuideMgr {
}
public get guideFlag(): boolean {
return localStorage.getItem("guide") != "false";
return localStorage.getItem("shoot-planet_" + props.guideFlagKey) != "false";
}
public set guideFlag(v: boolean) {
localStorage.setItem("guide", v ? "true" : "false");
localStorage.setItem("shoot-planet_" + props.guideFlagKey, v ? "true" : "false");
}
private done: number[] = [];
get guideDone(){
return !this.guideFlag || this.done.length >= Object.keys(MConfigs.guide).length;
}
private currentGuideMask: GuideMask = null;
public runGuide(index: number, x: number, y: number, end: boolean = false) {
if (this.done[index] || this.guideFlag == false) return;
......@@ -33,6 +38,10 @@ export default class GuideMgr {
context.destroy();
DataMgr.game.pause = false;
if(this.done.length >= Object.keys(MConfigs.guide).length){
DataMgr.game.onGuideDone();
}
if (end) {
this.guideFlag = false;
}
......
......@@ -23,8 +23,6 @@ export default abstract class Collider extends GameComponent {
this.physics && this.physics.onColliderResize(this);
}
onEnabled() {
//自动设置物理组件
if (this.group)
......
......@@ -30,6 +30,9 @@ export class ShootPlanet extends engine.Container {
const car = this.game._car;
GuideMgr.instance.runGuide(0, car.x + car.width / 2, car.y + car.height / 2 /* - 130 */);
}
if (GuideMgr.instance.guideDone) {
this.game.onGuideDone();
}
}
public onSleep() {
......@@ -37,15 +40,15 @@ export class ShootPlanet extends engine.Container {
this.game = null;
}
public onRevive(){
public onRevive() {
this.game.revive();
}
public onPause(){
public onPause() {
this.game.pause = true;
}
public onResume(){
public onResume() {
this.game.pause = false;
}
......
......@@ -3,8 +3,12 @@
*/
import { ShootPlanet } from "./game/ShootPlanet";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
export default function (options) {
let instance = new ShootPlanet();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
......@@ -177,7 +177,7 @@ export function wxConfig(): Promise<void> {
wxdebug: false,
url: window.location.href
}, (res) => {
wx.config({
wx.props({
debug: false,
appId: res.wxappid,
timestamp: res.wxtimestamp,
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$PAGE_TITLE$</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: white;
}
#inputNum {
position: absolute;
background: none;
border: 0;
color: #333333;
outline: 0px;
visibility: hidden;
}
/* 易盾css*/
.captcha {
display: none;
position: fixed;
z-index: 10000;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.6);
}
.captcha .neCaptcha-dialog {
background-color: #fff;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
position: absolute;
left: 50%;
top: 45%;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width: 270px;
height: 134px;
}
.captcha .neCaptcha-dialog::after {
position: absolute;
content: '单次游戏结束,请拖动滑块提交分数';
width: 100%;
height: 30px;
top: -40px;
left: 0;
text-align: center;
line-height: 30px;
font-size: 16px;
color: #ffff00;
}
.captcha .neCaptcha-dialog::before {
background-color: #fff;
content: '';
display: block;
width: 280px;
height: 144px;
position: absolute;
top: -5px;
left: -5px;
z-index: -1;
}
</style>
</head>
<body>
<input type="number" id="inputNum">
<div id="$CONTAINER_ID$" style="line-height:0;font-size:0"></div>
<script src="//yun.duiba.com.cn/db_games/activity/md5/zepto_security_downloadApp.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/activity/md5/security.js"></script>
<!-- 易盾js -->
<script type="text/javascript" src="//cstaticdun.126.net/load.min.js"></script>
<!-- <script>
var oHead = document.querySelector('body');
var oScript = document.createElement('script');
oScript.type = 'text/javascript';
oScript.src = '//yun.duiba.com.cn/webapp/js/vconsole.min.js';
oHead.appendChild(oScript);
oScript.onload = function () {
var vConsole = new VConsole();
}
</script> -->
<script
src="http://yun.duiba.com.cn/editor/zeroing/libs/engine.413e65cb3aaee3651d4817eb1ea7c6a8732e0438.js"></script>
$SCRIPTS$
<script>
engine.launch('//yun.duiba.com.cn/aurora/$VERSION$-data.json');
</script>
</body>
</html>
\ No newline at end of file
try {
const props = {
lastToggle: target.findChildByUUID("6c82c9b8-361d-42d5-9c0d-0bb332bbdbeb"),
curToggle: target.findChildByUUID("86bb17dc-df9e-4900-802d-e5636390a222"),
lastBg: target.findChildByUUID("be83b6ae-bf67-4cb5-8cad-19521512b7e6"),
curBg: target.findChildByUUID("25e76897-655b-49eb-b536-28b7123d6558"),
lastTitle: target.findChildByUUID("24c2e89a-0885-40fc-b37c-b6ca38a8824a"),
curTitle: target.findChildByUUID("cabd2593-c197-46ee-b747-deb26923bd18"),
scroller: target.getChildByName("scrollList"),
myNickname: target.getChildByNamePath("我的信息组/我的昵称"),
myIndex: target.getChildByNamePath("我的信息组/我的排名"),
myScore: target.getChildByNamePath("我的信息组/我的分数"),
tip: target.parent.getChildByName("提示"),
noOpenGroup: target.parent.getChildByName("未开奖组"),
winningGroup: target.parent.getChildByName("中奖组"),
notWinnintGroup: target.parent.getChildByName("未中奖组"),
winningTip: target.parent.getChildByNamePath("中奖组/中奖提示")
}
//数据
let dataList1 = [];
for (let i = 0; i <= 200; i++) {
dataList1.push({
rank: i + 1,
nickname: "我是昵称",
score: 12138
});
}
let dataList2 = [];
for (let i = 0; i <= 50; i++) {
dataList2.push({
rank: i + 1,
nickname: "沙雕12138",
score: 11122255
});
}
//target.curData = [];
//target.lastData = [];
/**
* @param toggle
* @param {Array} listData
* @param { index:number, nickname:string, maxScore:number } myData
*/
target.onToggle = function (toggle, listData, myData, isNull) {
if (toggle === target.selection) {
return;
}
target.selection = toggle;
const resData = global.dataCenter.getDataByPath("rankList");
props.noOpenGroup.visible = false;
props.notWinnintGroup.visible = false;
props.winningGroup.visible = false;
if (toggle === props.lastToggle) { //选中上期
props.lastBg.visible = true;
props.curBg.visible = false;
props.lastTitle.fillColor = "rgba(255, 255, 255, 1)";
props.curTitle.fillColor = "rgba(244, 129, 89, 1)";
if (resData.winData.isWin.length > 0) {
switch (resData.winData.isWin) {
case "0": //未中奖
props.notWinnintGroup.visible = true;
break;
case "1": //中奖
props.winningGroup.visible = true;
props.winningTip.text = "恭喜你中奖了!";
break;
case "2": //中奖
props.winningGroup.visible = true;
props.winningTip.text = "很遗憾未中奖!";
break;
}
} else {
props.noOpenGroup.visible = true;
props.winningTip.visible = false;
}
if (!isNull) {
if (resData.currentFirstFlag) {
props.tip.text = "暂无数据";
props.tip.visible = true;
props.winningGroup.visible = false;
props.notWinnintGroup.visible = false;
props.noOpenGroup.visible = false;
myData = {}
listData = []
} else if (listData.length <= 0) {
props.tip.text = "快去玩游戏赢大奖吧~";
props.tip.visible = true;
myData = {}
props.winningGroup.visible = false;
props.notWinnintGroup.visible = false;
props.noOpenGroup.visible = false;
listData = []
} else {
props.tip.visible = false;
}
} else {
props.tip.visible = false;
}
} else if (toggle === props.curToggle) {
props.curTitle.fillColor = "rgba(255, 255, 255, 1)";
props.lastTitle.fillColor = "rgba(244, 129, 89, 1)";
props.lastBg.visible = false;
props.curBg.visible = true;
props.noOpenGroup.visible = true;
if (!isNull) {
if (global.dataCenter.getDataByPath("visit.finishedStatus") == true) {
props.tip.text = "活动已结束,敬请期待更多精彩内容";
props.tip.visible = true;
props.noOpenGroup.visible = false;
myData = {}
listData = []
} else if (listData.length <= 0) {
props.tip.text = "快去玩游戏赢大奖吧~";
props.tip.visible = true;
props.noOpenGroup.visible = false;
myData = {}
listData = []
} else {
props.tip.visible = false;
}
} else {
props.tip.visible = false;
}
}
//替换emoji
for (let i = 0; i < listData.lenght; i++) {
if (listData[i].userId.toString() == myData.userId) {
listData[i].nickname = myData.nickName
break;
}
}
props.scroller.setData(listData);
props.myNickname.text = limitText(myData.nickName, 12);
props.myIndex.text = rankText(myData.index);
props.myScore.text = scoreText(myData.maxScore);
}
target.selection = null;
target.onToggle(props.curToggle, [], {}, true);
target.selection = null;
props.scroller.viewPort.y = 0;
props.curToggle.dispatchEvent(engine.MouseEvent.CLICK);
} catch (error) {
console.error(error);
}
function scoreText(score) {
if (typeof score == "undefined")
return "";
if (typeof score != "number") {
return "0";
}
return limitText(score, 7);
}
function rankText(rank) {
if (typeof rank == "undefined")
return "";
if (typeof rank != "number") {
return "1000+";
}
if (rank > 1000) {
return "1000+";
}
return rank.toString();
}
next("success");
\ No newline at end of file
let errorMsg = args && ((args["desc"] || args["message"]) || ((args["code"] && "network error:" + args["code"]) || "network error")) || "network error";
/**
* Created by rockyl on 2019-11-16.
*/
let muted = engine.findVariable('muted', args, props);
engine.mute(muted);
next('complete');
{
"name": "静音",
"desc": "静音",
"props": {
"muted": {
"alias": "是否静音",
"type": "boolean",
"default": true
}
},
"output": [
"complete"
]
}
\ No newline at end of file
......@@ -2,5 +2,7 @@
* Created by rockyl on 2019-11-16.
*/
engine.addCustomModule(props.id, props.target || target);
let p = engine.findVariable('props', args, props);
engine.addCustomModule(props.id, props.target || target, p);
next('complete');
......@@ -9,6 +9,10 @@
"target": {
"type": "node",
"alias": "目标节点"
},
"props": {
"type": "map",
"alias": "配置属性"
}
},
"output": [
......
......@@ -2,16 +2,23 @@
* Created by rockyl on 2019-11-16.
*/
let replace = engine.findVariable('replace', args, props);
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}else{
} else {
let gameStage = engine.gameStage;
let view = gameStage.instantiateView(props.viewName);
if (view) {
gameStage.sceneContainer.push(view);
if (replace) {
gameStage.sceneContainer.replace(view);
} else {
gameStage.sceneContainer.push(view);
}
}
next('complete');
}
......@@ -5,6 +5,11 @@
"viewName": {
"alias": "目标视图名",
"type": "string"
},
"replace": {
"alias": "是否替换场景",
"type": "boolean",
"default": false
}
},
"output": [
......
......@@ -17,17 +17,17 @@
"default": "0.0.0.0"
},
"autoExposure": {
"alias": "自动曝光",
"alias": "曝光自动触发",
"type": "boolean",
"default": true
},
"onceAutoExposure": {
"alias": "单次自动曝光",
"alias": "单次曝光",
"type": "boolean",
"default": true
},
"autoExposureType": {
"alias": "自动曝光方式",
"alias": "曝光触发方式",
"type": "enum",
"enum": [
"visible",
......@@ -36,7 +36,7 @@
"default": "visible"
},
"autoClick": {
"alias": "自动点击",
"alias": "点击自动触发",
"type": "boolean",
"default": true
}
......
export default class Block extends engine.Container {
private body;
type: any;
dir: any;
constructor();
reset({ type, }: {
type: any;
}): void;
playEnter(index: any, animation: any): Promise<{}>;
playLeave(): void;
playEffect(): void;
stop(): void;
}
import Block from "./Block";
import { Background } from "./Background";
import Player from "./Player";
import { Base } from "./Base";
import { GuideLayer } from "./GuideLayer";
export default class GameView extends engine.Container {
background: Background;
base: Base;
frontContainer: engine.Container;
blockContainer: engine.Container;
guideLayer: GuideLayer;
player: Player;
hitEffect: svga.Svga;
currentBlock: Block;
needHitTest: any;
index: number;
blockComplete: any;
baseOffset: number;
timer: any;
_pos: any;
_score: any;
_remainToShowGoldBag: any;
lastLandType: any;
_touchEnabled: any;
private _hasSetup;
constructor();
setup(): void;
reset(revive?: boolean): Promise<void>;
resetPlayer(revive?: boolean): Promise<void>;
start(revive?: boolean): Promise<void>;
pause(): void;
resume(): void;
revive(): Promise<void>;
addBlock(animation?: boolean): void;
private goldBags;
addGoldBag(): void;
private nextToUpdateScore;
playOpenGoldBag(): Promise<void>;
onPlayerJumpOnTop(): void;
readonly blockCount: number;
pos: any;
updatePos(): void;
private onEnterFrame;
onHitOn(dir: any): Promise<void>;
jump(): Promise<void>;
private scoreChange;
playHitEffect(dir: any): void;
playZoom(type: 'in' | 'out', duration?: number): Promise<{}>;
playShake(): Promise<{}>;
}
export declare class GoldBag extends engine.Container {
private svga;
private avatar;
remain: number;
constructor();
setup(): void;
reset(data: any): void;
playOpen(): Promise<{}>;
}
export declare class JumpHigh extends engine.Container {
private _status;
private _gameView;
constructor();
reset(): void;
start(event: engine.Event): void;
pause(): void;
resume(): void;
revive(): void;
private onTap;
}
export default class Player extends engine.Container {
private jumpPromise;
private playing;
private vy;
private g;
private baseY;
private aboveBlock;
private _aniName;
private _currentAni;
private _prefectLandCounting;
private aniJump;
private aniFall;
private aniLandNormal;
private aniLandSide;
private aniHit;
private aniParachute;
private prefectEffect;
private landEffect;
constructor();
switchAni(name: any, dir?: number, play?: boolean, loop?: boolean): Promise<{}>;
setup(): void;
reset(revive: any): void;
playReady(): Promise<{}>;
private onEnterFrame;
changeBaseY(v: any): void;
jump(): Promise<{}>;
playLand(type: any, dir: any): Promise<void>;
hitAway(dir: any): Promise<void>;
parachute(dir: any): Promise<{}>;
}
export declare function getTexture(uuid: any): engine.Texture;
export declare function getTextureByName(name: any): engine.Texture;
export declare function getBlockAsset(type: any): any;
export declare function createSvga(name: any, anchorName: any): svga.Svga;
export declare function playSound(name: any): void;
import { JumpHigh } from "./game/JumpHigh";
export default function (props: any): JumpHigh;
export declare class Background extends engine.Container {
private _bg;
private _minScale;
constructor();
setup(): void;
playZoom(type: 'in' | 'out', duration?: number): Promise<{}>;
}
export declare class Base extends engine.Image {
constructor();
setup(): void;
reset(): void;
}
export default class Block extends engine.Container {
private body;
type: any;
dir: any;
constructor();
reset({ type, }: {
type: any;
}): void;
playEnter(index: any, animation: any): Promise<{}>;
playLeave(): void;
playEffect(): void;
stop(): void;
}
import { Turntable } from "./Turntable";
export declare class BreakUpPart extends engine.Container {
private _body;
private _turntable;
private _from;
private _to;
private _fromR;
private _toR;
constructor(turntable: Turntable, from: any, to: any);
updateMask(): void;
playFall(rotation: any): Promise<{}>;
readonly body: engine.Image;
}
import { GuideLayer } from "./GuideLayer";
import { Turntable } from "./Turntable";
export default class GameView extends engine.Container {
turntable: Turntable;
guideLayer: GuideLayer;
private _counting;
_touchEnabled: any;
private _hasSetup;
private _countdown;
private _stick;
private _timer;
constructor();
setup(): void;
reset(revive?: boolean, options?: any): Promise<void>;
start(): Promise<void>;
startCountDown(): void;
stopCountDown(): void;
prepareStick(): void;
recycleStick(): void;
pause(): void;
resume(): void;
revive(): Promise<void>;
private countDownStep;
private onTimeout;
private onHit;
tap(e: any): void;
}
export declare class GameWrapper extends engine.Container {
private _status;
private _gameView;
constructor();
reset(event: engine.Event): void;
start(event: engine.Event): void;
pause(): void;
resume(): void;
revive(): void;
clear(): void;
private onTap;
}
export declare class GoldBag extends engine.Container {
private svga;
constructor();
setup(): void;
reset(data: any): void;
playOpen(): Promise<{}>;
}
export declare class GuideLayer extends engine.Container {
private guideMask;
private label;
constructor();
private setup;
show(id: any, options: any): Promise<{}>;
createRect(container: any, x: any, y: any, width: any, height: any): void;
}
export declare class JumpHigh extends engine.Container {
private _status;
private _gameView;
constructor();
reset(): void;
start(event: engine.Event): void;
pause(): void;
resume(): void;
revive(): void;
private onTap;
}
export declare class LipstickTurntable extends engine.Container {
private _status;
private _gameView;
constructor();
reset(): void;
start(event: engine.Event): void;
pause(): void;
resume(): void;
revive(): void;
private onTap;
}
export declare class LispstickTurntable extends engine.Container {
private _status;
private _gameView;
constructor();
reset(): void;
start(event: engine.Event): void;
pause(): void;
resume(): void;
revive(): void;
private onTap;
}
export declare class LisptickTurntable extends engine.Container {
private _status;
private _gameView;
constructor();
reset(): void;
start(event: engine.Event): void;
pause(): void;
resume(): void;
revive(): void;
private onTap;
}
export default class Player extends engine.Container {
private jumpPromise;
private playing;
private vy;
private g;
private baseY;
private aboveBlock;
private _aniName;
private _currentAni;
private _prefectLandCounting;
private aniJump;
private aniFall;
private aniLandNormal;
private aniLandPrefect;
private aniLandSide;
private aniHit;
private aniParachute;
constructor();
switchAni(name: any, dir?: number, play?: boolean, loop?: boolean): Promise<{}>;
setup(): void;
reset(): void;
private onEnterFrame;
changeBaseY(v: any): void;
jump(): Promise<{}>;
playLand(type: any, dir: any): Promise<void>;
hitAway(dir: any): Promise<void>;
parachute(): Promise<{}>;
}
export declare class Stick extends engine.Container {
private _body;
private _toY;
constructor();
reset(): void;
playSend(y: any, callback: any): void;
stopSend(): void;
playFall(): Promise<{}>;
anchorOffsetY: any;
}
import { Stick } from "./Stick";
export declare class Turntable extends engine.Container {
private _wrapper;
private _stickContainer;
private _body;
private _breakUpContainer;
private _dir;
private _radius;
private _items;
private rotationRange;
constructor();
private resetAsset;
reset(options: any): void;
readonly radius: any;
start(): void;
pause(): void;
resume(): void;
addStick(stick: Stick): boolean;
parseAngle(r: any): number;
hideSticks(): void;
playBreakUp(): Promise<void>;
private shake;
private rotateOnce;
}
export declare function getTexture(uuid: any): engine.Texture;
export declare function getTextureByName(name: any): engine.Texture;
export declare function playSound(name: any): void;
import { GameWrapper } from "./game/GameWrapper";
export default function (props: any): GameWrapper;
export declare let props: any;
export declare function prepareProps(): void;
export declare function injectProps(p: any): void;
import GameObject from "./GameObject";
import Collider from "../Phycics/Collider";
export default class Car extends GameObject {
private imgParticel;
private fireTimer;
touchWall: 1 | -1 | 0;
onDied: () => void;
private isDied;
private fireParticleTimer;
private invincible;
private rowBulletNum;
private fireSpeed;
private collider;
constructor();
private fire;
private die;
onCollisionEnter(other: Collider): void;
onCollisionStay(other: Collider): void;
private onceBlink;
revive(): void;
move(deltaX: number): void;
onCollisionExit(other: Collider): void;
private onUpdate;
}
export default class GuideMask extends engine.Container {
constructor(index: number, x1: number, y1: number);
onClick: (context: GuideMask) => void;
}
export declare namespace MConfigs {
function updateConfig(): void;
const size: number[];
const drop: {
[key: number]: {
type: "bullet" | "power";
value: number;
textColor: number;
fileIndex: string;
};
};
const dropPool: {
0: {
num: number;
factor: {
0: number;
1: number;
2: number;
3: number;
4: number;
};
};
1: {
num: number;
factor: {
0: number;
1: number;
2: number;
3: number;
4: number;
};
};
2: {
num: number;
factor: {
0: number;
1: number;
2: number;
3: number;
4: number;
};
};
};
const guide: {
[key: number]: {
mask: string;
text: {
str: string;
offsetToMask: {
x: number;
y: number;
};
};
};
};
}
export default class GuideMgr {
private static _instance;
static readonly instance: GuideMgr;
guideFlag: boolean;
private done;
readonly guideDone: boolean;
private currentGuideMask;
runGuide(index: number, x: number, y: number, end?: boolean): void;
}
import Game from "./Game/Game";
export declare class ShootPlanet extends engine.Container {
game: Game;
constructor();
onActive(): void;
onSleep(): void;
onRevive(): void;
onPause(): void;
onResume(): void;
private init;
private customProperty;
}
import { ShootPlanet } from "./game/ShootPlanet";
export default function (props: any): ShootPlanet;
export declare let props: any;
export declare function prepareProps(): void;
export declare function injectProps(p: any): void;
......@@ -40,6 +40,14 @@ acorn@^7.1.0:
resolved "https://registry.npm.taobao.org/acorn/download/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c"
integrity sha1-lJ028sKSU12mAig1hsJHfFfrLWw=
ambi@3.2.0:
version "3.2.0"
resolved "https://registry.npm.taobao.org/ambi/download/ambi-3.2.0.tgz?cache=0&sync_timestamp=1575879705686&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fambi%2Fdownload%2Fambi-3.2.0.tgz#13b45fcf6845465f652137f80176322e911b70d6"
integrity sha1-E7Rfz2hFRl9lITf4AXYyLpEbcNY=
dependencies:
editions "^2.1.0"
typechecker "^4.3.0"
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1573557628456&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
......@@ -86,6 +94,11 @@ color-name@1.1.3:
resolved "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
commander@^4.1.0:
version "4.1.0"
resolved "https://registry.npm.taobao.org/commander/download/commander-4.1.0.tgz#545983a0603fe425bc672d66c9e3c89c42121a83"
integrity sha1-VFmDoGA/5CW8Zy1myePInEISGoM=
commander@~2.20.3:
version "2.20.3"
resolved "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1573464045808&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
......@@ -96,6 +109,26 @@ concat-map@0.0.1:
resolved "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
eachr@^4.5.0:
version "4.5.0"
resolved "https://registry.npm.taobao.org/eachr/download/eachr-4.5.0.tgz#495eb3aab6a41811da1e04e510424df32075cf04"
integrity sha1-SV6zqrakGBHaHgTlEEJN8yB1zwQ=
dependencies:
typechecker "^6.2.0"
editions@^2.1.0, editions@^2.2.0:
version "2.3.0"
resolved "https://registry.npm.taobao.org/editions/download/editions-2.3.0.tgz#47f2d5309340bce93ab5eb6ad755b9e90ff825e4"
integrity sha1-R/LVMJNAvOk6tetq11W56Q/4JeQ=
dependencies:
errlop "^2.0.0"
semver "^6.3.0"
errlop@^2.0.0:
version "2.0.0"
resolved "https://registry.npm.taobao.org/errlop/download/errlop-2.0.0.tgz#52b97d35da1b0795e2647b5d2d3a46d17776f55a"
integrity sha1-Url9NdobB5XiZHtdLTpG0Xd29Vo=
escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
......@@ -111,6 +144,21 @@ esutils@^2.0.2:
resolved "https://registry.npm.taobao.org/esutils/download/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=
extendr@^4.3.0:
version "4.3.0"
resolved "https://registry.npm.taobao.org/extendr/download/extendr-4.3.0.tgz#ef72646ac8f05a89eceea080837256056f09c5d9"
integrity sha1-73JkasjwWons7qCAg3JWBW8Jxdk=
dependencies:
typechecker "^6.2.0"
extract-opts@^4.3.0:
version "4.3.0"
resolved "https://registry.npm.taobao.org/extract-opts/download/extract-opts-4.3.0.tgz#ee0a797249abb77e449bdaaba66ebeff4775505e"
integrity sha1-7gp5ckmrt35Em9qrpm6+/0d1UF4=
dependencies:
eachr "^4.5.0"
typechecker "^6.2.0"
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
......@@ -137,7 +185,7 @@ glob@^7.1.6:
once "^1.3.0"
path-is-absolute "^1.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.3:
version "4.2.3"
resolved "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
integrity sha1-ShL/G2A3bvCYYsIJPt2Qgyi+hCM=
......@@ -147,6 +195,18 @@ has-flag@^3.0.0:
resolved "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
ignorefs@^2.3.0:
version "2.3.0"
resolved "https://registry.npm.taobao.org/ignorefs/download/ignorefs-2.3.0.tgz#2a70a80a55b1ccecf14b65d7fb78dc1b3b454c80"
integrity sha1-KnCoClWxzOzxS2XX+3jcGztFTIA=
dependencies:
ignorepatterns "^2.2.0"
ignorepatterns@^2.2.0:
version "2.3.0"
resolved "https://registry.npm.taobao.org/ignorepatterns/download/ignorepatterns-2.3.0.tgz#2d88c15062141ce019a7c12b25204dfbbab38c77"
integrity sha1-LYjBUGIUHOAZp8ErJSBN+7qzjHc=
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
......@@ -228,6 +288,11 @@ path-parse@^1.0.6:
resolved "https://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=
readdir-cluster@^2.3.0:
version "2.3.0"
resolved "https://registry.npm.taobao.org/readdir-cluster/download/readdir-cluster-2.3.0.tgz#54d9b539406c01329ed1b9015e35dddca6a8c6db"
integrity sha1-VNm1OUBsATKe0bkBXjXd3Kaoxts=
resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1:
version "1.12.1"
resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.12.1.tgz#a17d6368ffafb9dd14b584cac7940f9219ac55bb"
......@@ -298,6 +363,36 @@ rollup@^1.27.13:
"@types/node" "*"
acorn "^7.1.0"
safefs@^5.4.0, safefs@^5.5.0:
version "5.5.0"
resolved "https://registry.npm.taobao.org/safefs/download/safefs-5.5.0.tgz#17506b894542c592b33379578177bbab9f06c085"
integrity sha1-F1BriUVCxZKzM3lXgXe7q58GwIU=
dependencies:
graceful-fs "^4.2.3"
safeps@^9.3.0:
version "9.3.0"
resolved "https://registry.npm.taobao.org/safeps/download/safeps-9.3.0.tgz#6d47bcdf4a8ec347d71ea768c8cd1f1daa6e1666"
integrity sha1-bUe830qOw0fXHqdoyM0fHapuFmY=
dependencies:
extract-opts "^4.3.0"
safefs "^5.4.0"
taskgroup "^6.4.0"
typechecker "^6.2.0"
scandirectory@^5.3.0:
version "5.3.0"
resolved "https://registry.npm.taobao.org/scandirectory/download/scandirectory-5.3.0.tgz#4ed904e1516e969ff5549ff7f22b4658bca15f83"
integrity sha1-TtkE4VFulp/1VJ/38itGWLyhX4M=
dependencies:
ignorefs "^2.3.0"
readdir-cluster "^2.3.0"
semver@^6.3.0:
version "6.3.0"
resolved "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=
serialize-javascript@^1.9.0:
version "1.9.1"
resolved "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb"
......@@ -327,11 +422,34 @@ supports-color@^6.1.0:
dependencies:
has-flag "^3.0.0"
taskgroup@^6.4.0, taskgroup@^6.5.0:
version "6.5.0"
resolved "https://registry.npm.taobao.org/taskgroup/download/taskgroup-6.5.0.tgz#96c3e666edf1a4494915f818a31ace8268a621ae"
integrity sha1-lsPmZu3xpElJFfgYoxrOgmimIa4=
dependencies:
ambi "3.2.0"
eachr "^4.5.0"
extendr "^4.3.0"
safeps "^9.3.0"
unbounded "^2.2.0"
tslib@^1.10.0:
version "1.10.0"
resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha1-w8GflZc/sKYpc/sJ2Q2WHuQ+XIo=
typechecker@^4.3.0:
version "4.11.0"
resolved "https://registry.npm.taobao.org/typechecker/download/typechecker-4.11.0.tgz#8219cd90d2f7b585a3f5af9c146c8a23891f1eac"
integrity sha1-ghnNkNL3tYWj9a+cFGyKI4kfHqw=
dependencies:
editions "^2.2.0"
typechecker@^6.2.0:
version "6.3.0"
resolved "https://registry.npm.taobao.org/typechecker/download/typechecker-6.3.0.tgz#c8ee2fee30e1d1156d3063efb9d115c859c3cf5b"
integrity sha1-yO4v7jDh0RVtMGPvudEVyFnDz1s=
typescript@^3.7.2:
version "3.7.2"
resolved "https://registry.npm.taobao.org/typescript/download/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb"
......@@ -345,11 +463,28 @@ uglify-js@^3.4.9:
commander "~2.20.3"
source-map "~0.6.1"
unbounded@^2.2.0:
version "2.3.0"
resolved "https://registry.npm.taobao.org/unbounded/download/unbounded-2.3.0.tgz#80bfdbb2f448b61b4992b4fef8f4f6d35c50c459"
integrity sha1-gL/bsvRIthtJkrT++PT201xQxFk=
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=
watchr@^5.6.0:
version "5.6.0"
resolved "https://registry.npm.taobao.org/watchr/download/watchr-5.6.0.tgz#3d6c94d5dc6a32c0528c32c79f84f5d7595b7813"
integrity sha1-PWyU1dxqMsBSjDLHn4T111lbeBM=
dependencies:
eachr "^4.5.0"
extendr "^4.3.0"
ignorefs "^2.3.0"
safefs "^5.5.0"
scandirectory "^5.3.0"
taskgroup "^6.5.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
......
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