Commit d2762aba authored by wildfirecode's avatar wildfirecode

1

parent 7a29bbb9
......@@ -34,7 +34,7 @@ export default class MapScene extends Scene {
}
stopGamebg();
if (!readCache() && getHomeData().levels.length <=0) {
if (!readCache() && getHomeData().levels.length <= 0) {
var guide = new GuideCon();
this.addChild(guide);
guide.play(1)
......@@ -126,9 +126,9 @@ export default class MapScene extends Scene {
this.stage.once(egret.TouchEvent.TOUCH_TAP, () => {
if (!MapScene['firstPlayBgTag']) {
if(getBgOn()) {
if (getBgOn()) {
playBg();
}
}
MapScene['firstPlayBgTag'] = true;
}
}, this);
......@@ -300,25 +300,25 @@ export default class MapScene extends Scene {
const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) {
this['boxLayer'].visible = true;
if(!this._mc)
if (!this._mc)
this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']);
this._mc.stop();
this._mc.gotoAndStop(1);
this._mc.anchorOffsetX = 750/2;
this._mc.anchorOffsetY = 500+50+30;
this._mc.x=750/2;
this._mc.y=500+50+30;
this._mc.visible=false;
this._mc.anchorOffsetX = 750 / 2;
this._mc.anchorOffsetY = 500 + 50 + 30;
this._mc.x = 750 / 2;
this._mc.y = 500 + 50 + 30;
this._mc.visible = false;
await wait(50);
this._mc.visible=true;
const a = 100,b = 10;
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:0},a/2)
.wait(1000);
this._mc.visible = true;
const a = 100, b = 10;
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: 0 }, a / 2)
.wait(1000);
}
}
......@@ -333,10 +333,18 @@ export default class MapScene extends Scene {
async onPlaySTOP() {
return new Promise((r) => {
this._mc.once(egret.Event.COMPLETE, () => {
this._mc.stop();
r();
}, this);
const func = () => {
if (this._mc.currentFrame >= 100) {
this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, 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 { 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 @@
],
"remainEnargy": 9979,
"askForEnergy": false,
"canReceiveTreasureBoxNum": 0,
"canReceiveTreasureBoxNum": 10,
"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