Commit 0cb7766d authored by wjf's avatar wjf

l

parent eac2d9e6
......@@ -514,7 +514,7 @@ export default class MainScene extends Scene {
//位置
var p = Tool.getPositionByIndex(i);
//石门
var dooreData = [5, 6, 51, 61]
var dooreData = [4, 5, 6, 51, 61]
if (dooreData.indexOf(latticesD[i]) >= 0) {
let door: Door = Pool.takeOut(RecoverName.DOOR);
var closed: boolean = (latticesD[i] + "").length == 2 ? false : true
......@@ -603,7 +603,7 @@ export default class MainScene extends Scene {
for (var i = 0; i < elements.length; i++) {
//如果对应格子为空,直接跳过,
if (!this.lattices[i]) continue;
var p = Tool.getPositionByIndex(i);
let ele: Element;
switch (elements[i]) {
//如果为0记录空格
case 0:
......@@ -617,16 +617,7 @@ export default class MainScene extends Scene {
case 9:
case 10:
var type = Tool.returnType(i, this.lattices, this.chapterData.baseElementTypes);
let ele: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!ele) {
ele = new Element(type)
} else {
ele.reset(type)
}
ele.x = p[0];
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[i].element = ele;
ele = Tool.getElement(type)
if (elements[i] == 4) {
ele.setState(StateType.LOCK, true)
}
......@@ -647,56 +638,37 @@ export default class MainScene extends Scene {
else if (elements[i] == 10) {
ele.setState(StateType.HAIRBALLBLACK, true)
}
break;
//棒棒糖
case 3:
this.lollipopCount++;
let lol: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!lol) {
lol = new Element(ElementType.LOLLIPOP)
} else {
lol.reset(ElementType.LOLLIPOP)
}
lol.x = p[0];
lol.y = p[1];
this.elementContainer.addChild(lol);
this.lattices[i].element = lol;
ele = Tool.getElement(ElementType.LOLLIPOP)
break;
//石头
case 2:
let rock: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!rock) {
rock = new Element(ElementType.ROCK)
} else {
rock.reset(ElementType.ROCK)
}
rock.x = p[0];
rock.y = p[1];
this.elementContainer.addChild(rock);
this.lattices[i].element = rock;
ele = Tool.getElement(ElementType.ROCK)
break;
//果冻
case 5:
let jelly: Element = Tool.getElement(ElementType.JELLY)
jelly.x = p[0];
jelly.y = p[1];
this.elementContainer.addChild(jelly);
this.lattices[i].element = jelly;
ele = Tool.getElement(ElementType.JELLY)
break;
//鸡蛋
case 6:
let egg: Element = Tool.getElement(ElementType.CHICKEN_EGG)
egg.x = p[0];
egg.y = p[1];
this.elementContainer.addChild(egg);
this.lattices[i].element = egg;
ele = Tool.getElement(ElementType.CHICKEN_EGG)
break;
default:
//其他标识按空元素记
this.emptys.push(i);
break
}
//有元素操作
if (ele) {
var p = Tool.getPositionByIndex(i);
ele.x = p[0];
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[i].element = ele;
}
//针对石门修改
if (this.lattices[i].doorClosed) {
if (this.lattices[i].element) {
......@@ -1614,10 +1586,7 @@ export default class MainScene extends Scene {
this.lollipopMark = true
}
}
count++;
if (count == countAll) {
callback()
}
if (++count == countAll) callback();
})
}
......@@ -2607,8 +2576,7 @@ export default class MainScene extends Scene {
egret.Tween.get(ele)
.to({ x: p[0], y: p[1] }, 500)
.call(() => {
count++;
if (count == countAll) {
if (++count == countAll) {
//交换结束后,判断是否有三消
if (this.threeMatch()) {
this.eliminate()
......
......@@ -495,10 +495,7 @@ export class AiControl {
bubbleAni.play(fromType, type, () => {
//显示
ele.visible = true;
count++;
if (count == countAll) {
callback();
}
if (++count == countAll) callback();
})
}
}
......
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