Commit 0e85c3c0 authored by 任建锋's avatar 任建锋

--

parent 91229572
No preview for this file type
No preview for this file type
...@@ -168,5 +168,5 @@ ...@@ -168,5 +168,5 @@
} }
}, },
"id": "food-fell2", "id": "food-fell2",
"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['food-fell2'] = 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 getTextureByName(name) {\n\t return engine.Texture.from(engine.getAssetByName(name).uuid);\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 return inst;\n\t}\n\t//# sourceMappingURL=utils.js.map\n\n\tvar Goods = (function (_super) {\n\t tslib.__extends(Goods, _super);\n\t function Goods() {\n\t var _this = _super.call(this) || this;\n\t var body;\n\t body = _this._body = new engine.Rect();\n\t var rain = new engine.Sprite(getTextureByName('雨滴0'));\n\t var rain1 = new engine.Sprite(getTextureByName('雨滴1'));\n\t var rain2 = new engine.Sprite(getTextureByName('雨滴2'));\n\t rain[\"npcType\"] = \"rain0\";\n\t rain1[\"npcType\"] = \"rain1\";\n\t rain2[\"npcType\"] = \"rain2\";\n\t var stone = new engine.Sprite(getTextureByName('石块'));\n\t stone[\"npcType\"] = \"stone\";\n\t var boom = new engine.Sprite(getTextureByName('炸弹'));\n\t boom[\"npcType\"] = \"boom\";\n\t rain.visible = false;\n\t rain1.visible = false;\n\t rain2.visible = false;\n\t stone.visible = false;\n\t boom.visible = false;\n\t body.addChild(rain);\n\t body.addChild(rain1);\n\t body.addChild(rain2);\n\t body.addChild(stone);\n\t body.addChild(boom);\n\t _this.addChild(body);\n\t body.width = .0001;\n\t body.height = .0001;\n\t body.mouseEnabled = false;\n\t return _this;\n\t }\n\t Goods.prototype.getRandomNumberByRange = function (start, end) {\n\t return Math.floor(Math.random() * (end - start) + start);\n\t };\n\t Goods.prototype.reset = function () {\n\t this.visible = true;\n\t this.rotation = 0;\n\t this.anchorOffsetY = 0;\n\t this.y = 0;\n\t this.x = (750 - 120) * Math.random() + 30;\n\t this.rotation = 0;\n\t var random = Math.random();\n\t if (typeof (props.goodsProbability) == 'string') {\n\t props.goodsProbability = props.goodsProbability.split(',').map(function (i) { return +i; });\n\t }\n\t if (random < props.goodsProbability[0]) {\n\t var randomNum = Math.floor(Math.random() * 3);\n\t this.showNpc(\"rain\" + randomNum);\n\t }\n\t else if (random >= props.goodsProbability[0] && random <= (props.goodsProbability[0] + props.goodsProbability[1])) {\n\t this.showNpc(\"stone\");\n\t }\n\t else if (random > (props.goodsProbability[0] + props.goodsProbability[1])) {\n\t this.showNpc(\"boom\");\n\t }\n\t };\n\t Goods.prototype.showNpc = function (type) {\n\t for (var i = 0; i < this._body.children.length; i++) {\n\t this._body.children[i].visible = false;\n\t this._body.children[i].mouseEnabled = false;\n\t }\n\t for (var i = 0; i < this._body.children.length; i++) {\n\t if (this._body.children[i][\"npcType\"] == type) {\n\t this[\"npcType\"] = type;\n\t this._body.children[i].visible = true;\n\t this._body.children[i].mouseEnabled = false;\n\t }\n\t }\n\t };\n\t Object.defineProperty(Goods.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 Goods;\n\t}(engine.Container));\n\t//# sourceMappingURL=Goods.js.map\n\n\tvar ObjectPool = engine.ObjectPool;\n\tvar PoolName = 'goods';\n\tObjectPool.registerPool(PoolName, function () {\n\t return new Goods();\n\t}, function (item, data) {\n\t item.reset();\n\t});\n\t//# sourceMappingURL=object-pool-init.js.map\n\n\tvar ObjectPool$1 = 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.goodsItems = [];\n\t _this.viewVisible = true;\n\t _this.cacheTime = 0;\n\t _this.cacheTime2 = 0;\n\t _this.moveCatchX = 0;\n\t _this.playerCatchX = 0;\n\t _this.onDownStage = function (e) {\n\t _this.moveCatchX = e.localX;\n\t _this.playerCatchX = _this.player.x;\n\t };\n\t _this.onMoveStage = function (e) {\n\t var maxStageBound = props.maxStageBound;\n\t if (_this.gameIng) {\n\t var playerX = _this.playerCatchX + (e.localX - _this.moveCatchX);\n\t if (playerX < maxStageBound) {\n\t _this.player.x = maxStageBound;\n\t }\n\t else if (playerX + _this.player.width + maxStageBound > 750) {\n\t _this.player.x = 750 - maxStageBound - _this.player.width;\n\t }\n\t else {\n\t _this.player.x = playerX;\n\t }\n\t }\n\t };\n\t _this.onOutStage = function (e) {\n\t _this.moveCatchX = 0;\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 var _this = this;\n\t if (this._hasSetup) {\n\t return;\n\t }\n\t this._hasSetup = true;\n\t this.NpcBg = new engine.Container();\n\t this.NpcBg.alpha = 1;\n\t this.NpcBg.width = 0;\n\t this.NpcBg.height = 0;\n\t this.addChild(this.NpcBg);\n\t this.player = new engine.Container();\n\t this.player.mouseEnabled = false;\n\t this.addChild(this.player);\n\t this.waterSvga = createSvga(\"水花\");\n\t this.stoneSvga = createSvga(\"石头svga\");\n\t this.playerSvga = new engine.Sprite(getTextureByName('玩家'));\n\t this.boomSvga = createSvga(\"炸弹svga\");\n\t this.player.addChild(this.playerSvga);\n\t this.player.addChild(this.stoneSvga);\n\t this.player.addChild(this.waterSvga);\n\t this.player.addChild(this.boomSvga);\n\t this.waterSvga.visible = false;\n\t this.stoneSvga.visible = false;\n\t this.boomSvga.visible = false;\n\t this.visible = false;\n\t setTimeout(function () {\n\t _this.visible = true;\n\t _this.player.anchorY = _this.player.height / 2;\n\t _this.player.anchorX = _this.player.width / 2;\n\t _this.player.x = 375 - _this.player.width / 2;\n\t _this.player.y = props.playerPositionY;\n\t _this.stoneSvga.x = _this.player.width / 2 - _this.stoneSvga.width / 2 + props.boomPosition1Offset[0];\n\t _this.stoneSvga.y = _this.player.height / 2 - _this.stoneSvga.height / 2 + props.boomPosition1Offset[1];\n\t _this.waterSvga.x = _this.player.width / 2 - _this.waterSvga.width / 2 + props.boomPosition2Offset[0];\n\t _this.waterSvga.y = _this.player.height / 2 - _this.waterSvga.height / 2 + props.boomPosition2Offset[1];\n\t _this.boomSvga.x = _this.player.width / 2 - _this.boomSvga.width / 2 + props.boomPosition3Offset[0];\n\t _this.boomSvga.y = _this.player.height / 2 - _this.boomSvga.height / 2 + props.boomPosition3Offset[1];\n\t }, 300);\n\t this.rectBg = new engine.Container();\n\t this.rectBg.alpha = 0;\n\t this.rectBg.width = 750;\n\t this.rectBg.height = 1624;\n\t this.addChild(this.rectBg);\n\t this.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t this.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\t document.addEventListener(\"visibilitychange\", function () {\n\t if (document.visibilityState == \"visible\") {\n\t _this.viewVisible = true;\n\t }\n\t if (document.visibilityState == \"hidden\") {\n\t _this.viewVisible = false;\n\t }\n\t });\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame, this);\n\t };\n\t GameView.prototype.enterFrame = function () {\n\t this.updateTime();\n\t this.updateTimeBeginNpc();\n\t };\n\t GameView.prototype.reset = function () {\n\t this.score = props.speed;\n\t this.recycleGoods();\n\t this.player.x = 375 - this.player.width / 2;\n\t };\n\t GameView.prototype.start = function () {\n\t this.score = 0;\n\t this.speed = 1;\n\t this.gameIng = true;\n\t this.beginNpc();\n\t this.countdown = props.countDown;\n\t };\n\t GameView.prototype.updateTime = function () {\n\t if (Date.now() - this.cacheTime > 1000) {\n\t this.cacheTime = Date.now();\n\t }\n\t else {\n\t return;\n\t }\n\t if (this.gameIng) {\n\t if (this.countdown > 0) {\n\t engine.globalEvent.dispatchEvent('food-fell-time-update', {\n\t time: this.countdown,\n\t });\n\t this.countdown -= 1;\n\t }\n\t else {\n\t engine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t score: this.score,\n\t reason: 1\n\t });\n\t this.died();\n\t }\n\t }\n\t };\n\t GameView.prototype.beginNpc = function () {\n\t };\n\t GameView.prototype.updateTimeBeginNpc = function () {\n\t if (Date.now() - this.cacheTime2 > (2000 / this.speed)) {\n\t this.cacheTime2 = Date.now();\n\t }\n\t else {\n\t return;\n\t }\n\t if (this.gameIng) {\n\t this.speed += props.acceleratedSpeed;\n\t if (this.speed >= props.maxSpeed) {\n\t this.speed = props.maxSpeed;\n\t }\n\t this.creatNpc();\n\t }\n\t };\n\t GameView.prototype.pause = function () {\n\t this.gameIng = false;\n\t };\n\t GameView.prototype.revive = function () {\n\t this.gameIng = true;\n\t };\n\t GameView.prototype.resume = function () {\n\t this.reset();\n\t this.start();\n\t };\n\t GameView.prototype.creatNpc = function () {\n\t var _this = this;\n\t var goods = this._goods = ObjectPool$1.getObject(PoolName);\n\t this.goodsItems.push(goods);\n\t this.NpcBg.addChild(goods);\n\t goods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = function () {\n\t if (goods.y > 1624) {\n\t _this.removeNpc(goods);\n\t }\n\t else {\n\t if (_this.gameIng) {\n\t goods.y += (4 * _this.speed);\n\t if (_this.hasHit(_this.player, goods)) {\n\t if (goods[\"npcType\"].indexOf(\"rain\") > -1) {\n\t _this.score += props.rainScore;\n\t _this.waterSvga.visible = true;\n\t _this.waterSvga.play(false, false);\n\t _this.waterSvga.once(engine.Event.END_FRAME, function () {\n\t _this.waterSvga.visible = false;\n\t }, _this);\n\t if (_this.score < 0) {\n\t _this.score = 0;\n\t }\n\t }\n\t else if (goods[\"npcType\"] == \"stone\") {\n\t _this.score += props.stoneScore;\n\t if (_this.score < 0) {\n\t _this.score = 0;\n\t }\n\t _this.stoneSvga.visible = true;\n\t _this.stoneSvga.play(false, false);\n\t _this.stoneSvga.once(engine.Event.END_FRAME, function () {\n\t _this.stoneSvga.visible = false;\n\t }, _this);\n\t }\n\t else if (goods[\"npcType\"] == \"boom\") {\n\t _this.boomSvga.visible = true;\n\t _this.boomSvga.play(false, false);\n\t _this.died();\n\t _this.boomSvga.once(engine.Event.END_FRAME, function () {\n\t _this.boomSvga.visible = false;\n\t engine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t score: _this.score,\n\t reason: 2\n\t });\n\t }, _this);\n\t }\n\t engine.globalEvent.dispatchEvent('food-fell-score-update', {\n\t score: _this.score,\n\t });\n\t _this.removeNpc(goods);\n\t }\n\t }\n\t }\n\t }, this);\n\t };\n\t GameView.prototype.died = function () {\n\t this.pause();\n\t setTimeout(function () {\n\t engine.globalEvent.dispatchEvent('food-fell-reset', {\n\t \"goodsProbability\": \"0.8,0.1,0.1\",\n\t \"countDown\": 30,\n\t \"acceleratedSpeed\": 0.1\n\t });\n\t engine.globalEvent.dispatchEvent('food-fell-start');\n\t }, 2000);\n\t };\n\t GameView.prototype.removeNpc = function (goods) {\n\t this.NpcBg.removeChild(goods);\n\t ObjectPool$1.recycleObject(PoolName, goods);\n\t goods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t var index = this.goodsItems.indexOf(goods);\n\t if (index > -1) {\n\t this.goodsItems.splice(index, 1);\n\t }\n\t };\n\t GameView.prototype.recycleGoods = function () {\n\t clearTimeout(this.timer);\n\t clearInterval(this.countdownTimer);\n\t for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) {\n\t var goods = _a[_i];\n\t if (goods) {\n\t this.NpcBg.removeChild(goods);\n\t ObjectPool$1.recycleObject(PoolName, goods);\n\t goods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t }\n\t }\n\t this.goodsItems = [];\n\t };\n\t GameView.prototype.hasHit = function (a, b) {\n\t var playerH = a.height;\n\t var playerW = a.width;\n\t var playerX = a.x;\n\t if (props.playerHeight) {\n\t playerH = props.playerHeight;\n\t }\n\t if (props.playerWidth) {\n\t playerW = props.playerWidth;\n\t playerX = a.x + (a.width - props.playerWidth) / 2;\n\t }\n\t if (Math.abs((playerX + playerW / 2) - (b.x + b.width / 2)) < playerW / 2 + b.width / 2\n\t &&\n\t Math.abs((a.y + playerH / 1.3) - (b.y + b.height / 2)) < playerH / 2 + b.height / 2) {\n\t return true;\n\t }\n\t else {\n\t return false;\n\t }\n\t };\n\t return GameView;\n\t}(engine.Container));\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('food-fell-reset', _this.reset, _this);\n\t engine.globalEvent.addEventListener('food-fell-start', _this.start, _this);\n\t engine.globalEvent.addEventListener('food-fell-pause', _this.pause, _this);\n\t engine.globalEvent.addEventListener('food-fell-resume', _this.resume, _this);\n\t engine.globalEvent.addEventListener('food-fell-revive', _this.revive, _this);\n\t engine.globalEvent.addEventListener('food-fell-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();\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 };\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" "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['food-fell2'] = 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\n\tfunction getTextureByName(name) {\n\t return engine.Texture.from(getAssetByName(name).uuid);\n\t}\n\tfunction createSvga(name, anchorName) {\n\t var inst = new svga.Svga();\n\t inst.source = 'asset://' + getAssetByName(name).uuid;\n\t return inst;\n\t}\n\n\tvar Goods = (function (_super) {\n\t tslib.__extends(Goods, _super);\n\t function Goods() {\n\t var _this = _super.call(this) || this;\n\t var body;\n\t body = _this._body = new engine.Rect();\n\t var rain = new engine.Sprite(getTextureByName('雨滴0'));\n\t var rain1 = new engine.Sprite(getTextureByName('雨滴1'));\n\t var rain2 = new engine.Sprite(getTextureByName('雨滴2'));\n\t rain[\"npcType\"] = \"rain0\";\n\t rain1[\"npcType\"] = \"rain1\";\n\t rain2[\"npcType\"] = \"rain2\";\n\t var stone = new engine.Sprite(getTextureByName('石块'));\n\t stone[\"npcType\"] = \"stone\";\n\t var boom = new engine.Sprite(getTextureByName('炸弹'));\n\t boom[\"npcType\"] = \"boom\";\n\t rain.visible = false;\n\t rain1.visible = false;\n\t rain2.visible = false;\n\t stone.visible = false;\n\t boom.visible = false;\n\t body.addChild(rain);\n\t body.addChild(rain1);\n\t body.addChild(rain2);\n\t body.addChild(stone);\n\t body.addChild(boom);\n\t _this.addChild(body);\n\t body.width = .0001;\n\t body.height = .0001;\n\t body.mouseEnabled = false;\n\t return _this;\n\t }\n\t Goods.prototype.getRandomNumberByRange = function (start, end) {\n\t return Math.floor(Math.random() * (end - start) + start);\n\t };\n\t Goods.prototype.reset = function () {\n\t this.visible = true;\n\t this.rotation = 0;\n\t this.anchorOffsetY = 0;\n\t this.y = 0;\n\t this.x = (750 - 120) * Math.random() + 30;\n\t this.rotation = 0;\n\t var random = Math.random();\n\t if (typeof (props.goodsProbability) == 'string') {\n\t props.goodsProbability = props.goodsProbability.split(',').map(function (i) { return +i; });\n\t }\n\t if (random < props.goodsProbability[0]) {\n\t var randomNum = Math.floor(Math.random() * 3);\n\t this.showNpc(\"rain\" + randomNum);\n\t }\n\t else if (random >= props.goodsProbability[0] && random <= (props.goodsProbability[0] + props.goodsProbability[1])) {\n\t this.showNpc(\"stone\");\n\t }\n\t else if (random > (props.goodsProbability[0] + props.goodsProbability[1])) {\n\t this.showNpc(\"boom\");\n\t }\n\t };\n\t Goods.prototype.showNpc = function (type) {\n\t for (var i = 0; i < this._body.children.length; i++) {\n\t this._body.children[i].visible = false;\n\t this._body.children[i].mouseEnabled = false;\n\t }\n\t for (var i = 0; i < this._body.children.length; i++) {\n\t if (this._body.children[i][\"npcType\"] == type) {\n\t this[\"npcType\"] = type;\n\t this._body.children[i].visible = true;\n\t this._body.children[i].mouseEnabled = false;\n\t }\n\t }\n\t };\n\t Object.defineProperty(Goods.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 Goods;\n\t}(engine.Container));\n\n\tvar ObjectPool = engine.ObjectPool;\n\tvar PoolName = 'goods';\n\tObjectPool.registerPool(PoolName, function () {\n\t return new Goods();\n\t}, function (item, data) {\n\t item.reset();\n\t});\n\n\tvar ObjectPool$1 = 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.goodsItems = [];\n\t _this.viewVisible = true;\n\t _this.cacheTime = 0;\n\t _this.cacheTime2 = 0;\n\t _this.moveCatchX = 0;\n\t _this.playerCatchX = 0;\n\t _this.onDownStage = function (e) {\n\t _this.moveCatchX = e.localX;\n\t _this.playerCatchX = _this.player.x;\n\t };\n\t _this.onMoveStage = function (e) {\n\t var maxStageBound = props.maxStageBound;\n\t if (_this.gameIng) {\n\t var playerX = _this.playerCatchX + (e.localX - _this.moveCatchX);\n\t if (playerX < maxStageBound) {\n\t _this.player.x = maxStageBound;\n\t }\n\t else if (playerX + _this.player.width + maxStageBound > 750) {\n\t _this.player.x = 750 - maxStageBound - _this.player.width;\n\t }\n\t else {\n\t _this.player.x = playerX;\n\t }\n\t }\n\t };\n\t _this.onOutStage = function (e) {\n\t _this.moveCatchX = 0;\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 var _this = this;\n\t if (this._hasSetup) {\n\t return;\n\t }\n\t this._hasSetup = true;\n\t this.NpcBg = new engine.Container();\n\t this.NpcBg.alpha = 1;\n\t this.NpcBg.width = 0;\n\t this.NpcBg.height = 0;\n\t this.addChild(this.NpcBg);\n\t this.player = new engine.Container();\n\t this.player.mouseEnabled = false;\n\t this.addChild(this.player);\n\t this.waterSvga = createSvga(\"水花\");\n\t this.stoneSvga = createSvga(\"石头svga\");\n\t this.playerSvga = new engine.Sprite(getTextureByName('玩家'));\n\t this.boomSvga = createSvga(\"炸弹svga\");\n\t this.player.addChild(this.playerSvga);\n\t this.player.addChild(this.stoneSvga);\n\t this.player.addChild(this.waterSvga);\n\t this.player.addChild(this.boomSvga);\n\t this.waterSvga.visible = false;\n\t this.stoneSvga.visible = false;\n\t this.boomSvga.visible = false;\n\t this.visible = false;\n\t setTimeout(function () {\n\t _this.visible = true;\n\t _this.player.anchorY = _this.player.height / 2;\n\t _this.player.anchorX = _this.player.width / 2;\n\t _this.player.x = 375 - _this.player.width / 2;\n\t _this.player.y = props.playerPositionY;\n\t _this.stoneSvga.x = _this.player.width / 2 - _this.stoneSvga.width / 2 + props.boomPosition1Offset[0];\n\t _this.stoneSvga.y = _this.player.height / 2 - _this.stoneSvga.height / 2 + props.boomPosition1Offset[1];\n\t _this.waterSvga.x = _this.player.width / 2 - _this.waterSvga.width / 2 + props.boomPosition2Offset[0];\n\t _this.waterSvga.y = _this.player.height / 2 - _this.waterSvga.height / 2 + props.boomPosition2Offset[1];\n\t _this.boomSvga.x = _this.player.width / 2 - _this.boomSvga.width / 2 + props.boomPosition3Offset[0];\n\t _this.boomSvga.y = _this.player.height / 2 - _this.boomSvga.height / 2 + props.boomPosition3Offset[1];\n\t }, 300);\n\t this.rectBg = new engine.Container();\n\t this.rectBg.alpha = 0;\n\t this.rectBg.width = 750;\n\t this.rectBg.height = 1624;\n\t this.addChild(this.rectBg);\n\t this.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t this.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\t document.addEventListener(\"visibilitychange\", function () {\n\t if (document.visibilityState == \"visible\") {\n\t _this.viewVisible = true;\n\t }\n\t if (document.visibilityState == \"hidden\") {\n\t _this.viewVisible = false;\n\t }\n\t });\n\t this.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame, this);\n\t };\n\t GameView.prototype.enterFrame = function () {\n\t this.updateTime();\n\t this.updateTimeBeginNpc();\n\t };\n\t GameView.prototype.reset = function () {\n\t this.score = props.speed;\n\t this.recycleGoods();\n\t this.player.x = 375 - this.player.width / 2;\n\t };\n\t GameView.prototype.start = function () {\n\t this.score = 0;\n\t this.speed = 1;\n\t this.gameIng = true;\n\t this.beginNpc();\n\t this.countdown = props.countDown;\n\t };\n\t GameView.prototype.updateTime = function () {\n\t if (Date.now() - this.cacheTime > 1000) {\n\t this.cacheTime = Date.now();\n\t }\n\t else {\n\t return;\n\t }\n\t if (this.gameIng) {\n\t if (this.countdown > 0) {\n\t engine.globalEvent.dispatchEvent('food-fell-time-update', {\n\t time: this.countdown,\n\t });\n\t this.countdown -= 1;\n\t }\n\t else {\n\t engine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t score: this.score,\n\t reason: 1\n\t });\n\t this.died();\n\t }\n\t }\n\t };\n\t GameView.prototype.beginNpc = function () {\n\t };\n\t GameView.prototype.updateTimeBeginNpc = function () {\n\t if (Date.now() - this.cacheTime2 > (2000 / this.speed)) {\n\t this.cacheTime2 = Date.now();\n\t }\n\t else {\n\t return;\n\t }\n\t if (this.gameIng) {\n\t this.speed += props.acceleratedSpeed;\n\t if (this.speed >= props.maxSpeed) {\n\t this.speed = props.maxSpeed;\n\t }\n\t this.creatNpc();\n\t }\n\t };\n\t GameView.prototype.pause = function () {\n\t this.gameIng = false;\n\t };\n\t GameView.prototype.revive = function () {\n\t this.gameIng = true;\n\t };\n\t GameView.prototype.resume = function () {\n\t this.reset();\n\t this.start();\n\t };\n\t GameView.prototype.creatNpc = function () {\n\t var _this = this;\n\t var goods = this._goods = ObjectPool$1.getObject(PoolName);\n\t this.goodsItems.push(goods);\n\t this.NpcBg.addChild(goods);\n\t goods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = function () {\n\t if (goods.y > 1624) {\n\t _this.removeNpc(goods);\n\t }\n\t else {\n\t if (_this.gameIng) {\n\t goods.y += (4 * _this.speed);\n\t if (_this.hasHit(_this.player, goods)) {\n\t if (goods[\"npcType\"].indexOf(\"rain\") > -1) {\n\t _this.score += props.rainScore;\n\t _this.waterSvga.visible = true;\n\t _this.waterSvga.play(false, false);\n\t _this.waterSvga.once(engine.Event.END_FRAME, function () {\n\t _this.waterSvga.visible = false;\n\t }, _this);\n\t if (_this.score < 0) {\n\t _this.score = 0;\n\t }\n\t }\n\t else if (goods[\"npcType\"] == \"stone\") {\n\t _this.score += props.stoneScore;\n\t if (_this.score < 0) {\n\t _this.score = 0;\n\t }\n\t _this.stoneSvga.visible = true;\n\t _this.stoneSvga.play(false, false);\n\t _this.stoneSvga.once(engine.Event.END_FRAME, function () {\n\t _this.stoneSvga.visible = false;\n\t }, _this);\n\t }\n\t else if (goods[\"npcType\"] == \"boom\") {\n\t _this.boomSvga.visible = true;\n\t _this.boomSvga.play(false, false);\n\t _this.died();\n\t _this.boomSvga.once(engine.Event.END_FRAME, function () {\n\t _this.boomSvga.visible = false;\n\t engine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t score: _this.score,\n\t reason: 2\n\t });\n\t }, _this);\n\t }\n\t engine.globalEvent.dispatchEvent('food-fell-score-update', {\n\t score: _this.score,\n\t });\n\t _this.removeNpc(goods);\n\t }\n\t }\n\t }\n\t }, this);\n\t };\n\t GameView.prototype.died = function () {\n\t this.pause();\n\t };\n\t GameView.prototype.removeNpc = function (goods) {\n\t this.NpcBg.removeChild(goods);\n\t ObjectPool$1.recycleObject(PoolName, goods);\n\t goods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t var index = this.goodsItems.indexOf(goods);\n\t if (index > -1) {\n\t this.goodsItems.splice(index, 1);\n\t }\n\t };\n\t GameView.prototype.recycleGoods = function () {\n\t clearTimeout(this.timer);\n\t clearInterval(this.countdownTimer);\n\t for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) {\n\t var goods = _a[_i];\n\t if (goods) {\n\t this.NpcBg.removeChild(goods);\n\t ObjectPool$1.recycleObject(PoolName, goods);\n\t goods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t }\n\t }\n\t this.goodsItems = [];\n\t };\n\t GameView.prototype.hasHit = function (a, b) {\n\t var playerH = a.height;\n\t var playerW = a.width;\n\t var playerX = a.x;\n\t if (props.playerHeight) {\n\t playerH = props.playerHeight;\n\t }\n\t if (props.playerWidth) {\n\t playerW = props.playerWidth;\n\t playerX = a.x + (a.width - props.playerWidth) / 2;\n\t }\n\t if (Math.abs((playerX + playerW / 2) - (b.x + b.width / 2)) < playerW / 2 + b.width / 2\n\t &&\n\t Math.abs((a.y + playerH / 1.3) - (b.y + b.height / 2)) < playerH / 2 + b.height / 2) {\n\t return true;\n\t }\n\t else {\n\t return false;\n\t }\n\t };\n\t return GameView;\n\t}(engine.Container));\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('food-fell-reset', _this.reset, _this);\n\t engine.globalEvent.addEventListener('food-fell-start', _this.start, _this);\n\t engine.globalEvent.addEventListener('food-fell-pause', _this.pause, _this);\n\t engine.globalEvent.addEventListener('food-fell-resume', _this.resume, _this);\n\t engine.globalEvent.addEventListener('food-fell-revive', _this.revive, _this);\n\t engine.globalEvent.addEventListener('food-fell-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();\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 };\n\t return GameWrapper;\n\t}(engine.Container));\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\n\treturn index;\n\n})));\n"
} }
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
this.visible = false; this.visible = false;
setTimeout(function () { setTimeout(function () {
_this.visible = true; _this.visible = true;
_this.player.x = 375 - _this.player.width / 2; _this.player.x = props.playerPositionX;
_this.player.y = props.playerPositionY; _this.player.y = props.playerPositionY;
_this.playerSvgaRun.x = props.playerRunPosition3Offset[0]; _this.playerSvgaRun.x = props.playerRunPosition3Offset[0];
_this.playerSvgaRun.y = props.playerRunPosition3Offset[1]; _this.playerSvgaRun.y = props.playerRunPosition3Offset[1];
...@@ -276,11 +276,11 @@ ...@@ -276,11 +276,11 @@
GameView.prototype.reset = function () { GameView.prototype.reset = function () {
this.recycleGoods(); this.recycleGoods();
this.score = 0; this.score = 0;
this.speed = 1; this.speed = props.speed;
this.bg.y = -1624; this.bg.y = -this.bg3.y;
this.player.anchorY = this.player.height / 2; this.player.anchorY = this.player.height / 2;
this.player.anchorX = this.player.width / 2; this.player.anchorX = this.player.width / 2;
this.player.x = 375 - this.player.width / 2; this.player.x = props.playerPositionX;
this.player.y = props.playerPositionY; this.player.y = props.playerPositionY;
this.setPlayState(this.playerSvgaReset); this.setPlayState(this.playerSvgaReset);
}; };
...@@ -332,6 +332,7 @@ ...@@ -332,6 +332,7 @@
var _this = this; var _this = this;
this.timer = setTimeout(function () { this.timer = setTimeout(function () {
if (_this.gameIng) { if (_this.gameIng) {
_this.speed += props.acceleratedSpeed;
_this.speed += props.acceleratedSpeed; _this.speed += props.acceleratedSpeed;
if (_this.speed > props.maxSpeed) { if (_this.speed > props.maxSpeed) {
_this.speed = props.maxSpeed; _this.speed = props.maxSpeed;
...@@ -368,6 +369,9 @@ ...@@ -368,6 +369,9 @@
if (goods["npcType"] == "rain0") { if (goods["npcType"] == "rain0") {
console.log("碰到雨滴"); console.log("碰到雨滴");
_this.score += props.rainScore; _this.score += props.rainScore;
if (_this.score < 0) {
_this.score = 0;
}
_this.setBoomPosition(_this.waterSvga); _this.setBoomPosition(_this.waterSvga);
engine.Tween.get(goods, null, null, true) engine.Tween.get(goods, null, null, true)
.to({ scaleX: 0, scaleY: 0 }, 200) .to({ scaleX: 0, scaleY: 0 }, 200)
...@@ -376,6 +380,9 @@ ...@@ -376,6 +380,9 @@
else if (goods["npcType"] == "rain1") { else if (goods["npcType"] == "rain1") {
console.log("碰到雨滴"); console.log("碰到雨滴");
_this.score += props.rain2Score; _this.score += props.rain2Score;
if (_this.score < 0) {
_this.score = 0;
}
_this.setBoomPosition(_this.water2Svga); _this.setBoomPosition(_this.water2Svga);
engine.Tween.get(goods, null, null, true) engine.Tween.get(goods, null, null, true)
.to({ scaleX: 0, scaleY: 0 }, 200) .to({ scaleX: 0, scaleY: 0 }, 200)
......
{"version":3,"file":"index.js","sources":["src/custom/dragon-boat-race/src/props.ts","src/custom/dragon-boat-race/src/game/utils.ts","src/custom/dragon-boat-race/src/game/Goods.ts","src/custom/dragon-boat-race/src/game/object-pool-init.ts","src/custom/dragon-boat-race/src/game/GameView.ts","src/custom/dragon-boat-race/src/game/GameWrapper.ts","src/custom/dragon-boat-race/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(getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Goods extends engine.Container {\n\tprivate _body:engine.Rect\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body\n\t\tbody = this._body =new engine.Rect()\n\t\t\n\t\t// let randomNum = Math.floor(Math.random() * 3)\t\t\n\t\t// console.log('雨滴' + randomNum);\n\t\t\n\t\tlet rain = new engine.Sprite(getTextureByName('金币'));\n\t\tlet rain1 = new engine.Sprite(getTextureByName('粽子'));\n\t\train[\"npcType\"]=\"rain0\"\n\t\train1[\"npcType\"]=\"rain1\"\n\t\tlet stone = new engine.Sprite(getTextureByName('木头'));\n\t\tstone[\"npcType\"]=\"stone\"\n\t\tlet boom = new engine.Sprite(getTextureByName('石块'));\n\t\tboom[\"npcType\"]=\"boom\"\n\n\t\train.visible=false;\n\t\train1.visible=false;\n\t\tstone.visible=false;\n\t\tboom.visible=false;\n\n\t\train.anchorX=rain.width/2\n\t\train1.anchorX=rain1.width/2\n\t\tstone.anchorX=stone.width/2\n\t\tboom.anchorX=boom.width/2\n\n\t\train.anchorY=rain.height/2\n\t\train1.anchorY=rain1.height/2\n\t\tstone.anchorY=stone.height/2\n\t\tboom.anchorY=boom.height/2\n\n\t\tbody.addChild(rain)\n\t\tbody.addChild(rain1)\n\t\tbody.addChild(stone)\n\t\tbody.addChild(boom)\n\t\t\n\t\tthis.addChild(body);\n\t\tbody.width=.0001;\n\t\tbody.height=.0001;\n\t\tbody.mouseEnabled=false;\n\t}\n\n\n\tgetRandomNumberByRange(start, end) {\n\t\treturn Math.floor(Math.random() * (end - start) + start)\n\t}\n\n\treset() {\n\t\tthis[\"lifeState\"]=true;\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tif(this.width<=0){\n\t\t\tthis.anchorX=50;\n\t\t}else{\n\t\t\tthis.anchorX=this.width/2;\n\t\t}\n\t\t\n\t\tthis.anchorY=this.height/2;\n\t\tthis.scaleX=this.scaleY=1;\n\t\tthis.y = 0;\n\t\tthis.x = ((750-props.maxNpcBound)-120)*Math.random()+30+props.maxNpcBound;\n\t\tthis.rotation = 0;\n\t\tlet random=Math.random()\n\t\tif(typeof (props.goodsProbability) == 'string'){\n\t\t\tprops.goodsProbability=props.goodsProbability.split(',').map((i: string) => +i)\n\t\t\tconsole.log(props.goodsProbability);\n\t\t}\n\t\tif(random<props.goodsProbability[0]){\n\t\t\tthis.showNpc(\"rain0\")\n\t\t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"rain1\")\n\t\t}else if(random>=(props.goodsProbability[0]+props.goodsProbability[1])&&random<=(props.goodsProbability[0]+props.goodsProbability[1]+props.goodsProbability[2])){\n\t\t\tthis.showNpc(\"stone\")\n\t\t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1]+props.goodsProbability[2])){\n\t\t\tthis.showNpc(\"boom\")\n\t\t}\n\t}\n\n\n\tshowNpc(type){\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tthis._body.children[i].visible=false;\n\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t}\t\t\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tif(this._body.children[i][\"npcType\"]==type){\n\t\t\t\tthis[\"npcType\"]=type\n\t\t\t\tthis._body.children[i].visible=true;\n\t\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t\t}\n\t\t}\n\t\t\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 {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\n\t//当前分数\n\tprivate score\n\n\t//游戏状态\n\tprivate gameIng;\n\n\t//npc出身计时器\n\tprivate timer\n\t//倒计时计时器\n\tprivate countdownTimer: any\n\t//倒计时\n\tprivate countdown: number\n\n\t//当前速度\n\tprivate speed: number\n\n\t// 当前场景上面的物品\n\tprivate goodsItems = []\n\n\n\tprivate _goods: Goods;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tprivate waterSvga\n\tprivate water2Svga\n\tprivate boomSvga\n\tprivate playerSvgaReset\n\tprivate playerSvgaRun\n\tprivate playerSvgaOver\n\tprivate bg1\n\tprivate bg2\n\tprivate bg3\n\tprivate bg4\n\tprivate bg\n\tprivate labelScore\n\t\n\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\n\t\tthis.bg = new engine.Container();\n\t\tthis.bg.mouseEnabled = false;\n\t\tthis.addChild(this.bg);\n\n\t\tthis.NpcBg = new engine.Container();\n\t\tthis.NpcBg.alpha = 1;\n\t\tthis.NpcBg.width = 0;\n\t\tthis.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg);\n\n\t\tthis.player = new engine.Container();\n\t\tthis.player.mouseEnabled=false;\n\t\tthis.player.mouseChildren=false\n\t//\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n\t\t//console.log(this.player.fillColor)\n\n\t\t//创建文字\n\t\tthis.labelScore = new engine.BitmapText();\n\t\tthis.labelScore.font = props.fontName;\n\t\tthis.labelScore.scaleX = this.labelScore.scaleY = 1;\n\t\tthis.addChild(this.labelScore);\n\t\n\t\n\n\t\tthis.waterSvga=createSvga(\"碰到金币svga\")\n\t\tthis.water2Svga=createSvga(\"碰到粽子svga\")\n\t\tthis.boomSvga=createSvga(\"碰到石头svga\")\n\t\t// this.playerSvga=createSvga(\"玩家\")\n\t\tthis.playerSvgaReset= new engine.Sprite(getTextureByName('玩家静止'))\n\t\tthis.playerSvgaRun= createSvga(\"玩家滑动\")\n\t\tthis.playerSvgaOver= createSvga(\"玩家翻船\")\n\t\tthis.bg1= new engine.Sprite(getTextureByName('循环背景1'))\n\t\tthis.bg2= new engine.Sprite(getTextureByName('循环背景2'))\n\t\tthis.bg3= new engine.Sprite(getTextureByName('循环背景1'))\n\t\tthis.bg4= new engine.Sprite(getTextureByName('循环背景2'))\n\t\tthis.player.addChild(this.playerSvgaReset);\n\t\tthis.player.addChild(this.playerSvgaRun);\n\t\tthis.player.addChild(this.playerSvgaOver);\n\t\t this.addChild(this.waterSvga);\n\t\t this.addChild(this.water2Svga);\n\t\t this.addChild(this.boomSvga);\n\t\t this.addChild(this.player);\n\t\tthis.bg.addChild(this.bg1);\n\t\tthis.bg.addChild(this.bg2);\n\t\tthis.bg.addChild(this.bg3);\n\t\tthis.bg.addChild(this.bg4);\n\t\t\n\t\t// this.playerSvga.gotoAndPlay(1);\n\n\t\tthis.waterSvga.visible = false\n\t\tthis.water2Svga.visible = false\n\t\tthis.boomSvga.visible = false\n\t\tthis.setPlayState(this.playerSvgaReset)\n\t\t\n\t\tthis.visible=false;\n\t\tsetTimeout(()=>{\n\t\t\tthis.visible=true;\n\t\t\t//this.player.anchorY = this.player.height / 2;\n\t\t//\tthis.player.anchorX = this.player.width / 2;\n\t\t\tthis.player.x = 375 - this.player.width / 2;\n\t\t\tthis.player.y = props.playerPositionY;\n\n\t\t\t// this.stoneSvga.x = this.player.width / 2 - \tthis.stoneSvga.width/2 + props.boomPosition1Offset[0];\n\t\t\t// this.stoneSvga.y = this.player.height / 2 - this.stoneSvga.height/2 + props.boomPosition1Offset[1];\n\n\t\t\t// this.waterSvga.x = this.player.width / 2 - \tthis.waterSvga.width/2+ props.boomPosition2Offset[0];\n\t\t\t// this.waterSvga.y = this.player.height / 2 - this.waterSvga.height/2 + props.boomPosition2Offset[1];\n\n\t\t\t// this.boomSvga.x = this.player.width / 2 - \tthis.boomSvga.width/2+ props.boomPosition3Offset[0];\n\t\t\t// this.boomSvga.y = this.player.height / 2 - this.boomSvga.height/2 + props.boomPosition3Offset[1];\n\n\n\t\t\tthis.playerSvgaRun.x=props.playerRunPosition3Offset[0]\n\t\t\tthis.playerSvgaRun.y=props.playerRunPosition3Offset[1]\n\n\t\t\tthis.playerSvgaOver.x=props.playerOverPosition3Offset[0]\n\t\t\tthis.playerSvgaOver.y=props.playerOverPosition3Offset[1]\n\n\t\t\tthis.bg1.y=0\n\t\t\tthis.bg2.y=this.bg1.height\n\t\t\tthis.bg3.y=this.bg1.height+this.bg2.height\n\t\t\tthis.bg4.y=this.bg1.height+this.bg2.height+this.bg3.height\n\n\t\t\tengine.Tween.get(this.playerSvgaReset, {loop:true})\n\t\t\t.to({y:10}, 500)\n\t\t\t.to({y:0}, 500)\n\t\t\t.to({y:10}, 500)\n\t\t\t.call(()=>{});\n\n\t\t\t// this.stoneSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.stoneSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.waterSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.waterSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.boomSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.boomSvga.y=props.boomPositionOffset[1]\n\n\t\t\t\n\t\t},300)\n\n\t\t\n\t\tthis.rectBg = new engine.Container();\n\t\tthis.rectBg.alpha = 0;\n\t\tthis.rectBg.width = 750;\n\t\tthis.rectBg.height = 1624;\n\t\tthis.addChild(this.rectBg)\n\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\t\tthis.rectBg.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame, this);\n\t\n\t}\n\n\n\tsetBoomPosition(svga,callback?){\n\t\tsvga.x=this.player.x;\n\t\tsvga.y=this.player.y;\n\t\tif(svga==this.waterSvga){\n\t\t\tsvga.x+=props.boomPosition1Offset[0]\n\t\t\tsvga.y+=props.boomPosition1Offset[1]\n\t\t}else if(svga==this.water2Svga){\n\t\t\tsvga.x+=props.boomPosition2Offset[0]\n\t\t\tsvga.y+=props.boomPosition2Offset[1]\n\t\t}else if(svga==this.boomSvga){\n\t\t\tsvga.x+=props.boomPosition3Offset[0]\n\t\t\tsvga.y+=props.boomPosition3Offset[1]\n\t\t} \n\n\t\tsvga.visible=true;\n\t\tsvga.play(true,false)\n\t\tsvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\tsvga.visible=false;\n\t\t\tif(callback){\n\t\t\t\tcallback()\n\t\t\t}\t\t\n\t\t}, this);\n\n\t}\n\n\tenterFrame(){\n\t\tif(this.bg.y>=0){\n\t\t\tthis.bg.y=-this.bg3.y\n\t\t}\n\t\tif(this.gameIng){\n\t\t\tthis.bg.y += (4 * this.speed)\n\t\t}\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tthis.recycleGoods()\n\t\tthis.score = 0;\n\t\tthis.speed = 1;\n\t\tthis.bg.y=-1624\n\n\t\tthis.player.anchorY = this.player.height / 2;\n\t\tthis.player.anchorX = this.player.width / 2;\n\t\tthis.player.x = 375 - this.player.width / 2;\n\t\tthis.player.y = props.playerPositionY;\n\t\tthis.setPlayState(this.playerSvgaReset)\n\t}\n\n\n\tsetPlayState(svga){\n\t\tthis.playerSvgaReset.visible=false\n\t\tthis.playerSvgaRun.visible=false\n\t\tthis.playerSvgaOver.visible=false\n\t\tconsole.log(svga)\n\t\tsvga.visible=true;\n if(svga==this.playerSvgaOver){\n\t\t\tsvga.play(false, false)\n\t\t\tsvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t}, this);\n\t\t}else if(svga==this.playerSvgaRun){\n\t\t\tsvga.play()\n\t\t}\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.gameIng = true;\n\t\tthis.creatNpc()\n\t\tthis.beginNpc()\n\t\tthis.countdown = props.countDown;\n\t\tthis.setPlayState(this.playerSvgaRun)\n\t\n\t\tthis.countdownTimer = setInterval(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tif (this.countdown > 0) {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-time-update', {\n\t\t\t\t\t\ttime: this.countdown,\n\t\t\t\t\t});\n\t\t\t\t\tthis.countdown -= 1\n\t\t\t\t} else {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-game-over', {\n\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\treason: 1\n\t\t\t\t\t});\n\t\t\t\t\tthis.died()\n\t\t\t\t}\n\t\t\t\tthis.score += Math.round(this.speed*props.runScore);\n\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-score-update', {\n\t\t\t\t\tscore: this.score,\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000)\n\t}\n\n\t/**\n\t * npc开始掉落\n\t */\n\tbeginNpc() {\n\t\tthis.timer = setTimeout(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\t\tif(this.speed>props.maxSpeed){\n\t\t\t\t\tthis.speed=props.maxSpeed\n\t\t\t\t}\n\t\t\t\tthis.creatNpc()\n\t\t\t}\n\t\t\t//递归执行\n\t\t\tthis.beginNpc()\n\t\t}, 2000 / this.speed)\n\t}\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\tthis.gameIng = false;\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t\tthis.gameIng = true;\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\tthis.reset()\n\t\tthis.start()\n\t}\n\n\t/**\n\t * 创建NPC\n\t */\n\tprivate creatNpc() {\n\t\tlet goods = this._goods = <Goods>ObjectPool.getObject(PoolName);\n\t\tthis.goodsItems.push(goods)\n\t\t//console.log(goods);\n\t\t\n\t\tthis.NpcBg.addChild(goods);\n\t\tgoods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = () => {\n\t\t\tif (goods.y > 1624) {\n\t\t\t\tthis.removeNpc(goods)\n\t\t\t} else {\n\t\t\t\tif (this.gameIng) {\n\t\t\t\t\t//速度叠加\n\t\t\t\t\tgoods.y += (4 * this.speed)\n\t\t\t\t\t//如果玩家和物品发生碰撞\n\t\t\t\t\tif (goods[\"lifeState\"]&&this.hasHit(this.player, goods)) {\n\t\t\t\t\t\tgoods[\"lifeState\"]=false;\n\t\t\t\t\t\tif (goods[\"npcType\"] == \"rain0\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rainScore\n\t\t\t\t\t\t\tthis.setBoomPosition(this.waterSvga)\n\t\t\t\t\t\t\t engine.Tween.get(goods, null, null, true)\n\t\t\t\t\t\t\t .to({scaleX: 0,scaleY:0}, 200)\n\t\t\t\t\t\t\t .call(()=>{this.removeNpc(goods)});\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t}else if (goods[\"npcType\"] == \"rain1\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rain2Score\n\t\t\t\t\t\t\tthis.setBoomPosition(this.water2Svga)\n\t\t\t\t\t\t\t engine.Tween.get(goods, null, null, true)\n\t\t\t\t\t\t\t .to({scaleX: 0,scaleY:0}, 200)\n\t\t\t\t\t\t\t .call(()=>{this.removeNpc(goods)});\n\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"boom\"||goods[\"npcType\"] == \"stone\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到炸弹\")\n\t\t\t\t\t\t\tthis.setBoomPosition(this.boomSvga,()=>{\n\t\t\t\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-game-over', {\n\t\t\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t\t\t\treason: 2\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tthis.died()\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tthis.setPlayState(this.playerSvgaOver)\n\t\t\t\t\t\t\tthis.pause()\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-score-update', {\n\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, this);\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.score = 0\n\t\tthis.pause()\n\t}\n\n\t/**\n\t * 回收指定物品\n\t * @param goods 物品\n\t */\n\tprivate removeNpc(goods) {\n\t\tthis.NpcBg.removeChild(goods);\n\t\tObjectPool.recycleObject(PoolName, goods);\n\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\tlet index = this.goodsItems.indexOf(goods);\n\t\tif (index > -1) {\n\t\t\tthis.goodsItems.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * 回收对象\n\t */\n\tprivate recycleGoods() {\n\t\tclearTimeout(this.timer)\n\t\tclearInterval(this.countdownTimer)\n\t\tfor (let goods of this.goodsItems) {\n\t\t\tif (goods) {\n\t\t\t\tthis.NpcBg.removeChild(goods);\n\t\t\t\tObjectPool.recycleObject(PoolName, goods);\n\t\t\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\t\t}\n\t\t}\n\t\tthis.goodsItems = []\n\t}\n\n\tprivate moveCatchX = 0\n\tprivate playerCatchX = 0\n\n\t/**\n\t * 碰撞检测\n\t * @param a a盒子\n\t * @param b b盒子\n\t */\n\tprivate hasHit(a, b) {\n\n\t\tlet playerH=a.height\n\t\tlet playerW=a.width\n\t\tlet playerX=a.x\n\t\tif(props.playerHeight){\n\t\t\tplayerH=props.playerHeight\n\t\t}\n\t\tif(props.playerWidth){\n\t\t\tplayerW=props.playerWidth\n\t\t\tplayerX=a.x+(a.width-props.playerWidth)/2\n\t\t}\n\n\t\tif (\n\t\t\tMath.abs((playerX + playerW / 2) - (b.x + b.width / 2)) < playerW / 2 + b.width / 2\n\t\t\t&&\n\t\t\t// Math.abs((a.y + a.height / 2 ) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2\n\t\t\tMath.abs((a.y + playerH / 1.3 ) - (b.y + b.height / 2)) < playerH / 2 + b.height / 2\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate onDownStage = (e) => {\n\t\tthis.moveCatchX = e.localX;\n\t\tthis.playerCatchX = this.player.x\n\t}\n\n\tprivate onMoveStage = (e) => {\n\t\tlet maxStageBound=props.maxStageBound;\n\t\tif (this.gameIng) {\n\t\t\tlet playerX=this.playerCatchX + (e.localX - this.moveCatchX)\n\t\t\tif(playerX<maxStageBound){\n\t\t\t\tthis.player.x=maxStageBound\n\t\t\t}else if(playerX+this.player.width+maxStageBound>750){\n\t\t\t\tthis.player.x=750-maxStageBound-this.player.width\n\t\t\t}else{\n\t\t\t\tthis.player.x=playerX\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onOutStage = (e) => {\n\t\tthis.moveCatchX = 0\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-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\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\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,CAA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AAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CApDgC,MAAM,CAAC,SAAS,GAoDhD;;;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;;;;;;;;;"} {"version":3,"file":"index.js","sources":["src/custom/dragon-boat-race/src/props.ts","src/custom/dragon-boat-race/src/game/utils.ts","src/custom/dragon-boat-race/src/game/Goods.ts","src/custom/dragon-boat-race/src/game/object-pool-init.ts","src/custom/dragon-boat-race/src/game/GameView.ts","src/custom/dragon-boat-race/src/game/GameWrapper.ts","src/custom/dragon-boat-race/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(getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Goods extends engine.Container {\n\tprivate _body:engine.Rect\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body\n\t\tbody = this._body =new engine.Rect()\n\t\t\n\t\t// let randomNum = Math.floor(Math.random() * 3)\t\t\n\t\t// console.log('雨滴' + randomNum);\n\t\t\n\t\tlet rain = new engine.Sprite(getTextureByName('金币'));\n\t\tlet rain1 = new engine.Sprite(getTextureByName('粽子'));\n\t\train[\"npcType\"]=\"rain0\"\n\t\train1[\"npcType\"]=\"rain1\"\n\t\tlet stone = new engine.Sprite(getTextureByName('木头'));\n\t\tstone[\"npcType\"]=\"stone\"\n\t\tlet boom = new engine.Sprite(getTextureByName('石块'));\n\t\tboom[\"npcType\"]=\"boom\"\n\n\t\train.visible=false;\n\t\train1.visible=false;\n\t\tstone.visible=false;\n\t\tboom.visible=false;\n\n\t\train.anchorX=rain.width/2\n\t\train1.anchorX=rain1.width/2\n\t\tstone.anchorX=stone.width/2\n\t\tboom.anchorX=boom.width/2\n\n\t\train.anchorY=rain.height/2\n\t\train1.anchorY=rain1.height/2\n\t\tstone.anchorY=stone.height/2\n\t\tboom.anchorY=boom.height/2\n\n\t\tbody.addChild(rain)\n\t\tbody.addChild(rain1)\n\t\tbody.addChild(stone)\n\t\tbody.addChild(boom)\n\t\t\n\t\tthis.addChild(body);\n\t\tbody.width=.0001;\n\t\tbody.height=.0001;\n\t\tbody.mouseEnabled=false;\n\t}\n\n\n\tgetRandomNumberByRange(start, end) {\n\t\treturn Math.floor(Math.random() * (end - start) + start)\n\t}\n\n\treset() {\n\t\tthis[\"lifeState\"]=true;\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tif(this.width<=0){\n\t\t\tthis.anchorX=50;\n\t\t}else{\n\t\t\tthis.anchorX=this.width/2;\n\t\t}\n\t\t\n\t\tthis.anchorY=this.height/2;\n\t\tthis.scaleX=this.scaleY=1;\n\t\tthis.y = 0;\n\t\tthis.x = ((750-props.maxNpcBound)-120)*Math.random()+30+props.maxNpcBound;\n\t\tthis.rotation = 0;\n\t\tlet random=Math.random()\n\t\tif(typeof (props.goodsProbability) == 'string'){\n\t\t\tprops.goodsProbability=props.goodsProbability.split(',').map((i: string) => +i)\n\t\t\tconsole.log(props.goodsProbability);\n\t\t}\n\t\tif(random<props.goodsProbability[0]){\n\t\t\tthis.showNpc(\"rain0\")\n\t\t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"rain1\")\n\t\t}else if(random>=(props.goodsProbability[0]+props.goodsProbability[1])&&random<=(props.goodsProbability[0]+props.goodsProbability[1]+props.goodsProbability[2])){\n\t\t\tthis.showNpc(\"stone\")\n\t\t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1]+props.goodsProbability[2])){\n\t\t\tthis.showNpc(\"boom\")\n\t\t}\n\t}\n\n\n\tshowNpc(type){\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tthis._body.children[i].visible=false;\n\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t}\t\t\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tif(this._body.children[i][\"npcType\"]==type){\n\t\t\t\tthis[\"npcType\"]=type\n\t\t\t\tthis._body.children[i].visible=true;\n\t\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t\t}\n\t\t}\n\t\t\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 {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\n\t//当前分数\n\tprivate score\n\n\t//游戏状态\n\tprivate gameIng;\n\n\t//npc出身计时器\n\tprivate timer\n\t//倒计时计时器\n\tprivate countdownTimer: any\n\t//倒计时\n\tprivate countdown: number\n\n\t//当前速度\n\tprivate speed: number\n\n\t// 当前场景上面的物品\n\tprivate goodsItems = []\n\n\n\tprivate _goods: Goods;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tprivate waterSvga\n\tprivate water2Svga\n\tprivate boomSvga\n\tprivate playerSvgaReset\n\tprivate playerSvgaRun\n\tprivate playerSvgaOver\n\tprivate bg1\n\tprivate bg2\n\tprivate bg3\n\tprivate bg4\n\tprivate bg\n\tprivate labelScore\n\t\n\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\n\t\tthis.bg = new engine.Container();\n\t\tthis.bg.mouseEnabled = false;\n\t\tthis.addChild(this.bg);\n\n\t\tthis.NpcBg = new engine.Container();\n\t\tthis.NpcBg.alpha = 1;\n\t\tthis.NpcBg.width = 0;\n\t\tthis.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg);\n\n\t\tthis.player = new engine.Container();\n\t\tthis.player.mouseEnabled=false;\n\t\tthis.player.mouseChildren=false\n\t//\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n\t\t//console.log(this.player.fillColor)\n\n\t\t//创建文字\n\t\tthis.labelScore = new engine.BitmapText();\n\t\tthis.labelScore.font = props.fontName;\n\t\tthis.labelScore.scaleX = this.labelScore.scaleY = 1;\n\t\tthis.addChild(this.labelScore);\n\t\n\t\n\n\t\tthis.waterSvga=createSvga(\"碰到金币svga\")\n\t\tthis.water2Svga=createSvga(\"碰到粽子svga\")\n\t\tthis.boomSvga=createSvga(\"碰到石头svga\")\n\t\t// this.playerSvga=createSvga(\"玩家\")\n\t\tthis.playerSvgaReset= new engine.Sprite(getTextureByName('玩家静止'))\n\t\tthis.playerSvgaRun= createSvga(\"玩家滑动\")\n\t\tthis.playerSvgaOver= createSvga(\"玩家翻船\")\n\t\tthis.bg1= new engine.Sprite(getTextureByName('循环背景1'))\n\t\tthis.bg2= new engine.Sprite(getTextureByName('循环背景2'))\n\t\tthis.bg3= new engine.Sprite(getTextureByName('循环背景1'))\n\t\tthis.bg4= new engine.Sprite(getTextureByName('循环背景2'))\n\t\tthis.player.addChild(this.playerSvgaReset);\n\t\tthis.player.addChild(this.playerSvgaRun);\n\t\tthis.player.addChild(this.playerSvgaOver);\n\t\t this.addChild(this.waterSvga);\n\t\t this.addChild(this.water2Svga);\n\t\t this.addChild(this.boomSvga);\n\t\t this.addChild(this.player);\n\t\tthis.bg.addChild(this.bg1);\n\t\tthis.bg.addChild(this.bg2);\n\t\tthis.bg.addChild(this.bg3);\n\t\tthis.bg.addChild(this.bg4);\n\t\t\n\t\t// this.playerSvga.gotoAndPlay(1);\n\n\t\tthis.waterSvga.visible = false\n\t\tthis.water2Svga.visible = false\n\t\tthis.boomSvga.visible = false\n\t\tthis.setPlayState(this.playerSvgaReset)\n\t\t\n\t\tthis.visible=false;\n\t\tsetTimeout(()=>{\n\t\t\tthis.visible=true;\n\t\t\t//this.player.anchorY = this.player.height / 2;\n\t\t//\tthis.player.anchorX = this.player.width / 2;\n\t\t\tthis.player.x = props.playerPositionX;\n\t\t\tthis.player.y = props.playerPositionY;\n\n\t\t\t// this.stoneSvga.x = this.player.width / 2 - \tthis.stoneSvga.width/2 + props.boomPosition1Offset[0];\n\t\t\t// this.stoneSvga.y = this.player.height / 2 - this.stoneSvga.height/2 + props.boomPosition1Offset[1];\n\n\t\t\t// this.waterSvga.x = this.player.width / 2 - \tthis.waterSvga.width/2+ props.boomPosition2Offset[0];\n\t\t\t// this.waterSvga.y = this.player.height / 2 - this.waterSvga.height/2 + props.boomPosition2Offset[1];\n\n\t\t\t// this.boomSvga.x = this.player.width / 2 - \tthis.boomSvga.width/2+ props.boomPosition3Offset[0];\n\t\t\t// this.boomSvga.y = this.player.height / 2 - this.boomSvga.height/2 + props.boomPosition3Offset[1];\n\n\n\t\t\tthis.playerSvgaRun.x=props.playerRunPosition3Offset[0]\n\t\t\tthis.playerSvgaRun.y=props.playerRunPosition3Offset[1]\n\n\t\t\tthis.playerSvgaOver.x=props.playerOverPosition3Offset[0]\n\t\t\tthis.playerSvgaOver.y=props.playerOverPosition3Offset[1]\n\n\t\t\tthis.bg1.y=0\n\t\t\tthis.bg2.y=this.bg1.height\n\t\t\tthis.bg3.y=this.bg1.height+this.bg2.height\n\t\t\tthis.bg4.y=this.bg1.height+this.bg2.height+this.bg3.height\n\n\t\t\tengine.Tween.get(this.playerSvgaReset, {loop:true})\n\t\t\t.to({y:10}, 500)\n\t\t\t.to({y:0}, 500)\n\t\t\t.to({y:10}, 500)\n\t\t\t.call(()=>{});\n\n\t\t\t// this.stoneSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.stoneSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.waterSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.waterSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.boomSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.boomSvga.y=props.boomPositionOffset[1]\n\n\t\t\t\n\t\t},300)\n\n\t\t\n\t\tthis.rectBg = new engine.Container();\n\t\tthis.rectBg.alpha = 0;\n\t\tthis.rectBg.width = 750;\n\t\tthis.rectBg.height = 1624;\n\t\tthis.addChild(this.rectBg)\n\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\t\tthis.rectBg.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame, this);\n\t\n\t}\n\n\n\tsetBoomPosition(svga,callback?){\n\t\tsvga.x=this.player.x;\n\t\tsvga.y=this.player.y;\n\t\tif(svga==this.waterSvga){\n\t\t\tsvga.x+=props.boomPosition1Offset[0]\n\t\t\tsvga.y+=props.boomPosition1Offset[1]\n\t\t}else if(svga==this.water2Svga){\n\t\t\tsvga.x+=props.boomPosition2Offset[0]\n\t\t\tsvga.y+=props.boomPosition2Offset[1]\n\t\t}else if(svga==this.boomSvga){\n\t\t\tsvga.x+=props.boomPosition3Offset[0]\n\t\t\tsvga.y+=props.boomPosition3Offset[1]\n\t\t} \n\n\t\tsvga.visible=true;\n\t\tsvga.play(true,false)\n\t\tsvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\tsvga.visible=false;\n\t\t\tif(callback){\n\t\t\t\tcallback()\n\t\t\t}\t\t\n\t\t}, this);\n\n\t}\n\n\tenterFrame(){\n\t\tif(this.bg.y>=0){\n\t\t\tthis.bg.y=-this.bg3.y\n\t\t}\n\t\tif(this.gameIng){\n\t\t\tthis.bg.y += (4 * this.speed)\n\t\t}\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tthis.recycleGoods()\n\t\tthis.score = 0;\n\t\tthis.speed = props.speed;\n\t\tthis.bg.y=-this.bg3.y\n\n\t\tthis.player.anchorY = this.player.height / 2;\n\t\tthis.player.anchorX = this.player.width / 2;\n\t\tthis.player.x = props.playerPositionX;\n\t\tthis.player.y = props.playerPositionY;\n\t\tthis.setPlayState(this.playerSvgaReset)\n\t}\n\n\n\tsetPlayState(svga){\n\t\tthis.playerSvgaReset.visible=false\n\t\tthis.playerSvgaRun.visible=false\n\t\tthis.playerSvgaOver.visible=false\n\t\tconsole.log(svga)\n\t\tsvga.visible=true;\n if(svga==this.playerSvgaOver){\n\t\t\tsvga.play(false, false)\n\t\t\tsvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t}, this);\n\t\t}else if(svga==this.playerSvgaRun){\n\t\t\tsvga.play()\n\t\t}\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.gameIng = true;\n\t\tthis.creatNpc()\n\t\tthis.beginNpc()\n\t\tthis.countdown = props.countDown;\n\t\tthis.setPlayState(this.playerSvgaRun)\n\t\n\t\tthis.countdownTimer = setInterval(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tif (this.countdown > 0) {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-time-update', {\n\t\t\t\t\t\ttime: this.countdown,\n\t\t\t\t\t});\n\t\t\t\t\tthis.countdown -= 1\n\t\t\t\t} else {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-game-over', {\n\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\treason: 1\n\t\t\t\t\t});\n\t\t\t\t\tthis.died()\n\t\t\t\t}\n\t\t\t\tthis.score += Math.round(this.speed*props.runScore);\n\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-score-update', {\n\t\t\t\t\tscore: this.score,\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000)\n\t}\n\n\t/**\n\t * npc开始掉落\n\t */\n\tbeginNpc() {\n\t\tthis.timer = setTimeout(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\t\tif(this.speed>props.maxSpeed){\n\t\t\t\t\tthis.speed=props.maxSpeed\n\t\t\t\t}\n\t\t\t\tthis.creatNpc()\n\t\t\t}\n\t\t\t//递归执行\n\t\t\tthis.beginNpc()\n\t\t}, 2000 / this.speed)\n\t}\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\tthis.gameIng = false;\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t\tthis.gameIng = true;\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\tthis.reset()\n\t\tthis.start()\n\t}\n\n\t/**\n\t * 创建NPC\n\t */\n\tprivate creatNpc() {\n\t\tlet goods = this._goods = <Goods>ObjectPool.getObject(PoolName);\n\t\tthis.goodsItems.push(goods)\n\t\t//console.log(goods);\n\t\t\n\t\tthis.NpcBg.addChild(goods);\n\t\tgoods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = () => {\n\t\t\tif (goods.y > 1624) {\n\t\t\t\tthis.removeNpc(goods)\n\t\t\t} else {\n\t\t\t\tif (this.gameIng) {\n\t\t\t\t\t//速度叠加\n\t\t\t\t\tgoods.y += (4 * this.speed)\n\t\t\t\t\t//如果玩家和物品发生碰撞\n\t\t\t\t\tif (goods[\"lifeState\"]&&this.hasHit(this.player, goods)) {\n\t\t\t\t\t\tgoods[\"lifeState\"]=false;\n\t\t\t\t\t\tif (goods[\"npcType\"] == \"rain0\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rainScore\n\t\t\t\t\t\t\tif(this.score<0){\n\t\t\t\t\t\t\t\tthis.score=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.setBoomPosition(this.waterSvga)\n\t\t\t\t\t\t\t engine.Tween.get(goods, null, null, true)\n\t\t\t\t\t\t\t .to({scaleX: 0,scaleY:0}, 200)\n\t\t\t\t\t\t\t .call(()=>{this.removeNpc(goods)});\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t}else if (goods[\"npcType\"] == \"rain1\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rain2Score\n\t\t\t\t\t\t\tif(this.score<0){\n\t\t\t\t\t\t\t\tthis.score=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.setBoomPosition(this.water2Svga)\n\t\t\t\t\t\t\t engine.Tween.get(goods, null, null, true)\n\t\t\t\t\t\t\t .to({scaleX: 0,scaleY:0}, 200)\n\t\t\t\t\t\t\t .call(()=>{this.removeNpc(goods)});\n\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"boom\"||goods[\"npcType\"] == \"stone\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到炸弹\")\n\t\t\t\t\t\t\tthis.setBoomPosition(this.boomSvga,()=>{\n\t\t\t\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-game-over', {\n\t\t\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t\t\t\treason: 2\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tthis.died()\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tthis.setPlayState(this.playerSvgaOver)\n\t\t\t\t\t\t\tthis.pause()\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.globalEvent.dispatchEvent('dragon-boat-race-score-update', {\n\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, this);\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.score = 0\n\t\tthis.pause()\n\t}\n\n\t/**\n\t * 回收指定物品\n\t * @param goods 物品\n\t */\n\tprivate removeNpc(goods) {\n\t\tthis.NpcBg.removeChild(goods);\n\t\tObjectPool.recycleObject(PoolName, goods);\n\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\tlet index = this.goodsItems.indexOf(goods);\n\t\tif (index > -1) {\n\t\t\tthis.goodsItems.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * 回收对象\n\t */\n\tprivate recycleGoods() {\n\t\tclearTimeout(this.timer)\n\t\tclearInterval(this.countdownTimer)\n\t\tfor (let goods of this.goodsItems) {\n\t\t\tif (goods) {\n\t\t\t\tthis.NpcBg.removeChild(goods);\n\t\t\t\tObjectPool.recycleObject(PoolName, goods);\n\t\t\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\t\t}\n\t\t}\n\t\tthis.goodsItems = []\n\t}\n\n\tprivate moveCatchX = 0\n\tprivate playerCatchX = 0\n\n\t/**\n\t * 碰撞检测\n\t * @param a a盒子\n\t * @param b b盒子\n\t */\n\tprivate hasHit(a, b) {\n\n\t\tlet playerH=a.height\n\t\tlet playerW=a.width\n\t\tlet playerX=a.x\n\t\tif(props.playerHeight){\n\t\t\tplayerH=props.playerHeight\n\t\t}\n\t\tif(props.playerWidth){\n\t\t\tplayerW=props.playerWidth\n\t\t\tplayerX=a.x+(a.width-props.playerWidth)/2\n\t\t}\n\n\t\tif (\n\t\t\tMath.abs((playerX + playerW / 2) - (b.x + b.width / 2)) < playerW / 2 + b.width / 2\n\t\t\t&&\n\t\t\t// Math.abs((a.y + a.height / 2 ) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2\n\t\t\tMath.abs((a.y + playerH / 1.3 ) - (b.y + b.height / 2)) < playerH / 2 + b.height / 2\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate onDownStage = (e) => {\n\t\tthis.moveCatchX = e.localX;\n\t\tthis.playerCatchX = this.player.x\n\t}\n\n\tprivate onMoveStage = (e) => {\n\t\tlet maxStageBound=props.maxStageBound;\n\t\tif (this.gameIng) {\n\t\t\tlet playerX=this.playerCatchX + (e.localX - this.moveCatchX)\n\t\t\tif(playerX<maxStageBound){\n\t\t\t\tthis.player.x=maxStageBound\n\t\t\t}else if(playerX+this.player.width+maxStageBound>750){\n\t\t\t\tthis.player.x=750-maxStageBound-this.player.width\n\t\t\t}else{\n\t\t\t\tthis.player.x=playerX\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onOutStage = (e) => {\n\t\tthis.moveCatchX = 0\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('dragon-boat-race-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\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\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","ObjectP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AK,CAAC,IAAI,CAAC,CAAC;SACxB,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;SAC9B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;SACjB,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;MAElB;KACF,kBAAC;CAAD,CAAC,CApDgC,MAAM,CAAC,SAAS,GAoDhD;;;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 \ No newline at end of file
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
"type": "number", "type": "number",
"default": 900 "default": 900
}, },
"playerPositionX": {
"alias": "玩家Y轴位置",
"type": "number",
"default": 300
},
"runScore": { "runScore": {
"alias": "每前进1米加分(不能小于1)", "alias": "每前进1米加分(不能小于1)",
"type": "number", "type": "number",
......
...@@ -130,7 +130,7 @@ export default class GameView extends engine.Container { ...@@ -130,7 +130,7 @@ export default class GameView extends engine.Container {
this.visible=true; this.visible=true;
//this.player.anchorY = this.player.height / 2; //this.player.anchorY = this.player.height / 2;
// this.player.anchorX = this.player.width / 2; // this.player.anchorX = this.player.width / 2;
this.player.x = 375 - this.player.width / 2; this.player.x = props.playerPositionX;
this.player.y = props.playerPositionY; this.player.y = props.playerPositionY;
// this.stoneSvga.x = this.player.width / 2 - this.stoneSvga.width/2 + props.boomPosition1Offset[0]; // this.stoneSvga.x = this.player.width / 2 - this.stoneSvga.width/2 + props.boomPosition1Offset[0];
...@@ -228,12 +228,12 @@ export default class GameView extends engine.Container { ...@@ -228,12 +228,12 @@ export default class GameView extends engine.Container {
reset() { reset() {
this.recycleGoods() this.recycleGoods()
this.score = 0; this.score = 0;
this.speed = 1; this.speed = props.speed;
this.bg.y=-1624 this.bg.y=-this.bg3.y
this.player.anchorY = this.player.height / 2; this.player.anchorY = this.player.height / 2;
this.player.anchorX = this.player.width / 2; this.player.anchorX = this.player.width / 2;
this.player.x = 375 - this.player.width / 2; this.player.x = props.playerPositionX;
this.player.y = props.playerPositionY; this.player.y = props.playerPositionY;
this.setPlayState(this.playerSvgaReset) this.setPlayState(this.playerSvgaReset)
} }
...@@ -292,6 +292,7 @@ export default class GameView extends engine.Container { ...@@ -292,6 +292,7 @@ export default class GameView extends engine.Container {
beginNpc() { beginNpc() {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
if (this.gameIng) { if (this.gameIng) {
this.speed += props.acceleratedSpeed;
this.speed += props.acceleratedSpeed; this.speed += props.acceleratedSpeed;
if(this.speed>props.maxSpeed){ if(this.speed>props.maxSpeed){
this.speed=props.maxSpeed this.speed=props.maxSpeed
......
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
var random = Math.random(); var random = Math.random();
if (typeof (props.goodsProbability) == 'string') { if (typeof (props.goodsProbability) == 'string') {
props.goodsProbability = props.goodsProbability.split(',').map(function (i) { return +i; }); props.goodsProbability = props.goodsProbability.split(',').map(function (i) { return +i; });
console.log(props.goodsProbability);
} }
if (random < props.goodsProbability[0]) { if (random < props.goodsProbability[0]) {
var randomNum = Math.floor(Math.random() * 3); var randomNum = Math.floor(Math.random() * 3);
...@@ -117,6 +116,9 @@ ...@@ -117,6 +116,9 @@
function GameView() { function GameView() {
var _this = _super.call(this) || this; var _this = _super.call(this) || this;
_this.goodsItems = []; _this.goodsItems = [];
_this.viewVisible = true;
_this.cacheTime = 0;
_this.cacheTime2 = 0;
_this.moveCatchX = 0; _this.moveCatchX = 0;
_this.playerCatchX = 0; _this.playerCatchX = 0;
_this.onDownStage = function (e) { _this.onDownStage = function (e) {
...@@ -191,47 +193,71 @@ ...@@ -191,47 +193,71 @@
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this); this.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this); this.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this); this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);
document.addEventListener("visibilitychange", function () {
if (document.visibilityState == "visible") {
_this.viewVisible = true;
}
if (document.visibilityState == "hidden") {
_this.viewVisible = false;
}
});
this.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame, this);
};
GameView.prototype.enterFrame = function () {
this.updateTime();
this.updateTimeBeginNpc();
}; };
GameView.prototype.reset = function () { GameView.prototype.reset = function () {
this.score = 0; this.score = props.speed;
this.recycleGoods(); this.recycleGoods();
this.player.x = 375 - this.player.width / 2; this.player.x = 375 - this.player.width / 2;
}; };
GameView.prototype.start = function () { GameView.prototype.start = function () {
var _this = this;
this.score = 0; this.score = 0;
this.speed = 1; this.speed = 1;
this.gameIng = true; this.gameIng = true;
this.creatNpc();
this.beginNpc(); this.beginNpc();
this.countdown = props.countDown; this.countdown = props.countDown;
this.countdownTimer = setInterval(function () { };
if (_this.gameIng) { GameView.prototype.updateTime = function () {
if (_this.countdown > 0) { if (Date.now() - this.cacheTime > 1000) {
this.cacheTime = Date.now();
}
else {
return;
}
if (this.gameIng) {
if (this.countdown > 0) {
engine.globalEvent.dispatchEvent('food-fell-time-update', { engine.globalEvent.dispatchEvent('food-fell-time-update', {
time: _this.countdown, time: this.countdown,
}); });
_this.countdown -= 1; this.countdown -= 1;
} }
else { else {
engine.globalEvent.dispatchEvent('food-fell-game-over', { engine.globalEvent.dispatchEvent('food-fell-game-over', {
score: _this.score, score: this.score,
reason: 1 reason: 1
}); });
_this.died(); this.died();
} }
} }
}, 1000);
}; };
GameView.prototype.beginNpc = function () { GameView.prototype.beginNpc = function () {
var _this = this; };
this.timer = setTimeout(function () { GameView.prototype.updateTimeBeginNpc = function () {
if (_this.gameIng) { if (Date.now() - this.cacheTime2 > (2000 / this.speed)) {
_this.speed += props.acceleratedSpeed; this.cacheTime2 = Date.now();
_this.creatNpc(); }
else {
return;
}
if (this.gameIng) {
this.speed += props.acceleratedSpeed;
if (this.speed >= props.maxSpeed) {
this.speed = props.maxSpeed;
}
this.creatNpc();
} }
_this.beginNpc();
}, 2000 / this.speed);
}; };
GameView.prototype.pause = function () { GameView.prototype.pause = function () {
this.gameIng = false; this.gameIng = false;
...@@ -247,7 +273,6 @@ ...@@ -247,7 +273,6 @@
var _this = this; var _this = this;
var goods = this._goods = ObjectPool$1.getObject(PoolName); var goods = this._goods = ObjectPool$1.getObject(PoolName);
this.goodsItems.push(goods); this.goodsItems.push(goods);
console.log(goods);
this.NpcBg.addChild(goods); this.NpcBg.addChild(goods);
goods.addEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"] = function () { goods.addEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"] = function () {
if (goods.y > 1624) { if (goods.y > 1624) {
...@@ -258,7 +283,6 @@ ...@@ -258,7 +283,6 @@
goods.y += (4 * _this.speed); goods.y += (4 * _this.speed);
if (_this.hasHit(_this.player, goods)) { if (_this.hasHit(_this.player, goods)) {
if (goods["npcType"].indexOf("rain") > -1) { if (goods["npcType"].indexOf("rain") > -1) {
console.log("碰到雨滴");
_this.score += props.rainScore; _this.score += props.rainScore;
_this.waterSvga.visible = true; _this.waterSvga.visible = true;
_this.waterSvga.play(false, false); _this.waterSvga.play(false, false);
...@@ -270,7 +294,6 @@ ...@@ -270,7 +294,6 @@
} }
} }
else if (goods["npcType"] == "stone") { else if (goods["npcType"] == "stone") {
console.log("碰到石头");
_this.score += props.stoneScore; _this.score += props.stoneScore;
if (_this.score < 0) { if (_this.score < 0) {
_this.score = 0; _this.score = 0;
...@@ -282,7 +305,6 @@ ...@@ -282,7 +305,6 @@
}, _this); }, _this);
} }
else if (goods["npcType"] == "boom") { else if (goods["npcType"] == "boom") {
console.log("碰到炸弹");
_this.boomSvga.visible = true; _this.boomSvga.visible = true;
_this.boomSvga.play(false, false); _this.boomSvga.play(false, false);
_this.died(); _this.died();
...@@ -332,7 +354,6 @@ ...@@ -332,7 +354,6 @@
var playerH = a.height; var playerH = a.height;
var playerW = a.width; var playerW = a.width;
var playerX = a.x; var playerX = a.x;
console.log("props", props.playerHeight);
if (props.playerHeight) { if (props.playerHeight) {
playerH = props.playerHeight; playerH = props.playerHeight;
} }
......
{"version":3,"file":"index.js","sources":["src/custom/food-fell2/src/props.ts","src/custom/food-fell2/src/game/utils.ts","src/custom/food-fell2/src/game/Goods.ts","src/custom/food-fell2/src/game/object-pool-init.ts","src/custom/food-fell2/src/game/GameView.ts","src/custom/food-fell2/src/game/GameWrapper.ts","src/custom/food-fell2/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 engine.Texture.from(getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Goods extends engine.Container {\n\tprivate _body:engine.Rect\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body\n\t\tbody = this._body =new engine.Rect()\n\t\t\n\t\t// let randomNum = Math.floor(Math.random() * 3)\t\t\n\t\t// console.log('雨滴' + randomNum);\n\t\t\n\t\tlet rain = new engine.Sprite(getTextureByName('雨滴0'));\n\t\tlet rain1 = new engine.Sprite(getTextureByName('雨滴1'));\n\t\tlet rain2 = new engine.Sprite(getTextureByName('雨滴2'));\n\t\train[\"npcType\"]=\"rain0\"\n\t\train1[\"npcType\"]=\"rain1\"\n\t\train2[\"npcType\"]=\"rain2\"\n\t\tlet stone = new engine.Sprite(getTextureByName('石块'));\n\t\tstone[\"npcType\"]=\"stone\"\n\t\tlet boom = new engine.Sprite(getTextureByName('炸弹'));\n\t\tboom[\"npcType\"]=\"boom\"\n\n\t\train.visible=false;\n\t\train1.visible=false;\n\t\train2.visible=false;\n\t\tstone.visible=false;\n\t\tboom.visible=false;\n\t\tbody.addChild(rain)\n\t\tbody.addChild(rain1)\n\t\tbody.addChild(rain2)\n\t\tbody.addChild(stone)\n\t\tbody.addChild(boom)\n\t\t\n\t\tthis.addChild(body);\n\t\tbody.width=.0001;\n\t\tbody.height=.0001;\n\t\tbody.mouseEnabled=false;\n\t}\n\n\n\tgetRandomNumberByRange(start, end) {\n\t\treturn Math.floor(Math.random() * (end - start) + start)\n\t}\n\n\treset() {\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tthis.y = 0;\n\t\tthis.x = (750-120)*Math.random()+30;\n\t\tthis.rotation = 0;\n\t\tlet random=Math.random()\n\t\tif(typeof (props.goodsProbability) == 'string'){\n\t\t\tprops.goodsProbability=props.goodsProbability.split(',').map((i: string) => +i)\n\t\t\tconsole.log(props.goodsProbability);\n\t\t\t\n\t\t}\n\t\tif(random<props.goodsProbability[0]){\n\t\t\tlet randomNum = Math.floor(Math.random() * 3)\t\t\n\t\t\tthis.showNpc(\"rain\" + randomNum)\n\t\t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"stone\")\n\t\t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"boom\")\n\t\t}\n\t}\n\n\n\tshowNpc(type){\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tthis._body.children[i].visible=false;\n\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t}\t\t\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tif(this._body.children[i][\"npcType\"]==type){\n\t\t\t\tthis[\"npcType\"]=type\n\t\t\t\tthis._body.children[i].visible=true;\n\t\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t\t}\n\t\t}\n\t\t\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 {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\n\t//当前分数\n\tprivate score\n\n\t//游戏状态\n\tprivate gameIng;\n\n\t//npc出身计时器\n\tprivate timer\n\t//倒计时计时器\n\tprivate countdownTimer: any\n\t//倒计时\n\tprivate countdown: number\n\n\t//当前速度\n\tprivate speed: number\n\n\t// 当前场景上面的物品\n\tprivate goodsItems = []\n\n\n\tprivate _goods: Goods;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tprivate waterSvga\n\tprivate stoneSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\t\tthis.NpcBg = new engine.Container();\n\t\tthis.NpcBg.alpha = 1;\n\t\tthis.NpcBg.width = 0;\n\t\tthis.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg);\n\n\t\n\n\t\tthis.player = new engine.Container();\n\t\tthis.player.mouseEnabled = false;\n\t//\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n\t\t//console.log(this.player.fillColor)\n\t\n\t\tthis.addChild(this.player);\n\n\t\tthis.waterSvga=createSvga(\"水花\")\n\t\tthis.stoneSvga=createSvga(\"石头svga\")\n\t\t// this.playerSvga=createSvga(\"玩家\")\n\t\tthis.playerSvga= new engine.Sprite(getTextureByName('玩家'))\n\t\tthis.boomSvga=createSvga(\"炸弹svga\")\n\t\tthis.player.addChild(this.playerSvga);\n\t\tthis.player.addChild(this.stoneSvga);\n\t\tthis.player.addChild(this.waterSvga);\n\t\tthis.player.addChild(this.boomSvga);\n\t\t// this.playerSvga.gotoAndPlay(1);\n\n\t\t\n\n\t\tthis.waterSvga.visible = false\n\t\tthis.stoneSvga.visible = false\n\t\tthis.boomSvga.visible = false\n\t\t\n\t\tthis.visible=false;\n\t\tsetTimeout(()=>{\n\t\t\tthis.visible=true;\n\t\t\tthis.player.anchorY = this.player.height / 2;\n\t\t\tthis.player.anchorX = this.player.width / 2;\n\t\t\tthis.player.x = 375 - this.player.width / 2;\n\t\t\tthis.player.y = props.playerPositionY;\n\n\t\t\tthis.stoneSvga.x = this.player.width / 2 - \tthis.stoneSvga.width/2 + props.boomPosition1Offset[0];\n\t\t\tthis.stoneSvga.y = this.player.height / 2 - this.stoneSvga.height/2 + props.boomPosition1Offset[1];\n\n\t\t\tthis.waterSvga.x = this.player.width / 2 - \tthis.waterSvga.width/2+ props.boomPosition2Offset[0];\n\t\t\tthis.waterSvga.y = this.player.height / 2 - this.waterSvga.height/2 + props.boomPosition2Offset[1];\n\n\t\t\tthis.boomSvga.x = this.player.width / 2 - \tthis.boomSvga.width/2+ props.boomPosition3Offset[0];\n\t\t\tthis.boomSvga.y = this.player.height / 2 - this.boomSvga.height/2 + props.boomPosition3Offset[1];\n\n\t\t\t// this.stoneSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.stoneSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.waterSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.waterSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.boomSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.boomSvga.y=props.boomPositionOffset[1]\n\n\t\t\t\n\t\t},300)\n\n\t\t\n\t\tthis.rectBg = new engine.Container();\n\t\tthis.rectBg.alpha = 0;\n\t\tthis.rectBg.width = 750;\n\t\tthis.rectBg.height = 1624;\n\t\tthis.addChild(this.rectBg)\n\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\n\t\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tthis.score = 0\n\t\tthis.recycleGoods()\n\t\tthis.player.x = 375 - this.player.width / 2;\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.score = 0;\n\t\tthis.speed = 1\n\t\tthis.gameIng = true;\n\t\tthis.creatNpc()\n\t\tthis.beginNpc()\n\t\tthis.countdown = props.countDown;\n\t\t\n\t\tthis.countdownTimer = setInterval(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tif (this.countdown > 0) {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-time-update', {\n\t\t\t\t\t\ttime: this.countdown,\n\t\t\t\t\t});\n\t\t\t\t\tthis.countdown -= 1\n\t\t\t\t} else {\n\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\treason: 1\n\t\t\t\t\t});\n\t\t\t\t\tthis.died()\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1000)\n\t}\n\n\t/**\n\t * npc开始掉落\n\t */\n\tbeginNpc() {\n\t\tthis.timer = setTimeout(() => {\n\t\t\tif (this.gameIng) {\n\t\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\t\tthis.creatNpc()\n\t\t\t}\n\t\t\t//递归执行\n\t\t\tthis.beginNpc()\n\t\t}, 2000 / this.speed)\n\t}\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\tthis.gameIng = false;\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t\tthis.gameIng = true;\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\tthis.reset()\n\t\tthis.start()\n\t}\n\n\t/**\n\t * 创建NPC\n\t */\n\tprivate creatNpc() {\n\t\tlet goods = this._goods = <Goods>ObjectPool.getObject(PoolName);\n\t\tthis.goodsItems.push(goods)\n\t\tconsole.log(goods);\n\t\t\n\t\tthis.NpcBg.addChild(goods);\n\t\tgoods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = () => {\n\t\t\tif (goods.y > 1624) {\n\t\t\t\tthis.removeNpc(goods)\n\t\t\t} else {\n\t\t\t\tif (this.gameIng) {\n\t\t\t\t\t//速度叠加\n\t\t\t\t\tgoods.y += (4 * this.speed)\n\t\t\t\t\t//如果玩家和物品发生碰撞\n\t\t\t\t\tif (this.hasHit(this.player, goods)) {\n\t\t\t\t\t\tif (goods[\"npcType\"].indexOf(\"rain\") > -1) {\n\t\t\t\t\t\t\tconsole.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rainScore;\n\t\t\t\t\t\t\tthis.waterSvga.visible=true;\n\t\t\t\t\t\t//\tthis.waterSvga.x= goods.x - this.player.x;\n\t\t\t\t\t\t\tthis.waterSvga.play(false, false)\n\t\t\t\t\t\t\tthis.waterSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.waterSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\n\t\t\t\t\t\t\tif(this.score<0){\n\t\t\t\t\t\t\t\tthis.score=0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"stone\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到石头\")\n\t\t\t\t\t\t\tthis.score += props.stoneScore\n\t\t\t\t\t\t\tif(this.score<0){\n\t\t\t\t\t\t\t\tthis.score=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.stoneSvga.visible=true;\n\t\t\t\t\t\t\tthis.stoneSvga.play(false, false)\n\t\t\t\t\t\t\tthis.stoneSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.stoneSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"boom\") {\n\t\t\t\t\t\t\tconsole.log(\"碰到炸弹\")\n\t\t\t\t\t\t\tthis.boomSvga.visible=true;\n\t\t\t\t\t\t\tthis.boomSvga.play(false, false)\n\t\t\t\t\t\t\tthis.died()\n\t\t\t\t\t\t\tthis.boomSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.boomSvga.visible=false;\n\t\t\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t\t\t\treason: 2\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-score-update', {\n\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.removeNpc(goods)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, this);\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.pause()\n\t}\n\n\t/**\n\t * 回收指定物品\n\t * @param goods 物品\n\t */\n\tprivate removeNpc(goods) {\n\t\tthis.NpcBg.removeChild(goods);\n\t\tObjectPool.recycleObject(PoolName, goods);\n\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\tlet index = this.goodsItems.indexOf(goods);\n\t\tif (index > -1) {\n\t\t\tthis.goodsItems.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * 回收对象\n\t */\n\tprivate recycleGoods() {\n\t\tclearTimeout(this.timer)\n\t\tclearInterval(this.countdownTimer)\n\t\tfor (let goods of this.goodsItems) {\n\t\t\tif (goods) {\n\t\t\t\tthis.NpcBg.removeChild(goods);\n\t\t\t\tObjectPool.recycleObject(PoolName, goods);\n\t\t\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\t\t}\n\t\t}\n\t\tthis.goodsItems = []\n\t}\n\n\tprivate moveCatchX = 0\n\tprivate playerCatchX = 0\n\n\t/**\n\t * 碰撞检测\n\t * @param a a盒子\n\t * @param b b盒子\n\t */\n\tprivate hasHit(a, b) {\n\n\t\tlet playerH=a.height\n\t\tlet playerW=a.width\n\t\tlet playerX=a.x\n\t\tconsole.log(\"props\",props.playerHeight)\n\t\tif(props.playerHeight){\n\t\t\tplayerH=props.playerHeight\n\t\t}\n\t\tif(props.playerWidth){\n\t\t\tplayerW=props.playerWidth\n\t\t\tplayerX=a.x+(a.width-props.playerWidth)/2\n\t\t}\n\n\t\tif (\n\t\t\tMath.abs((playerX + playerW / 2) - (b.x + b.width / 2)) < playerW / 2 + b.width / 2\n\t\t\t&&\n\t\t\t// Math.abs((a.y + a.height / 2 ) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2\n\t\t\tMath.abs((a.y + playerH / 1.3 ) - (b.y + b.height / 2)) < playerH / 2 + b.height / 2\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate onDownStage = (e) => {\n\t\tthis.moveCatchX = e.localX;\n\t\tthis.playerCatchX = this.player.x\n\t}\n\n\tprivate onMoveStage = (e) => {\n\t\tlet maxStageBound=props.maxStageBound;\n\t\tif (this.gameIng) {\n\t\t\tlet playerX=this.playerCatchX + (e.localX - this.moveCatchX)\n\t\t\tif(playerX<maxStageBound){\n\t\t\t\tthis.player.x=maxStageBound\n\t\t\t}else if(playerX+this.player.width+maxStageBound>750){\n\t\t\t\tthis.player.x=750-maxStageBound-this.player.width\n\t\t\t}else{\n\t\t\t\tthis.player.x=playerX\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onOutStage = (e) => {\n\t\tthis.moveCatchX = 0\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('food-fell-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('food-fell-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('food-fell-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('food-fell-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('food-fell-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('food-fell-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\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\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;;UCN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AAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;"} {"version":3,"file":"index.js","sources":["src/custom/food-fell2/src/props.ts","src/custom/food-fell2/src/game/utils.ts","src/custom/food-fell2/src/game/Goods.ts","src/custom/food-fell2/src/game/object-pool-init.ts","src/custom/food-fell2/src/game/GameView.ts","src/custom/food-fell2/src/game/GameWrapper.ts","src/custom/food-fell2/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 engine.Texture.from(getAssetByName(name).uuid);\n}\n\nexport function playSound(name) {\n\tengine.playSound(getAssetByName(name).uuid, {keep: true});\n}\nexport function createSvga(name, anchorName?) {\n\tlet inst = new svga.Svga();\n\tinst.source = 'asset://' + getAssetByName(name).uuid;\n\treturn inst;\n}","/**\n * Created by rockyl on 2020-02-02.\n *\n * 掉落物品\n */\nimport {getTextureByName} from \"./utils\";\nimport {props} from \"../props\";\n\nexport class Goods extends engine.Container {\n\tprivate _body:engine.Rect\n\tprivate _toY;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tlet body\n\t\tbody = this._body =new engine.Rect()\n\t\t\n\t\t// let randomNum = Math.floor(Math.random() * 3)\t\t\n\t\t// console.log('雨滴' + randomNum);\n\t\t\n\t\tlet rain = new engine.Sprite(getTextureByName('雨滴0'));\n\t\tlet rain1 = new engine.Sprite(getTextureByName('雨滴1'));\n\t\tlet rain2 = new engine.Sprite(getTextureByName('雨滴2'));\n\t\train[\"npcType\"]=\"rain0\"\n\t\train1[\"npcType\"]=\"rain1\"\n\t\train2[\"npcType\"]=\"rain2\"\n\t\tlet stone = new engine.Sprite(getTextureByName('石块'));\n\t\tstone[\"npcType\"]=\"stone\"\n\t\tlet boom = new engine.Sprite(getTextureByName('炸弹'));\n\t\tboom[\"npcType\"]=\"boom\"\n\n\t\train.visible=false;\n\t\train1.visible=false;\n\t\train2.visible=false;\n\t\tstone.visible=false;\n\t\tboom.visible=false;\n\t\tbody.addChild(rain)\n\t\tbody.addChild(rain1)\n\t\tbody.addChild(rain2)\n\t\tbody.addChild(stone)\n\t\tbody.addChild(boom)\n\t\t\n\t\tthis.addChild(body);\n\t\tbody.width=.0001;\n\t\tbody.height=.0001;\n\t\tbody.mouseEnabled=false;\n\t}\n\n\n\tgetRandomNumberByRange(start, end) {\n\t\treturn Math.floor(Math.random() * (end - start) + start)\n\t}\n\n\treset() {\n\t\tthis.visible = true;\n\t\tthis.rotation = 0;\n\t\tthis.anchorOffsetY = 0;\n\t\tthis.y = 0;\n\t\tthis.x = (750-120)*Math.random()+30;\n\t\tthis.rotation = 0;\n\t\tlet random=Math.random()\n\t\tif(typeof (props.goodsProbability) == 'string'){\n\t\t\tprops.goodsProbability=props.goodsProbability.split(',').map((i: string) => +i)\n\t\t\t//console.log(props.goodsProbability);\n\t\t\t\n\t\t}\n\t\tif(random<props.goodsProbability[0]){\n\t\t\tlet randomNum = Math.floor(Math.random() * 3)\t\t\n\t\t\tthis.showNpc(\"rain\" + randomNum)\n\t\t}else if(random>=props.goodsProbability[0]&&random<=(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"stone\")\n\t\t}else if(random>(props.goodsProbability[0]+props.goodsProbability[1])){\n\t\t\tthis.showNpc(\"boom\")\n\t\t}\n\t}\n\n\n\tshowNpc(type){\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tthis._body.children[i].visible=false;\n\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t}\t\t\n\t\tfor(let i=0;i<this._body.children.length;i++){\n\t\t\tif(this._body.children[i][\"npcType\"]==type){\n\t\t\t\tthis[\"npcType\"]=type\n\t\t\t\tthis._body.children[i].visible=true;\n\t\t\t\tthis._body.children[i].mouseEnabled=false;\n\t\t\t}\n\t\t}\n\t\t\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 {Goods} from \"./Goods\";\nimport ObjectPool = engine.ObjectPool;\n\nexport const PoolName: string = 'goods';\n\nObjectPool.registerPool(PoolName, function () {\n\treturn new Goods();\n}, function (item: Goods, data) {\n\titem.reset();\n});\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\n\t//当前分数\n\tprivate score\n\n\t//游戏状态\n\tprivate gameIng;\n\n\t//npc出身计时器\n\tprivate timer\n\t//倒计时计时器\n\tprivate countdownTimer: any\n\t//倒计时\n\tprivate countdown: number\n\n\t//当前速度\n\tprivate speed: number\n\n\t// 当前场景上面的物品\n\tprivate goodsItems = []\n\n\tprivate viewVisible=true;\n\n\n\tprivate _goods: Goods;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t}\n\n\tprivate waterSvga\n\tprivate stoneSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hasSetup = true;\n\t\tthis.NpcBg = new engine.Container();\n\t\tthis.NpcBg.alpha = 1;\n\t\tthis.NpcBg.width = 0;\n\t\tthis.NpcBg.height = 0;\n\t\tthis.addChild(this.NpcBg);\n\n\t\n\n\t\tthis.player = new engine.Container();\n\t\tthis.player.mouseEnabled = false;\n\t//\tthis.player.fillColor=\"rgba(0, 0, 0,1)\"\n\t\t//console.log(this.player.fillColor)\n\t\n\t\tthis.addChild(this.player);\n\n\t\tthis.waterSvga=createSvga(\"水花\")\n\t\tthis.stoneSvga=createSvga(\"石头svga\")\n\t\t// this.playerSvga=createSvga(\"玩家\")\n\t\tthis.playerSvga= new engine.Sprite(getTextureByName('玩家'))\n\t\tthis.boomSvga=createSvga(\"炸弹svga\")\n\t\tthis.player.addChild(this.playerSvga);\n\t\tthis.player.addChild(this.stoneSvga);\n\t\tthis.player.addChild(this.waterSvga);\n\t\tthis.player.addChild(this.boomSvga);\n\t\t// this.playerSvga.gotoAndPlay(1);\n\n\t\t\n\n\t\tthis.waterSvga.visible = false\n\t\tthis.stoneSvga.visible = false\n\t\tthis.boomSvga.visible = false\n\t\t\n\t\tthis.visible=false;\n\t\tsetTimeout(()=>{\n\t\t\tthis.visible=true;\n\t\t\tthis.player.anchorY = this.player.height / 2;\n\t\t\tthis.player.anchorX = this.player.width / 2;\n\t\t\tthis.player.x = 375 - this.player.width / 2;\n\t\t\tthis.player.y = props.playerPositionY;\n\n\t\t\tthis.stoneSvga.x = this.player.width / 2 - \tthis.stoneSvga.width/2 + props.boomPosition1Offset[0];\n\t\t\tthis.stoneSvga.y = this.player.height / 2 - this.stoneSvga.height/2 + props.boomPosition1Offset[1];\n\n\t\t\tthis.waterSvga.x = this.player.width / 2 - \tthis.waterSvga.width/2+ props.boomPosition2Offset[0];\n\t\t\tthis.waterSvga.y = this.player.height / 2 - this.waterSvga.height/2 + props.boomPosition2Offset[1];\n\n\t\t\tthis.boomSvga.x = this.player.width / 2 - \tthis.boomSvga.width/2+ props.boomPosition3Offset[0];\n\t\t\tthis.boomSvga.y = this.player.height / 2 - this.boomSvga.height/2 + props.boomPosition3Offset[1];\n\n\t\t\t// this.stoneSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.stoneSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.waterSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.waterSvga.y=props.boomPositionOffset[1]\n\n\t\t\t// this.boomSvga.x=props.boomPositionOffset[0]\n\t\t\t// this.boomSvga.y=props.boomPositionOffset[1]\n\n\t\t\t\n\t\t},300)\n\n\t\t\n\t\tthis.rectBg = new engine.Container();\n\t\tthis.rectBg.alpha = 0;\n\t\tthis.rectBg.width = 750;\n\t\tthis.rectBg.height = 1624;\n\t\tthis.addChild(this.rectBg)\n\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDownStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onMoveStage, this);\n\t\tthis.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);\n\n\n\t\tdocument.addEventListener(\"visibilitychange\",()=>{\n\t\t\tif(document.visibilityState==\"visible\"){\n\t\t\t\tthis.viewVisible=true;\n\t\t\t}\n\t\t\tif(document.visibilityState==\"hidden\"){\n\t\t\t\tthis.viewVisible=false;\n\t\t\t}\n\t\t})\n\n\t\tthis.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame,this)\n\t\n\t}\n\n\tenterFrame(){\n\t\tthis.updateTime()\n\t\tthis.updateTimeBeginNpc()\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tthis.score = props.speed\n\t\tthis.recycleGoods()\n\t\tthis.player.x = 375 - this.player.width / 2;\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.score = 0;\n\t\tthis.speed = 1\n\t\tthis.gameIng = true;\n\t\t//this.creatNpc()\n\t\tthis.beginNpc()\n\t\tthis.countdown = props.countDown;\n\t}\n\n\tcacheTime=0\n\tupdateTime(){\n\t\tif(Date.now()-this.cacheTime>1000){\n\t\t\tthis.cacheTime=Date.now()\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\tif (this.gameIng) {\n\t\t\tif (this.countdown > 0) {\n\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-time-update', {\n\t\t\t\t\ttime: this.countdown,\n\t\t\t\t});\n\t\t\t\tthis.countdown -= 1\n\t\t\t} else {\n\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\tscore: this.score,\n\t\t\t\t\treason: 1\n\t\t\t\t});\n\t\t\t\tthis.died()\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * npc开始掉落\n\t */\n\tbeginNpc() {\n\t\t// this.timer = setTimeout(() => {\n\t\t\t\n\t\t// \t//递归执行\n\t\t// \tthis.beginNpc()\n\t\t// }, 2000 / this.speed)\n\t}\n\n\tcacheTime2=0\n\tupdateTimeBeginNpc(){\n\t\tif(Date.now()-this.cacheTime2>(2000 / this.speed)){\n\t\t\tthis.cacheTime2=Date.now()\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\tif (this.gameIng) {\n\t\t\tthis.speed += props.acceleratedSpeed;\n\t\t\tif(this.speed >= props.maxSpeed){\n\t\t\t\tthis.speed = props.maxSpeed\n\t\t\t}\n\t\t\tthis.creatNpc()\n\t\t}\n\t}\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\tthis.gameIng = false;\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t\tthis.gameIng = true;\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\tthis.reset()\n\t\tthis.start()\n\t}\n\n\t/**\n\t * 创建NPC\n\t */\n\tprivate creatNpc() {\n\t\tlet goods = this._goods = <Goods>ObjectPool.getObject(PoolName);\n\t\tthis.goodsItems.push(goods)\n\t\t//console.log(goods);\n\t\t\n\t\tthis.NpcBg.addChild(goods);\n\t\tgoods.addEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"] = () => {\n\t\t\tif (goods.y > 1624) {\n\t\t\t\tthis.removeNpc(goods)\n\t\t\t} else {\n\t\t\t\tif (this.gameIng) {\n\t\t\t\t\t//速度叠加\n\t\t\t\t\tgoods.y += (4 * this.speed)\n\t\t\t\t\t//如果玩家和物品发生碰撞\n\t\t\t\t\tif (this.hasHit(this.player, goods)) {\n\t\t\t\t\t\tif (goods[\"npcType\"].indexOf(\"rain\") > -1) {\n\t\t\t\t\t\t\t//console.log(\"碰到雨滴\")\n\t\t\t\t\t\t\tthis.score += props.rainScore;\n\t\t\t\t\t\t\tthis.waterSvga.visible=true;\n\t\t\t\t\t\t//\tthis.waterSvga.x= goods.x - this.player.x;\n\t\t\t\t\t\t\tthis.waterSvga.play(false, false)\n\t\t\t\t\t\t\tthis.waterSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.waterSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\n\t\t\t\t\t\t\tif(this.score<0){\n\t\t\t\t\t\t\t\tthis.score=0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"stone\") {\n\t\t\t\t\t\t\t//console.log(\"碰到石头\")\n\t\t\t\t\t\t\tthis.score += props.stoneScore\n\t\t\t\t\t\t\tif(this.score<0){\n\t\t\t\t\t\t\t\tthis.score=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.stoneSvga.visible=true;\n\t\t\t\t\t\t\tthis.stoneSvga.play(false, false)\n\t\t\t\t\t\t\tthis.stoneSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.stoneSvga.visible=false;\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t} else if (goods[\"npcType\"] == \"boom\") {\n\t\t\t\t\t\t\t//console.log(\"碰到炸弹\")\n\t\t\t\t\t\t\tthis.boomSvga.visible=true;\n\t\t\t\t\t\t\tthis.boomSvga.play(false, false)\n\t\t\t\t\t\t\tthis.died()\n\t\t\t\t\t\t\tthis.boomSvga.once(engine.Event.END_FRAME, ()=>{\n\t\t\t\t\t\t\t\tthis.boomSvga.visible=false;\n\t\t\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-game-over', {\n\t\t\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t\t\t\treason: 2\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.globalEvent.dispatchEvent('food-fell-score-update', {\n\t\t\t\t\t\t\tscore: this.score,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.removeNpc(goods)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, this);\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.pause();\n\t}\n\n\t/**\n\t * 回收指定物品\n\t * @param goods 物品\n\t */\n\tprivate removeNpc(goods) {\n\t\tthis.NpcBg.removeChild(goods);\n\t\tObjectPool.recycleObject(PoolName, goods);\n\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\tlet index = this.goodsItems.indexOf(goods);\n\t\tif (index > -1) {\n\t\t\tthis.goodsItems.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * 回收对象\n\t */\n\tprivate recycleGoods() {\n\t\tclearTimeout(this.timer)\n\t\tclearInterval(this.countdownTimer)\n\t\tfor (let goods of this.goodsItems) {\n\t\t\tif (goods) {\n\t\t\t\tthis.NpcBg.removeChild(goods);\n\t\t\t\tObjectPool.recycleObject(PoolName, goods);\n\t\t\t\tgoods.removeEventListener(engine.Event.ENTER_FRAME, goods[\"onGoodsEnter\"], this);\n\t\t\t}\n\t\t}\n\t\tthis.goodsItems = []\n\t}\n\n\tprivate moveCatchX = 0\n\tprivate playerCatchX = 0\n\n\t/**\n\t * 碰撞检测\n\t * @param a a盒子\n\t * @param b b盒子\n\t */\n\tprivate hasHit(a, b) {\n\n\t\tlet playerH=a.height\n\t\tlet playerW=a.width\n\t\tlet playerX=a.x\n\t\tif(props.playerHeight){\n\t\t\tplayerH=props.playerHeight\n\t\t}\n\t\tif(props.playerWidth){\n\t\t\tplayerW=props.playerWidth\n\t\t\tplayerX=a.x+(a.width-props.playerWidth)/2\n\t\t}\n\n\t\tif (\n\t\t\tMath.abs((playerX + playerW / 2) - (b.x + b.width / 2)) < playerW / 2 + b.width / 2\n\t\t\t&&\n\t\t\t// Math.abs((a.y + a.height / 2 ) - (b.y + b.height / 2)) < a.height / 2 + b.height / 2\n\t\t\tMath.abs((a.y + playerH / 1.3 ) - (b.y + b.height / 2)) < playerH / 2 + b.height / 2\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprivate onDownStage = (e) => {\n\t\tthis.moveCatchX = e.localX;\n\t\tthis.playerCatchX = this.player.x\n\t}\n\n\tprivate onMoveStage = (e) => {\n\t\tlet maxStageBound=props.maxStageBound;\n\t\tif (this.gameIng) {\n\t\t\tlet playerX=this.playerCatchX + (e.localX - this.moveCatchX)\n\t\t\tif(playerX<maxStageBound){\n\t\t\t\tthis.player.x=maxStageBound\n\t\t\t}else if(playerX+this.player.width+maxStageBound>750){\n\t\t\t\tthis.player.x=750-maxStageBound-this.player.width\n\t\t\t}else{\n\t\t\t\tthis.player.x=playerX\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onOutStage = (e) => {\n\t\tthis.moveCatchX = 0\n\t}\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('food-fell-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('food-fell-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('food-fell-pause', this.pause, this);\n\t\tengine.globalEvent.addEventListener('food-fell-resume', this.resume, this);\n\t\tengine.globalEvent.addEventListener('food-fell-revive', this.revive, this);\n\t\tengine.globalEvent.addEventListener('food-fell-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\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\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,CA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C,KAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;;MAGxB;KAED,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;SAC9B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,2BAAK,GAAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;SACjB,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;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;"}
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"speed": { "speed": {
"alias": "道具掉落初始速度", "alias": "道具掉落初始速度",
"type": "number", "type": "number",
"default": 10 "default": 1
}, },
"maxSpeed": { "maxSpeed": {
"alias": "道具掉落速度上限", "alias": "道具掉落速度上限",
......
...@@ -42,6 +42,8 @@ export default class GameView extends engine.Container { ...@@ -42,6 +42,8 @@ export default class GameView extends engine.Container {
// 当前场景上面的物品 // 当前场景上面的物品
private goodsItems = [] private goodsItems = []
private viewVisible=true;
private _goods: Goods; private _goods: Goods;
...@@ -133,6 +135,22 @@ export default class GameView extends engine.Container { ...@@ -133,6 +135,22 @@ export default class GameView extends engine.Container {
this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this); this.rectBg.addEventListener(engine.MouseEvent.MOUSE_OUT, this.onOutStage, this);
document.addEventListener("visibilitychange",()=>{
if(document.visibilityState=="visible"){
this.viewVisible=true;
}
if(document.visibilityState=="hidden"){
this.viewVisible=false;
}
})
this.addEventListener(engine.Event.ENTER_FRAME, this.enterFrame,this)
}
enterFrame(){
this.updateTime()
this.updateTimeBeginNpc()
} }
...@@ -140,7 +158,7 @@ export default class GameView extends engine.Container { ...@@ -140,7 +158,7 @@ export default class GameView extends engine.Container {
* 重置场景 * 重置场景
*/ */
reset() { reset() {
this.score = 0 this.score = props.speed
this.recycleGoods() this.recycleGoods()
this.player.x = 375 - this.player.width / 2; this.player.x = 375 - this.player.width / 2;
} }
...@@ -152,11 +170,18 @@ export default class GameView extends engine.Container { ...@@ -152,11 +170,18 @@ export default class GameView extends engine.Container {
this.score = 0; this.score = 0;
this.speed = 1 this.speed = 1
this.gameIng = true; this.gameIng = true;
this.creatNpc() //this.creatNpc()
this.beginNpc() this.beginNpc()
this.countdown = props.countDown; this.countdown = props.countDown;
}
this.countdownTimer = setInterval(() => { cacheTime=0
updateTime(){
if(Date.now()-this.cacheTime>1000){
this.cacheTime=Date.now()
}else{
return;
}
if (this.gameIng) { if (this.gameIng) {
if (this.countdown > 0) { if (this.countdown > 0) {
engine.globalEvent.dispatchEvent('food-fell-time-update', { engine.globalEvent.dispatchEvent('food-fell-time-update', {
...@@ -171,21 +196,33 @@ export default class GameView extends engine.Container { ...@@ -171,21 +196,33 @@ export default class GameView extends engine.Container {
this.died() this.died()
} }
} }
}, 1000)
} }
/** /**
* npc开始掉落 * npc开始掉落
*/ */
beginNpc() { beginNpc() {
this.timer = setTimeout(() => { // this.timer = setTimeout(() => {
// //递归执行
// this.beginNpc()
// }, 2000 / this.speed)
}
cacheTime2=0
updateTimeBeginNpc(){
if(Date.now()-this.cacheTime2>(2000 / this.speed)){
this.cacheTime2=Date.now()
}else{
return;
}
if (this.gameIng) { if (this.gameIng) {
this.speed += props.acceleratedSpeed; this.speed += props.acceleratedSpeed;
if(this.speed >= props.maxSpeed){
this.speed = props.maxSpeed
}
this.creatNpc() this.creatNpc()
} }
//递归执行
this.beginNpc()
}, 2000 / this.speed)
} }
/** /**
...@@ -216,7 +253,7 @@ export default class GameView extends engine.Container { ...@@ -216,7 +253,7 @@ export default class GameView extends engine.Container {
private creatNpc() { private creatNpc() {
let goods = this._goods = <Goods>ObjectPool.getObject(PoolName); let goods = this._goods = <Goods>ObjectPool.getObject(PoolName);
this.goodsItems.push(goods) this.goodsItems.push(goods)
console.log(goods); //console.log(goods);
this.NpcBg.addChild(goods); this.NpcBg.addChild(goods);
goods.addEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"] = () => { goods.addEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"] = () => {
...@@ -229,7 +266,7 @@ export default class GameView extends engine.Container { ...@@ -229,7 +266,7 @@ export default class GameView extends engine.Container {
//如果玩家和物品发生碰撞 //如果玩家和物品发生碰撞
if (this.hasHit(this.player, goods)) { if (this.hasHit(this.player, goods)) {
if (goods["npcType"].indexOf("rain") > -1) { if (goods["npcType"].indexOf("rain") > -1) {
console.log("碰到雨滴") //console.log("碰到雨滴")
this.score += props.rainScore; this.score += props.rainScore;
this.waterSvga.visible=true; this.waterSvga.visible=true;
// this.waterSvga.x= goods.x - this.player.x; // this.waterSvga.x= goods.x - this.player.x;
...@@ -243,7 +280,7 @@ export default class GameView extends engine.Container { ...@@ -243,7 +280,7 @@ export default class GameView extends engine.Container {
} }
} else if (goods["npcType"] == "stone") { } else if (goods["npcType"] == "stone") {
console.log("碰到石头") //console.log("碰到石头")
this.score += props.stoneScore this.score += props.stoneScore
if(this.score<0){ if(this.score<0){
this.score=0; this.score=0;
...@@ -254,7 +291,7 @@ export default class GameView extends engine.Container { ...@@ -254,7 +291,7 @@ export default class GameView extends engine.Container {
this.stoneSvga.visible=false; this.stoneSvga.visible=false;
}, this); }, this);
} else if (goods["npcType"] == "boom") { } else if (goods["npcType"] == "boom") {
console.log("碰到炸弹") //console.log("碰到炸弹")
this.boomSvga.visible=true; this.boomSvga.visible=true;
this.boomSvga.play(false, false) this.boomSvga.play(false, false)
this.died() this.died()
...@@ -281,7 +318,7 @@ export default class GameView extends engine.Container { ...@@ -281,7 +318,7 @@ export default class GameView extends engine.Container {
* 玩家死亡 * 玩家死亡
*/ */
private died() { private died() {
this.pause() this.pause();
} }
/** /**
...@@ -327,7 +364,6 @@ export default class GameView extends engine.Container { ...@@ -327,7 +364,6 @@ export default class GameView extends engine.Container {
let playerH=a.height let playerH=a.height
let playerW=a.width let playerW=a.width
let playerX=a.x let playerX=a.x
console.log("props",props.playerHeight)
if(props.playerHeight){ if(props.playerHeight){
playerH=props.playerHeight playerH=props.playerHeight
} }
......
...@@ -62,7 +62,7 @@ export class Goods extends engine.Container { ...@@ -62,7 +62,7 @@ export class Goods extends engine.Container {
let random=Math.random() let random=Math.random()
if(typeof (props.goodsProbability) == 'string'){ if(typeof (props.goodsProbability) == 'string'){
props.goodsProbability=props.goodsProbability.split(',').map((i: string) => +i) props.goodsProbability=props.goodsProbability.split(',').map((i: string) => +i)
console.log(props.goodsProbability); //console.log(props.goodsProbability);
} }
if(random<props.goodsProbability[0]){ if(random<props.goodsProbability[0]){
......
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