Commit d2f51f38 authored by zjz1994's avatar zjz1994

猩猩的特效消除

parent f4b7962a
...@@ -1502,6 +1502,9 @@ export default class MainScene extends Scene { ...@@ -1502,6 +1502,9 @@ export default class MainScene extends Scene {
} }
} }
} }
//特效消除猩猩
this.checkPongoHVEle(rc[0],rc[1],"hor");
this.checkPongoHVEle(rc[0],rc[1],"vir");
setTimeout(() => { setTimeout(() => {
this._converyorTag = true; this._converyorTag = true;
...@@ -2662,6 +2665,9 @@ export default class MainScene extends Scene { ...@@ -2662,6 +2665,9 @@ export default class MainScene extends Scene {
cannoFireArr.push(iemitidx); cannoFireArr.push(iemitidx);
} }
} }
//特效消除猩猩--炮弹
var lockPongoArr:Array<{idx:number,part:string}> = new Array();
for(var j=0;j<cannoFireArr.length;j++){ for(var j=0;j<cannoFireArr.length;j++){
var jemitidx = cannoFireArr[j]; var jemitidx = cannoFireArr[j];
var lat = this.lattices[jemitidx]; var lat = this.lattices[jemitidx];
...@@ -2677,6 +2683,11 @@ export default class MainScene extends Scene { ...@@ -2677,6 +2683,11 @@ export default class MainScene extends Scene {
break; break;
} }
} }
//提前消除了,需要修改成炮台的消除时消除
if(lat&&lat.element){
var isbreak = this.solveOneTxPgEle(lat.element.row,lat.element.column,lockPongoArr);
}
} }
canno.fireCanno(); canno.fireCanno();
...@@ -2689,6 +2700,9 @@ export default class MainScene extends Scene { ...@@ -2689,6 +2700,9 @@ export default class MainScene extends Scene {
// this.readyCannoArr.shift(); // this.readyCannoArr.shift();
// canno.resetCannoStat(); // canno.resetCannoStat();
// },200); // },200);
this.solvePongoEle(lockPongoArr);
} }
getCannoArrByIdx(cannoidx:number){ getCannoArrByIdx(cannoidx:number){
var arridx:number = 0; var arridx:number = 0;
...@@ -2967,6 +2981,12 @@ export default class MainScene extends Scene { ...@@ -2967,6 +2981,12 @@ export default class MainScene extends Scene {
} }
} }
} }
//特效消除猩猩
this.checkPongoHVEle(lat1.row,lat1.column,"hor");
this.checkPongoHVEle(lat1.row,lat1.column,"vir");
} }
//一个方向,一个爆炸 //一个方向,一个爆炸
else if((ele1.effectType < 2 || ele2.effectType < 2) && else if((ele1.effectType < 2 || ele2.effectType < 2) &&
...@@ -3400,6 +3420,10 @@ export default class MainScene extends Scene { ...@@ -3400,6 +3420,10 @@ export default class MainScene extends Scene {
npdata.ineffect = true; npdata.ineffect = true;
} }
} }
//特效消除猩猩
this.checkPongoHVEle(row,lat.column,"hor");
break; break;
case EffectType.VERTICAL: case EffectType.VERTICAL:
if(sounds.indexOf(SoundType.line) == -1) sounds.push(SoundType.line) if(sounds.indexOf(SoundType.line) == -1) sounds.push(SoundType.line)
...@@ -3452,6 +3476,10 @@ export default class MainScene extends Scene { ...@@ -3452,6 +3476,10 @@ export default class MainScene extends Scene {
npdata.ineffect = true; npdata.ineffect = true;
} }
} }
//特效消除猩猩
this.checkPongoHVEle(lat.row,col,"vir");
break; break;
} }
} }
...@@ -3966,18 +3994,37 @@ export default class MainScene extends Scene { ...@@ -3966,18 +3994,37 @@ export default class MainScene extends Scene {
var lockPongoArr:Array<{idx:number,part:string}> = new Array(); var lockPongoArr:Array<{idx:number,part:string}> = new Array();
if(dir=="hor"){ if(dir=="hor"){
//向左穿透猩猩 //向左穿透猩猩
for(var i=col;i>=0;i++){ for(var i=col-1;i>=0;i--){
this.solveOneTxPgEle(row,col,lockPongoArr); var isbreak = this.solveOneTxPgEle(row,i,lockPongoArr);
if(isbreak==2){
break;
}
} }
//向右穿透猩猩 //向右穿透猩猩
for(var i=col;i<Tool.colNum;i++){ for(var i=col+1;i<Tool.colNum;i++){
var isbreak = this.solveOneTxPgEle(row,i,lockPongoArr);
if(isbreak==2){
break;
}
} }
}else if(dir=="vir"){ }else if(dir=="vir"){
//向上
for(var i=row-1;i>=0;i--){
var isbreak = this.solveOneTxPgEle(i,col,lockPongoArr);
if(isbreak==2){
break;
}
}
//向下
for(var i=row+1;i<Tool.rowNum;i++){
var isbreak = this.solveOneTxPgEle(i,col,lockPongoArr);
if(isbreak==2){
break;
}
}
} }
//本次特效消除的猩猩
this.solvePongoEle(lockPongoArr);
} }
solveOneTxPgEle(row:number,col:number,lockPongoArr:Array<{idx:number,part:string}>){ solveOneTxPgEle(row:number,col:number,lockPongoArr:Array<{idx:number,part:string}>){
var eleidx = Tool.rcToIndex(row,col); var eleidx = Tool.rcToIndex(row,col);
......
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