Commit e071b49f authored by zjz1994's avatar zjz1994

铺草暂存

parent 53c5c73d
......@@ -5398,9 +5398,14 @@
"name": "wormhole_png"
},
{
"name": "startscenebg_jpg",
"url": "assets/startscenebg.jpg",
"type": "image",
"url": "assets/startscenebg.jpg"
"name": "startscenebg_jpg"
},
{
"url": "assets/mainScene/ele41.png",
"type": "image",
"name": "ele41_png"
}
]
}
\ No newline at end of file
This diff is collapsed.
......@@ -23,9 +23,12 @@ export default async (thisObj: MainScene) => {
for (const index of indexs) {
const lat: Lattice = thisObj.lattices[index];
let canturgrass = thisObj.judgeTurfing(index);
let grassArr = new Array();
var turfCp = new Array();
// let canturgrass = thisObj.judgeTurfing(index);
// let grassArr = new Array();
// var turfCp = new Array();
var mainidxs:Array<number> = new Array();
var allidxs:Array<number> = new Array();
mainidxs.push(index);
lat.element['fish'].toExplose();
// wait(1000).then(()=>{
const p = Tool.getPositionByIndex(index);
......@@ -33,31 +36,35 @@ export default async (thisObj: MainScene) => {
boomAni.scaleX = boomAni.scaleY = 1;
// });
for (var i = 0; i < thisObj.lattices.length; i++) {
if(canturgrass&&thisObj.lattices[i]&&Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2){
if(lat&&lat.element){
if(lat.element.type==ElementType.CANNO&&!lat.grass){
turfCp.push(i);
}else if(lat.element.type==ElementType.Pongo&&!lat.element.hasState(StateType.PongoLockState)&&!lat.grass){
turfCp.push(i);
}
}
// if(canturgrass&&thisObj.lattices[i]&&Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2){
// if(lat&&lat.element){
// if(lat.element.type==ElementType.CANNO&&!lat.grass){
// turfCp.push(i);
// }else if(lat.element.type==ElementType.Pongo&&!lat.element.hasState(StateType.PongoLockState)&&!lat.grass){
// turfCp.push(i);
// }
// }
// }
if(thisObj.lattices[i]&&Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2){
allidxs.push(i);
}
if (Tool.judgeEliminate(thisObj.lattices[i]) &&
(Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2)) {
if (thisObj.eliminatedElements.indexOf(thisObj.lattices[i].index) < 0) {
if(canturgrass&&Tool.judgeTurfto(thisObj.lattices[i])){
grassArr.push(i);
}
// if(canturgrass&&Tool.judgeTurfto(thisObj.lattices[i])){
// grassArr.push(i);
// }
thisObj.eliminatedElements.push(thisObj.lattices[i].index);
}
}
}
if(grassArr.length>0){
thisObj.changeGroGrass(grassArr);
}
if(turfCp.length>0){
thisObj.changeGroGrassCp(turfCp);
}
thisObj.addNewTurf(mainidxs,allidxs);
// if(grassArr.length>0){
// thisObj.changeGroGrass(grassArr);
// }
// if(turfCp.length>0){
// thisObj.changeGroGrassCp(turfCp);
// }
}
await wait(500);
......
......@@ -1336,9 +1336,9 @@ export class Tool {
let ele = lat.element;
let canChosen = this.judgeChosen(ele);
if(!canChosen){
if(ele.type==ElementType.CANNO){
if(ele.type==ElementType.CANNO&&lat.grass){
return true;
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)){
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)&&lat.grass){
return true;
}
// console.log("铺出去55555555555555");
......@@ -1367,9 +1367,9 @@ export class Tool {
let ele = lat.element;
let canChosen = this.judgeChosen(ele);
if(!canChosen){
if(ele.type==ElementType.CANNO){
if(ele.type==ElementType.CANNO&&!lat.grass){
return true;
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)){
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)&&!lat.grass){
return true;
}
return false;
......
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