Commit d2f51f38 authored by zjz1994's avatar zjz1994

猩猩的特效消除

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