Commit c38b861d authored by zjz1994's avatar zjz1994

代码暂存

parent acc6c6af
......@@ -394,7 +394,22 @@ export default class MainScene extends Scene {
//铺草坪
turfingArr:Array<number> = []
turfingArr:Array<number> = [];//当前已有草的格子
//一次掉落前的消除集合
recoverArr:Array<{
turidx:number,
main:Array<{
idx:number,
canturff:boolean,
canturft:boolean,
}>,
all:Array<{
idx:number,
canturff:boolean,
canturft:boolean
}>
}> = [];
constructor(){
super();
window['gm'] = this.gm;
......@@ -2034,8 +2049,7 @@ export default class MainScene extends Scene {
bubble:true,
};
this.turfingArr = new Array();
this.initTurf();
}
//横向消除,不包括炮台石头
getEliHorPassCannoStone(row:number,col:number){
......@@ -2901,6 +2915,8 @@ export default class MainScene extends Scene {
this.eliminate(pcannostatArr);
}, 200)
} else {
//TODO检测铺草,简单起见可以直接把本次小组铺的重新铺一便
//新大炮充能
for(var np=0;np<pcannostatArr.length;np++){
if(this.readyCannoArr.indexOf(np)==-1&&this.fireteamCannoArr.indexOf(np)==-1){
......@@ -2953,6 +2969,7 @@ export default class MainScene extends Scene {
* 掉落完后的操作
*/
async fallCallback() {
this.initTurf();
this.incheckFall = true;
// //掉落后先走猩猩的消除
// if(this.gopongoArr.length>0){//消除猩猩,先播放猩猩消失的动画,后消除
......@@ -6170,4 +6187,50 @@ export default class MainScene extends Scene {
this.turfEliHorPassCp(row,col,turfCp);
this.turfEliVerPassCp(row,col,turfCp);
}
//铺草在一次掉落前,不分先后顺序
initTurf(){
// this.turfingArr = new Array();
this.recoverArr = new Array();
}
/**
*
* idx---格子坐标
* canturff----能否铺出去
* canturft----能够被铺上
*
*/
solveTurf(turfidx:number,main:Array<{idx:number,canturff:boolean,canturft:boolean}>,all:Array<{idx:number,canturff:boolean,canturft:boolean}>){
var canturff = false;
for(var i1=0;i1<main.length;i1++){
var i1data = main[i1];
if(i1data.canturff){
canturff = true;
break;
}
}
var oldneedturfarr:Array<number> = new Array();
if(canturff){
for(var i2=0;i2<all.length;i2++){
var i2data = all[i2];
if(!i2data.canturft){
oldneedturfarr.push(i2data.idx);
}
}
}
var zhijepuArr:Array<number> = new Array();
var freshpuArr:Array<number> = new Array();
for(var i3=0;i3<this.recoverArr.length;i3++){
var i3data = this.recoverArr[i3];
var i3idx = i3data.turidx;
var i3main = i3data.main;
var i3all = i3data.all;
}
}
}
\ No newline at end of file
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