Commit d8cb8ff9 authored by zjz1994's avatar zjz1994

修改烟花pro添加重复导致all释放不了引起的页面无法点击问题

parent e221eb03
......@@ -376,6 +376,8 @@ export default class MainScene extends Scene {
//黑洞转移需在所有动画播放完毕后进行
wormHolePromise: Promise<any>[];
//处理烟花的
wormFireworks:any;
//todo
targetContainer:egret.DisplayObjectContainer;
chapterTxt:ChapterNum;
......@@ -1869,6 +1871,7 @@ export default class MainScene extends Scene {
}
if(s) {
this.wormHolePromise = new Array();
this.wormFireworks = {};
//成功的
switch(prop) {
case PropType.BOOM:
......@@ -2058,6 +2061,7 @@ export default class MainScene extends Scene {
mouseDownE(e: egret.TextEvent) {
this.wormHolePromise = new Array();
this.wormFireworks = {};
// if (!this.enableTouch) return
this.initOneElmtTag();
var self = this;
......@@ -2085,6 +2089,8 @@ export default class MainScene extends Scene {
mouseMoveE(e) {
this.wormHolePromise = new Array();
this.wormFireworks = {};
this.initOneElmtTag();
if(this.SELECTED && e.target.parent instanceof Element) {
if(!Tool.judgeChosen(e.target.parent)) return
......@@ -3446,10 +3452,23 @@ export default class MainScene extends Scene {
this._checkMtag.wormhole = false;
let wormholes = this.chapterData.map.WORMHOLE;
if(wormholes&&wormholes.length>0){
console.log("虫洞位移")
console.log("虫洞位移",this.wormHolePromise.length);
await Promise.all(this.wormHolePromise).then(()=>{
console.log("虫洞可以开始移动");
console.log("动画完毕");
});
let fireworkspro = new Array();
for(let firekey in this.wormFireworks){
let ifirepro = this.wormFireworks[firekey];
fireworkspro.push(ifirepro);
}
if(fireworkspro.length>0){
await Promise.all(fireworkspro).then(()=>{
console.log("烟花完毕,虫洞可以开始移动");
})
}
await doWormHoleAI(this);
// console.log("黑洞转移完毕");
......@@ -4634,6 +4653,7 @@ export default class MainScene extends Scene {
//动画
let pro = this.playAni(RecoverName.ICE_ANI, p);
if(Tool.judgeInWormHole(lat.index,this.chapterData.map.WORMHOLE)){
console.log("冰块pro",lat.index);
this.wormHolePromise.push(pro);
}
} else if(lat.block && lat.block.ice && lat.block.canIceBroken && lat.block.ice.alpha!=0) {//石门(可能带冰) && 石门反转了可以消除了
......@@ -4651,6 +4671,7 @@ export default class MainScene extends Scene {
//动画
let pro = this.playAni(RecoverName.ICE_ANI, p);
if(Tool.judgeInWormHole(lat.index,this.chapterData.map.WORMHOLE)){
console.log("石门冰块pro",lat.index);
this.wormHolePromise.push(pro);
}
} else if(lat.sand) {
......@@ -4726,8 +4747,10 @@ export default class MainScene extends Scene {
let isInworm = Tool.judgeInWormHole(index,this.chapterData.map.WORMHOLE);
if(isInworm){
console.error("添加烟花pro");
this.wormHolePromise.push(pro);
console.error("添加烟花pro",lat.index);
// this.wormHolePromise.push(pro);
this.wormFireworks[index] = pro;
}
}
this.goElementTarget(type, [ele.x, ele.y]);
......@@ -5187,6 +5210,7 @@ export default class MainScene extends Scene {
//播放动效
let pro = this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
if(Tool.judgeInWormHole(index,this.chapterData.map.WORMHOLE)){
console.log("石头裂开pro",index);
this.wormHolePromise.push(pro);
}
}
......
......@@ -191,25 +191,26 @@ export const Chapters26: ChapterData[] = [
{ baseElementTypes: [ 1, 2, 0, 4 ], bubbleProbability: 0,
stepCount: 27, passTarget: { type: 1, elements: [ { type: 22, count: 25 }, { type: 24, count: 25 }, { type: 26, count: 25 } ] }, starScores: [ 15000, 20000, 25000 ], map: {
lattices: [
4, 4, 1, 41, 41, 41, 1, 4, 4,
4, 1, 1, 1, 1, 1, 1, 1, 4,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
4, 1, 1, 1, 1, 1, 1, 1, 4,
4, 4, 1, 1, 1, 1, 1, 4, 4 ], connectedLats: [ [ 31, 49 ] ], conveyor: [], conveyorConnectedLats: [], WORMHOLE: [ [ 37, 38 ], [ 42, 43 ] ],
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1 ], connectedLats: [ [ 31, 49 ] ], conveyor: [], conveyorConnectedLats: [],
WORMHOLE: [ [ 37, 38 ], [ 42, 43 ] ],
elements: [
1, 1, 1, 1, 1, 1, 1, 1, 1,
5, 1, 1, 1, 1, 1, 1, 1, 5,
5, 1, 1, 1, 1, 1, 1, 1, 5,
5, 1, 1, 1, 1, 1, 1, 1, 5,
5, 1, 13, 13, 13, 13, 13, 1, 5,
5, 1, 1, 1, 1, 1, 1, 1, 5,
5, 1, 1, 1, 1, 1, 1, 1, 5,
5, 2, 2, 2, 2, 2, 2, 2, 5,
1, 1, 2, 2, 2, 2, 2, 1, 1 ],
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 13, 13, 13, 13, 13, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1 ],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
......
......@@ -78,7 +78,7 @@ chapters.forEach((chapter,index) => {
export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据
// return chapters[626];
return chapters[index] || chapters[655];
return chapters[index] || chapters[1];
}
var a = {
......
......@@ -82,12 +82,14 @@ export class Element extends eui.Component {
private _fireworksTimer = 0;
get canFire() {
const t = new Date().getTime();
// console.log("烟花发射检测",t - this._fireworksTimer > 2 * 1000,t,this._fireworksTimer);
return t - this._fireworksTimer > 2 * 1000;
}
fire(type: ElementType) {// zi hong huang lan lv
let pro;
let pro;
this._fireworksTimer = new Date().getTime();
// console.log("重设发射时间",this._fireworksTimer);
if (type == ElementType.FIREWORKS_RABBIT) //rabbit 紫
pro = this.toFireworksAction(1, 90);
else if (type == ElementType.FIREWORKS_PIG) //pig 粉
......@@ -126,7 +128,7 @@ export class Element extends eui.Component {
if (this._fireworks.currentFrame == end) { //向上吹
this._fireworks.gotoAndStop(start);
this._fireworks.removeEventListener(egret.Event.ENTER_FRAME, cb, this);
console.error("释放烟花pro");
console.error("释放烟花pro",this.index);
resolve();
}
};
......
......@@ -142,6 +142,9 @@ export class Lattice {
}
if(elecf.eledata["type"]||elecf.eledata["type"]==ElementType.RABBIT){
this.element = elecf.ele;
if(elecf.eledata["type"]==ElementType.FIREWORKS_SHOOTER){
// console.log("设置烟花元素",this.index,this.element.index)
}
// console.log("设置元素",this.index,this.element.index)
}else{
// console.log("没设置元素",this.index);
......
......@@ -378,6 +378,7 @@ export class AiControl {
resolve();
})
})
console.log("蛋壳pro",activeEggIndex);
thisObj.wormHolePromise.push(pro);
if (++count == countAll) {
......
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