Commit d2762aba authored by wildfirecode's avatar wildfirecode

1

parent 7a29bbb9
...@@ -34,7 +34,7 @@ export default class MapScene extends Scene { ...@@ -34,7 +34,7 @@ export default class MapScene extends Scene {
} }
stopGamebg(); stopGamebg();
if (!readCache() && getHomeData().levels.length <=0) { if (!readCache() && getHomeData().levels.length <= 0) {
var guide = new GuideCon(); var guide = new GuideCon();
this.addChild(guide); this.addChild(guide);
guide.play(1) guide.play(1)
...@@ -126,9 +126,9 @@ export default class MapScene extends Scene { ...@@ -126,9 +126,9 @@ export default class MapScene extends Scene {
this.stage.once(egret.TouchEvent.TOUCH_TAP, () => { this.stage.once(egret.TouchEvent.TOUCH_TAP, () => {
if (!MapScene['firstPlayBgTag']) { if (!MapScene['firstPlayBgTag']) {
if(getBgOn()) { if (getBgOn()) {
playBg(); playBg();
} }
MapScene['firstPlayBgTag'] = true; MapScene['firstPlayBgTag'] = true;
} }
}, this); }, this);
...@@ -300,25 +300,25 @@ export default class MapScene extends Scene { ...@@ -300,25 +300,25 @@ export default class MapScene extends Scene {
const data = getHomeData(); const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) { if (data.canReceiveTreasureBoxNum > 0) {
this['boxLayer'].visible = true; this['boxLayer'].visible = true;
if(!this._mc) if (!this._mc)
this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']); this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']);
this._mc.stop(); this._mc.stop();
this._mc.gotoAndStop(1); this._mc.gotoAndStop(1);
this._mc.anchorOffsetX = 750/2; this._mc.anchorOffsetX = 750 / 2;
this._mc.anchorOffsetY = 500+50+30; this._mc.anchorOffsetY = 500 + 50 + 30;
this._mc.x=750/2; this._mc.x = 750 / 2;
this._mc.y=500+50+30; this._mc.y = 500 + 50 + 30;
this._mc.visible=false; this._mc.visible = false;
await wait(50); await wait(50);
this._mc.visible=true; this._mc.visible = true;
const a = 100,b = 10; const a = 100, b = 10;
egret.Tween.get(this._mc,{loop:true}).set({rotation:b}) egret.Tween.get(this._mc, { loop: true }).set({ rotation: b })
.to({rotation:-b},a).to({rotation:b},a) .to({ rotation: -b }, a).to({ rotation: b }, a)
.to({rotation:-b},a).to({rotation:b},a) .to({ rotation: -b }, a).to({ rotation: b }, a)
.to({rotation:-b},a).to({rotation:b},a) .to({ rotation: -b }, a).to({ rotation: b }, a)
.to({rotation:0},a/2) .to({ rotation: 0 }, a / 2)
.wait(1000); .wait(1000);
} }
} }
...@@ -333,10 +333,18 @@ export default class MapScene extends Scene { ...@@ -333,10 +333,18 @@ export default class MapScene extends Scene {
async onPlaySTOP() { async onPlaySTOP() {
return new Promise((r) => { return new Promise((r) => {
this._mc.once(egret.Event.COMPLETE, () => { const func = () => {
this._mc.stop(); if (this._mc.currentFrame >= 100) {
r(); this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, this);
}, this); this._mc.stop();
r();
}
}
this._mc.addEventListener(egret.Event.ENTER_FRAME, func, this);
// this._mc.once(egret.Event.COMPLETE, () => {
// this._mc.stop();
// r();
// }, this);
}); });
} }
......
import getResPath from "../../../libs/new_tc/getResPath"; import getResPath from "../../../libs/new_tc/getResPath";
import { writeCache, getCacheKey } from "../../mapScene/GuideCon"; import { writeCache, getCacheKey } from "../../mapScene/GuideCon";
const rrr = "//yun.duiba.com.cn/db_games/xxlguide/"; const rrr = "//yun.duiba.com.cn/db_games/xxlguide/1/";
/** /**
* 引导 * 引导
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
], ],
"remainEnargy": 9979, "remainEnargy": 9979,
"askForEnergy": false, "askForEnergy": false,
"canReceiveTreasureBoxNum": 0, "canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 150 "nextRangeStarsNum": 150
} }
} }
\ No newline at end of file
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