Commit 8d6024fb authored by wjf's avatar wjf

l

parent 051f1658
...@@ -63,22 +63,22 @@ const aniClass = { ...@@ -63,22 +63,22 @@ const aniClass = {
const baseScore = 20; const baseScore = 20;
/** /**
* 直线特效(4) 1.5倍 * 直线特效(4) 1.5倍
* 爆炸特效(L) 2.0 * 爆炸特效(L) 2.5
* 魔力鸟(5) 2.5倍 * 魔力鸟(5) 5倍
* 直线+直线(4+4) 3.0倍 * 直线+直线(4+4) 10倍
* 直线+炸弹(4+L) 3.5倍 * 直线+炸弹(4+L) 15倍
* 炸弹+炸弹(L+L) 4.0 * 炸弹+炸弹(L+L) 25
* 魔力鸟+魔力鸟(5+5) 5.0倍 * 魔力鸟+魔力鸟(5+5) 50倍
*/ */
const effectBaseTimes = { const effectBaseTimes = {
0: 1.5, 0: 1.5,
1: 1.5, 1: 1.5,
2: 2, 2: 2.5,
3: 2.5, 3: 5, // //前四个就是特效类型
4: 3, LL: 10,
5: 3.5, EL: 15,
6: 4, EE: 25,
7: 5 MM: 50
} }
...@@ -199,7 +199,7 @@ export default class MainScene extends Scene { ...@@ -199,7 +199,7 @@ export default class MainScene extends Scene {
Tool.init(); Tool.init();
//第几关 //第几关
this.chapter = (data && data.chapter) ? data.chapter : 1; this.chapter = (data && data.chapter) ? data.chapter : 1;
// this.chapter = 33; this.chapter = 33;
this.chapterTxt.text = "第" + this.chapter + "关"; this.chapterTxt.text = "第" + this.chapter + "关";
//关卡数据,1期定制,70,后面35关地图一致,步数减少 //关卡数据,1期定制,70,后面35关地图一致,步数减少
var mapDataIndex = this.chapter; var mapDataIndex = this.chapter;
...@@ -635,7 +635,7 @@ export default class MainScene extends Scene { ...@@ -635,7 +635,7 @@ export default class MainScene extends Scene {
} }
} }
onTap_quitBtn() { onTap_quitBtn() {
PanelCtrl.instance.show("quit"); PanelCtrl.instance.show("quit", { level: this.chapter });
} }
onTap_boomBtn() { onTap_boomBtn() {
NetManager.ins.showLog(getlogItem(7)); NetManager.ins.showLog(getlogItem(7));
...@@ -743,8 +743,8 @@ export default class MainScene extends Scene { ...@@ -743,8 +743,8 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(i) == -1) { if (this.eliminatedElements.indexOf(i) == -1) {
this.eliminatedElements.push(i); this.eliminatedElements.push(i);
if (!lat.element.isLock) { if (!lat.element.isLock) {
//3倍 //算直线+直线LL
this.pushScoreAni(baseScore * 1 * 3, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * 1 * effectBaseTimes.LL, Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1340,9 +1340,9 @@ export default class MainScene extends Scene { ...@@ -1340,9 +1340,9 @@ export default class MainScene extends Scene {
var lat = this.lattices[i]; var lat = this.lattices[i];
if (Tool.judgeEliminate(lat)) { if (Tool.judgeEliminate(lat)) {
this.eliminatedElements.push(i); this.eliminatedElements.push(i);
//5倍 //两个魔力鸟分数MM
if (!lat.element.isLock/*&&lat.element.effectType==null*/) { if (!lat.element.isLock/*&&lat.element.effectType==null*/) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * 5, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.MM, Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1391,8 +1391,8 @@ export default class MainScene extends Scene { ...@@ -1391,8 +1391,8 @@ export default class MainScene extends Scene {
} }
} }
if (!lat.element.isLock) { if (!lat.element.isLock) {
//2.5倍 //魔力鸟和
this.pushScoreAni(baseScore * this.effectContinuityTimes * 2.5, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["3"], Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1413,8 +1413,8 @@ export default class MainScene extends Scene { ...@@ -1413,8 +1413,8 @@ export default class MainScene extends Scene {
if (Tool.judgeEliminate(lat) && (lat.row == lat1.row || lat.column == lat1.column)) { if (Tool.judgeEliminate(lat) && (lat.row == lat1.row || lat.column == lat1.column)) {
this.eliminatedElements.push(i); this.eliminatedElements.push(i);
if (!lat.element.isLock) { if (!lat.element.isLock) {
//3倍 //线与线
this.pushScoreAni(baseScore * this.effectContinuityTimes * 3, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.LL, Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1437,8 +1437,8 @@ export default class MainScene extends Scene { ...@@ -1437,8 +1437,8 @@ export default class MainScene extends Scene {
(Math.abs(lat.row - lat1.row) < 2 || Math.abs(lat.column - lat1.column) < 2)) { (Math.abs(lat.row - lat1.row) < 2 || Math.abs(lat.column - lat1.column) < 2)) {
this.eliminatedElements.push(i); this.eliminatedElements.push(i);
if (!lat.element.isLock) { if (!lat.element.isLock) {
//3.5倍 //线和炸弹
this.pushScoreAni(baseScore * this.effectContinuityTimes * 3.5, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.EL, Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1462,8 +1462,8 @@ export default class MainScene extends Scene { ...@@ -1462,8 +1462,8 @@ export default class MainScene extends Scene {
(Math.abs(lat.row - lat1.row) < 3 && Math.abs(lat.column - lat1.column) < 3)) { (Math.abs(lat.row - lat1.row) < 3 && Math.abs(lat.column - lat1.column) < 3)) {
this.eliminatedElements.push(i); this.eliminatedElements.push(i);
if (!lat.element.isLock) { if (!lat.element.isLock) {
//4倍 //两个炸弹
this.pushScoreAni(baseScore * this.effectContinuityTimes * 4, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.EE, Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1571,9 +1571,9 @@ export default class MainScene extends Scene { ...@@ -1571,9 +1571,9 @@ export default class MainScene extends Scene {
if (!this.lattices[i].element.isLock && this.lattices[i].element.effectType == null) { if (!this.lattices[i].element.isLock && this.lattices[i].element.effectType == null) {
rotateData.elementsIndex.push(i); rotateData.elementsIndex.push(i);
} }
//2.5倍 //
if (!this.lattices[i].element.isLock) { if (!this.lattices[i].element.isLock) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * 2.5, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["3"], Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1591,9 +1591,9 @@ export default class MainScene extends Scene { ...@@ -1591,9 +1591,9 @@ export default class MainScene extends Scene {
(Math.abs(this.lattices[i].row - lat.row) < 2 && Math.abs(this.lattices[i].column - lat.column) < 2)) { (Math.abs(this.lattices[i].row - lat.row) < 2 && Math.abs(this.lattices[i].column - lat.column) < 2)) {
if (this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) { if (this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
this.eliminatedElements.push(i); this.eliminatedElements.push(i);
//2倍 //
if (!this.lattices[i].element.isLock) { if (!this.lattices[i].element.isLock) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * 2, Tool.getPositionByIndex(i)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["2"], Tool.getPositionByIndex(i))
} }
} }
} }
...@@ -1610,9 +1610,9 @@ export default class MainScene extends Scene { ...@@ -1610,9 +1610,9 @@ export default class MainScene extends Scene {
if (Tool.judgeEliminate(this.lattices[ein])) { if (Tool.judgeEliminate(this.lattices[ein])) {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) { if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein); this.eliminatedElements.push(ein);
//1.5倍 //
if (!this.lattices[ein].element.isLock) { if (!this.lattices[ein].element.isLock) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * 1.5, Tool.getPositionByIndex(ein)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["0"], Tool.getPositionByIndex(ein))
} }
} }
} }
...@@ -1629,9 +1629,9 @@ export default class MainScene extends Scene { ...@@ -1629,9 +1629,9 @@ export default class MainScene extends Scene {
if (Tool.judgeEliminate(this.lattices[ein])) { if (Tool.judgeEliminate(this.lattices[ein])) {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) { if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein); this.eliminatedElements.push(ein);
//1.5倍 //
if (!this.lattices[ein].element.isLock) { if (!this.lattices[ein].element.isLock) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * 1.5, Tool.getPositionByIndex(ein)) this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["1"], Tool.getPositionByIndex(ein))
} }
} }
} }
......
...@@ -494,6 +494,26 @@ export class Tool { ...@@ -494,6 +494,26 @@ export class Tool {
return Tool.randomT(arr); return Tool.randomT(arr);
} }
/**
* 根据关卡的地图数据generateLats
* 设置每列最上面的格子为生成口,
* @param lattices
* @param generateLats [0,1,1,1,1,1,1,1,0]
*/
public static setGenerateLats(lattices: Lattice[], generateLats: number[]) {
for (var m = 0; m < Tool.colNum; m++) {
//找每列第一个元素
for (var g = 0; g < Tool.rowNum; g++) {
var index = Tool.colNum * g + m;
//如果格子存在,并且该列g的数据为1;
if (lattices[index] && generateLats[m]) {
lattices[index].isGenerate = true;
break
}
}
}
}
/** /**
* 从数组移除一个元素 * 从数组移除一个元素
* @param e * @param e
......
...@@ -17,18 +17,19 @@ export interface MapData { ...@@ -17,18 +17,19 @@ export interface MapData {
lattices: number[]; lattices: number[];
/** /**
* 能生成元素的格子索引 * 能生成元素的格子索引
* 默认第一排都能生成 * 代表每列的第一个格子是否是生成口
* 长度9,
* 例子[0,0,0,1,1,1,0,0,0];
*/
generateLats: number[];
/**
* 一维格子数组,步长9
* 0无元素 * 0无元素
* 1普通元素 * 1普通元素
* 2石头 * 2石头
* 3元素枷锁 * 3元素枷锁
* 4棒棒糖 * 4棒棒糖
*/ */
generateLats: number[];
/**
* 一维格子数组,步长9
*
*/
// elements:number[] // elements:number[]
/** /**
* 路径的索引 * 路径的索引
......
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