Commit 2e1b1e16 authored by wjf's avatar wjf

l

parent 043dfd8f
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -161,7 +161,15 @@ export default class MainScene extends Scene { ...@@ -161,7 +161,15 @@ export default class MainScene extends Scene {
//每一步生成的总分数 //每一步生成的总分数
oneStepScore: number; oneStepScore: number;
//果冻有消除的标记; //果冻有消除的标记;
jellyBrokenMark: boolean jellyBrokenMark: boolean;
/**
* 判断连通的状态
* 1表示存在小列连通到大列,从右往左遍历
* 2表示存在大列连通到小烈,从左往右遍历
* 3表示都有,遍历两边,down的大,从右先
* 4表示都有,遍历两边,down的小,从左先
*/
connectState: number = 2;
//皮肤上的 //皮肤上的
public starProgress: eui.Image; public starProgress: eui.Image;
public scoreTxt: eui.Label; public scoreTxt: eui.Label;
...@@ -206,6 +214,7 @@ export default class MainScene extends Scene { ...@@ -206,6 +214,7 @@ export default class MainScene extends Scene {
egret.Tween.get(this.scoreProgress, {}, null, true) egret.Tween.get(this.scoreProgress, {}, null, true)
.to({ score: value }, 300) .to({ score: value }, 300)
} }
//道具按钮上的数字
boomBtnNum: PropNumShow; boomBtnNum: PropNumShow;
hammerBtnNum: PropNumShow; hammerBtnNum: PropNumShow;
stepBtnNum: PropNumShow; stepBtnNum: PropNumShow;
...@@ -471,13 +480,42 @@ export default class MainScene extends Scene { ...@@ -471,13 +480,42 @@ export default class MainScene extends Scene {
} }
//设置生成口, //设置生成口,
this.generateIndexs = Tool.setGenerateLats(this.lattices, this.chapterData.map.generateLats || []) this.generateIndexs = Tool.setGenerateLats(this.lattices, this.chapterData.map.generateLats || [])
var downMax: number = 0;
var downMin: number = Tool.colNum - 1;
var hasSmallToBig: boolean;
var hasBigToSmall: boolean;
//联通口 //联通口
var connectedLats = this.chapterData.map.connectedLats || []; var connectedLats = this.chapterData.map.connectedLats || [];
for (var i = 0; i < connectedLats.length; i++) { for (var i = 0; i < connectedLats.length; i++) {
var connectedLat = connectedLats[i]; var connectedLat = connectedLats[i];
this.lattices[connectedLat[0]].down = connectedLat[1]; this.lattices[connectedLat[0]].down = connectedLat[1];
this.lattices[connectedLat[1]].up = connectedLat[0]; this.lattices[connectedLat[1]].up = connectedLat[0];
var colUp = Tool.indexToRc(connectedLat[0])[1];
var colDown = Tool.indexToRc(connectedLat[1])[1];
if (colUp > colDown) {
hasBigToSmall = true;
}
else if (colUp < colDown) {
hasSmallToBig = true;
}
}
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down的大,从右先
//4表示都有,遍历两边,down的小,从左先
if (hasBigToSmall && hasSmallToBig) {
} }
else if (hasBigToSmall) {
this.connectState = 2;
}
else if (hasSmallToBig) {
this.connectState = 1;
}
//否则默认的2
} }
//初始化地图元素 //初始化地图元素
initElement() { initElement() {
...@@ -1021,6 +1059,8 @@ export default class MainScene extends Scene { ...@@ -1021,6 +1059,8 @@ export default class MainScene extends Scene {
if (/*!this.fallVerMark ||*/ Tool.judgeOutOne(this.emptys, this.lattices)) { if (/*!this.fallVerMark ||*/ Tool.judgeOutOne(this.emptys, this.lattices)) {
// this.fallVerMark = true; // this.fallVerMark = true;
var anis = this.fallVerticalEx(); var anis = this.fallVerticalEx();
anis = anis.concat(this.fallVerticalEx())
// anis = anis.concat(this.fallSkewEx())
if (!anis.length) { if (!anis.length) {
anis = this.fallSkewEx() anis = this.fallSkewEx()
if (!anis.length) { if (!anis.length) {
...@@ -1099,11 +1139,18 @@ export default class MainScene extends Scene { ...@@ -1099,11 +1139,18 @@ export default class MainScene extends Scene {
/** /**
* 一次性都竖直掉落 * 一次性都竖直掉落
* 有问题
* 如果 存在小列连通到大列,从右往左遍历
* 如果 存在大列连通到小烈,从左往右遍历
* 都存在,遍历两边
*/ */
fallVerticalEx() { fallVerticalEx() {
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down的大,从右先
//4表示都有,遍历两边,down的小,从左先
var anis: FallAniData[] = [] var anis: FallAniData[] = []
//先把竖直的掉落完,掉满后 let operation = (m) => {
for (var m = 0; m < Tool.colNum; m++) {
//同一列,先原有的填满,再查是否有生成口 //同一列,先原有的填满,再查是否有生成口
for (var n = Tool.rowNum - 1; n >= 0; n--) { for (var n = Tool.rowNum - 1; n >= 0; n--) {
let index = Tool.rcToIndex(n, m); let index = Tool.rcToIndex(n, m);
...@@ -1164,6 +1211,20 @@ export default class MainScene extends Scene { ...@@ -1164,6 +1211,20 @@ export default class MainScene extends Scene {
} }
} }
} }
if (this.connectState == 1) {
for (var m = Tool.colNum; m >= 0; m++)operation(m)
}
else if (this.connectState == 2) {
for (var m = 0; m < Tool.colNum; m++) operation(m)
}
else if (this.connectState == 3) {
for (var m = Tool.colNum; m >= 0; m++) operation(m);
for (var m = 0; m < Tool.colNum; m++) operation(m);
}
else if (this.connectState == 4) {
for (var m = 0; m < Tool.colNum; m++) operation(m);
for (var m = Tool.colNum; m >= 0; m++) operation(m);
}
return anis; return anis;
} }
......
...@@ -845,7 +845,6 @@ export class Tool { ...@@ -845,7 +845,6 @@ export class Tool {
isThrough = true; isThrough = true;
} else { } else {
indexDown = lattice.index + this.colNum; indexDown = lattice.index + this.colNum;
} }
let lastEmptyIndex: number; let lastEmptyIndex: number;
//下方有格子,并且再this.empty中 //下方有格子,并且再this.empty中
......
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