Commit fd873286 authored by shunx 马's avatar shunx 马

111

parent 3a570370
......@@ -47,8 +47,8 @@ export class BoxGroup extends FYGE.Sprite {
boxGroupUpLeft.forEach(i => {
i.y -= speed;
})
if (boxGroupUpLeft[0].y < -238 ) {
boxGroupUpLeft[0].y = 238*3;
if (boxGroupUpLeft[0].y < -238) {
boxGroupUpLeft[0].y = 238 * 3;
const popBox = boxGroupUpLeft.shift();
boxGroupUpLeft.push(popBox);
}
......@@ -62,18 +62,21 @@ export class BoxGroup extends FYGE.Sprite {
boxGroupUpRight.forEach(i => {
i.y -= speed;
})
if (boxGroupUpRight[0].y < -238 ) {
boxGroupUpRight[0].y = 238*3;
if (boxGroupUpRight[0].y < -238) {
boxGroupUpRight[0].y = 238 * 3;
const popBox = boxGroupUpRight.shift();
boxGroupUpRight.push(popBox);
}
}
handleClick() {
// const indexsvga = new FYGE.MovieClip(RES.getRes('盲盒开启-打开-输出.svga'));
// indexsvga.mouseChildren = indexsvga.mouseEnable = false;
// // indexsvga.position.set(100,100)
// this.addChild(indexsvga);
handleClick(e) {
const indexsvga = new FYGE.MovieClip(RES.getRes('盲盒选中-输出.svga'));
this.dispatchEvent("stopIndexEnterFrame", { isMove: false });
indexsvga.mouseChildren = indexsvga.mouseEnable = false;
indexsvga.position.set(e.target.x-200,e.target.y-190)
this.addChild(indexsvga);
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
showPanel(CostPanel);
});
}
}
......@@ -70,12 +70,18 @@ export class IndexScene extends Scene {
onEnterFrame() {
boxGroup && boxGroup.move();
boxGroup.addEventListener("stopIndexEnterFrame", this.removeEvent, this);
}
toRule() {
showPanel(RulePanel);
}
removeEvent() {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
}
getIndex = async () => {
const result = await sendWebNet(WebNetName.projectIndex);
if (!result.success) return;
......
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