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

修复

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