Commit 08bf8fe8 authored by 任建锋's avatar 任建锋

修复

parent 7a96d016
This diff is collapsed.
...@@ -41,13 +41,13 @@ const assets = [ ...@@ -41,13 +41,13 @@ const assets = [
}, },
{ {
"name": "水花", "name": "水花",
"url": "//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886", "url": "//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886.svga",
"uuid": "cdd2268f-ad65-4b5e-a965-ee61b730da21", "uuid": "cdd2268f-ad65-4b5e-a965-ee61b730da21",
"ext": ".svga" "ext": ".svga"
}, },
{ {
"name": "石头svga", "name": "石头svga",
"url": "//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a", "url": "//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a.svga",
"uuid": "846a139d-0990-4db4-a323-f22379932ee4", "uuid": "846a139d-0990-4db4-a323-f22379932ee4",
"ext": ".svga" "ext": ".svga"
}, },
...@@ -63,24 +63,12 @@ const assets = [ ...@@ -63,24 +63,12 @@ const assets = [
"uuid": "d7a3947b-7fcb-48f2-9ddf-2f075d37a619", "uuid": "d7a3947b-7fcb-48f2-9ddf-2f075d37a619",
"ext": ".svga" "ext": ".svga"
}, },
// {
// "name": "炸弹",
// "url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
// "uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
// "ext": ".svga"
// },
{ {
"name": "玩家", "name": "玩家",
"url": "//yun.duiba.com.cn/aurora/assets/db0130d36ef79865be9c753ea0627027f16341d8.png", "url": "//yun.duiba.com.cn/aurora/assets/db0130d36ef79865be9c753ea0627027f16341d8.png",
"uuid": "4931d296-4421-4a2f-8299-7bab87407c72", "uuid": "4931d296-4421-4a2f-8299-7bab87407c72",
"ext": ".png" "ext": ".png"
} }
// {
// "name": "玩家",
// "url": "//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga",
// "uuid": "71d8dcbc-3931-471a-b585-b3ae01b25aa6",
// "ext": ".svga"
// }
]; ];
function loadAssets(customModuleAssets, onProgress, onComplete){ function loadAssets(customModuleAssets, onProgress, onComplete){
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
return getTexture(engine.getAssetByName(name).uuid); return getTexture(engine.getAssetByName(name).uuid);
} }
function createSvga(name, anchorName) { function createSvga(name, anchorName) {
console.log();
var inst = new svga.Svga(); var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid; inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst; return inst;
} }
//# sourceMappingURL=utils.js.map
var Goods = (function (_super) { var Goods = (function (_super) {
tslib.__extends(Goods, _super); tslib.__extends(Goods, _super);
...@@ -132,7 +132,16 @@ ...@@ -132,7 +132,16 @@
}; };
_this.onMoveStage = function (e) { _this.onMoveStage = function (e) {
if (_this.gameIng) { if (_this.gameIng) {
_this.player.x = _this.playerCatchX + (e.localX - _this.moveCatchX); var playerX = _this.playerCatchX + (e.localX - _this.moveCatchX);
if (playerX < 0) {
_this.player.x = 0;
}
else if (playerX + _this.player.width > 750) {
_this.player.x = 750 - _this.player.width;
}
else {
_this.player.x = playerX;
}
} }
}; };
_this.onOutStage = function (e) { _this.onOutStage = function (e) {
...@@ -254,7 +263,6 @@ ...@@ -254,7 +263,6 @@
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.play(false, false); _this.waterSvga.play(false, false);
_this.waterSvga.once(engine.Event.END_FRAME, function () { _this.waterSvga.once(engine.Event.END_FRAME, function () {
_this.waterSvga.visible = false; _this.waterSvga.visible = false;
...@@ -310,7 +318,7 @@ ...@@ -310,7 +318,7 @@
for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) { for (var _i = 0, _a = this.goodsItems; _i < _a.length; _i++) {
var goods = _a[_i]; var goods = _a[_i];
if (goods) { if (goods) {
this.removeChild(goods); this.NpcBg.removeChild(goods);
ObjectPool$1.recycleObject(PoolName, goods); ObjectPool$1.recycleObject(PoolName, goods);
goods.removeEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"], this); goods.removeEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"], this);
} }
...@@ -329,6 +337,7 @@ ...@@ -329,6 +337,7 @@
}; };
return GameView; return GameView;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) { var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super); tslib.__extends(GameWrapper, _super);
......
This diff is collapsed.
...@@ -73,13 +73,13 @@ ...@@ -73,13 +73,13 @@
}, },
{ {
"name": "水花", "name": "水花",
"url": "//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886", "url": "//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886.svga",
"uuid": "cdd2268f-ad65-4b5e-a965-ee61b730da21", "uuid": "cdd2268f-ad65-4b5e-a965-ee61b730da21",
"ext": ".svga" "ext": ".svga"
}, },
{ {
"name": "石头svga", "name": "石头svga",
"url": "//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a", "url": "//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a.svga",
"uuid": "846a139d-0990-4db4-a323-f22379932ee4", "uuid": "846a139d-0990-4db4-a323-f22379932ee4",
"ext": ".svga" "ext": ".svga"
}, },
......
...@@ -212,7 +212,7 @@ export default class GameView extends engine.Container { ...@@ -212,7 +212,7 @@ export default class GameView extends engine.Container {
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;
this.waterSvga.play(false, false) this.waterSvga.play(false, false)
this.waterSvga.once(engine.Event.END_FRAME, ()=>{ this.waterSvga.once(engine.Event.END_FRAME, ()=>{
this.waterSvga.visible=false; this.waterSvga.visible=false;
...@@ -280,7 +280,7 @@ export default class GameView extends engine.Container { ...@@ -280,7 +280,7 @@ export default class GameView extends engine.Container {
clearInterval(this.countdownTimer) clearInterval(this.countdownTimer)
for (let goods of this.goodsItems) { for (let goods of this.goodsItems) {
if (goods) { if (goods) {
this.removeChild(goods); this.NpcBg.removeChild(goods);
ObjectPool.recycleObject(PoolName, goods); ObjectPool.recycleObject(PoolName, goods);
goods.removeEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"], this); goods.removeEventListener(engine.Event.ENTER_FRAME, goods["onGoodsEnter"], this);
} }
...@@ -316,7 +316,14 @@ export default class GameView extends engine.Container { ...@@ -316,7 +316,14 @@ export default class GameView extends engine.Container {
private onMoveStage = (e) => { private onMoveStage = (e) => {
if (this.gameIng) { if (this.gameIng) {
this.player.x = this.playerCatchX + (e.localX - this.moveCatchX) let playerX=this.playerCatchX + (e.localX - this.moveCatchX)
if(playerX<0){
this.player.x=0
}else if(playerX+this.player.width>750){
this.player.x=750-this.player.width
}else{
this.player.x=playerX
}
} }
} }
......
...@@ -14,6 +14,7 @@ export function playSound(name) { ...@@ -14,6 +14,7 @@ export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true}); engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
} }
export function createSvga(name, anchorName?) { export function createSvga(name, anchorName?) {
console.log()
let inst = new svga.Svga(); let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid; inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst; return inst;
......
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