Commit 45c5db23 authored by wjf's avatar wjf

l

parent a945e2dc
...@@ -78,7 +78,6 @@ export class GameGuide extends egret.DisplayObjectContainer { ...@@ -78,7 +78,6 @@ export class GameGuide extends egret.DisplayObjectContainer {
hideSelf() { hideSelf() {
if (this.parent) this.parent.removeChild(this); if (this.parent) this.parent.removeChild(this);
console.log(this.stepCount)
if (!this.stepCount) { if (!this.stepCount) {
//计入缓存 //计入缓存
writeCache(getCacheKey() + this.thisObj.chapter); writeCache(getCacheKey() + this.thisObj.chapter);
...@@ -324,6 +323,22 @@ const chapterFuns = { ...@@ -324,6 +323,22 @@ const chapterFuns = {
"小心!会蔓延的果冻!\n消除果冻旁边的动物\n就能消除果冻~" "小心!会蔓延的果冻!\n消除果冻旁边的动物\n就能消除果冻~"
] ]
}, },
//鸡蛋
61: {
stepCount: 1,
showIndexs: [
[66, 57, 48, 39],
],
hideIndexs: [
[48, 39],
],
handIndexs: [
[66, 57]
],
msg: [
"鸡蛋边上不断有动物消除时,会孵出小鸡"
]
},
//灰毛球 //灰毛球
101: { 101: {
stepCount: 1, stepCount: 1,
...@@ -339,6 +354,22 @@ const chapterFuns = { ...@@ -339,6 +354,22 @@ const chapterFuns = {
msg: [ msg: [
"灰毛球每步会随机选择\n相邻的格子跳动~\n移动一步试试吧" "灰毛球每步会随机选择\n相邻的格子跳动~\n移动一步试试吧"
] ]
},
//褐色毛球
121: {
stepCount: 1,
showIndexs: [
[55, 56, 65, 47],
],
hideIndexs: [
[65, 47],
],
handIndexs: [
[55, 56]
],
msg: [
"需用特效将褐色毛球分裂成\n两个灰色毛球,才能将它消除"
]
} }
} }
......
...@@ -493,6 +493,7 @@ export default class MainScene extends Scene { ...@@ -493,6 +493,7 @@ export default class MainScene extends Scene {
for (var i = 0; i < connectedLats.length; i++) { for (var i = 0; i < connectedLats.length; i++) {
//0是上格子,1是下格子 //0是上格子,1是下格子
var connectedLat = connectedLats[i]; var connectedLat = connectedLats[i];
if (!connectedLat || !connectedLat.length) continue;
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];
...@@ -651,7 +652,7 @@ export default class MainScene extends Scene { ...@@ -651,7 +652,7 @@ export default class MainScene extends Scene {
//初始化引导,游戏和道具 //初始化引导,游戏和道具
initGuide() { initGuide() {
//游戏引导 //游戏引导
const gameGuideChapterNum = [1, 2, 3, 5, 8, 9, 10, 12, 17, 25, 41,101] const gameGuideChapterNum = [1, 2, 3, 5, 8, 9, 10, 12, 17, 25, 41, 61, 101, 121]
if (gameGuideChapterNum.indexOf(this.chapter >> 0) > -1) { if (gameGuideChapterNum.indexOf(this.chapter >> 0) > -1) {
if (!readCache(getCacheKey() + this.chapter)) { if (!readCache(getCacheKey() + this.chapter)) {
this.gameGuide = new GameGuide(this); this.gameGuide = new GameGuide(this);
...@@ -2302,10 +2303,11 @@ export default class MainScene extends Scene { ...@@ -2302,10 +2303,11 @@ export default class MainScene extends Scene {
var r = Tool.getForwardRotation(stepPosition, [ele.x, ele.y]) var r = Tool.getForwardRotation(stepPosition, [ele.x, ele.y])
bonusShootAni.play(r * 180 / Math.PI, [ele.x, ele.y], () => { bonusShootAni.play(r * 180 / Math.PI, [ele.x, ele.y], () => {
ele.effectType = Math.random() > 0.5 ? EffectType.HORIZONTAL : EffectType.VERTICAL; ele.effectType = Math.random() > 0.5 ? EffectType.HORIZONTAL : EffectType.VERTICAL;
count++; //去掉所有状态
ele.removeAllState();
this.eliminatedElements.push(ele.index); this.eliminatedElements.push(ele.index);
this.pushScoreAni(baseScore * 1 * 1.5, [ele.x, ele.y]) this.pushScoreAni(baseScore * 1 * 1.5, [ele.x, ele.y])
if (count == countAll) { if (++count == countAll) {
this.eliminate(); this.eliminate();
//如果还有步数就置0 //如果还有步数就置0
if (this.steps) { if (this.steps) {
......
...@@ -259,7 +259,7 @@ export const Chapters2: ChapterData[] = [ ...@@ -259,7 +259,7 @@ export const Chapters2: ChapterData[] = [
connectedLats: [[2, 29], [3, 30], [4, 31], [74, 6], [75, 7], [76, 8]] connectedLats: [[2, 29], [3, 30], [4, 31], [74, 6], [75, 7], [76, 8]]
}, },
}, },
//25 待调整 //25
{ {
baseElementTypes: [0, 1, 2, 3], baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0, bubbleProbability: 0,
......
...@@ -118,7 +118,9 @@ export const Chapters3: ChapterData[] = [ ...@@ -118,7 +118,9 @@ export const Chapters3: ChapterData[] = [
} }
}, },
//43 //43
{ baseElementTypes: [0, 1, 2, 3, 4], bubbleProbability: 0, stepCount: 22, passTarget: { type: 1, elements: [{ type: 9, count: 41 }] }, starScores: [5000, 15000, 22000], map: { lattices: [0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0], connectedLats: [], elements: [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 4, 1, 1, 0, 0, 0, 1, 1, 4, 5, 4, 1, 1, 0, 1, 1, 4, 5, 5, 5, 4, 1, 1, 0, 1, 1, 4, 5, 4, 1, 1, 0, 0, 0, 1, 1, 4, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 4, type: 0 }, { index: 12, type: 0 }, { index: 14, type: 0 }, { index: 20, type: 0 }, { index: 24, type: 0 }, { index: 28, type: 0 }, { index: 34, type: 0 }, { index: 36, type: 0 }, { index: 44, type: 0 }] } }, {
baseElementTypes: [0, 1, 2, 3, 4], bubbleProbability: 0, stepCount: 22, passTarget: { type: 1, elements: [{ type: 9, count: 41 }] }, starScores: [5000, 15000, 22000], map: { lattices: [0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0], connectedLats: [], elements: [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 4, 1, 1, 0, 0, 0, 1, 1, 4, 5, 4, 1, 1, 0, 1, 1, 4, 5, 5, 5, 4, 1, 1, 0, 1, 1, 4, 5, 4, 1, 1, 0, 0, 0, 1, 1, 4, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 4, type: 0 }, { index: 12, type: 0 }, { index: 14, type: 0 }, { index: 20, type: 0 }, { index: 24, type: 0 }, { index: 28, type: 0 }, { index: 34, type: 0 }, { index: 36, type: 0 }, { index: 44, type: 0 }] }
},
//44 //44
{ {
baseElementTypes: [0, 1, 2, 3, 4], baseElementTypes: [0, 1, 2, 3, 4],
...@@ -221,7 +223,9 @@ export const Chapters3: ChapterData[] = [ ...@@ -221,7 +223,9 @@ export const Chapters3: ChapterData[] = [
} }
}, },
//46 //46
{ baseElementTypes: [0, 1, 2, 3, 4], bubbleProbability: 0, stepCount: 32, passTarget: { type: 1, elements: [{ type: 9, count: 50 }] }, starScores: [6000, 14000, 25000], map: { lattices: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1], connectedLats: [], elements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 1, 2, 1, 2, 2, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 0, 0, 1, 1, 2, 2, 2, 2, 1, 0, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 4, 4, 4, 4, 4, 2, 1, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 12, type: 0 }, { index: 13, type: 0 }, { index: 14, type: 0 }, { index: 20, type: 0 }, { index: 24, type: 0 }, { index: 28, type: 0 }, { index: 34, type: 0 }, { index: 45, type: 0 }, { index: 53, type: 0 }] } }, {
baseElementTypes: [0, 1, 2, 3, 4], bubbleProbability: 0, stepCount: 32, passTarget: { type: 1, elements: [{ type: 9, count: 50 }] }, starScores: [6000, 14000, 25000], map: { lattices: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1], connectedLats: [], elements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 1, 2, 1, 2, 2, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 0, 0, 1, 1, 2, 2, 2, 2, 1, 0, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 4, 4, 4, 4, 4, 2, 1, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 12, type: 0 }, { index: 13, type: 0 }, { index: 14, type: 0 }, { index: 20, type: 0 }, { index: 24, type: 0 }, { index: 28, type: 0 }, { index: 34, type: 0 }, { index: 45, type: 0 }, { index: 53, type: 0 }] }
},
//47 //47
{ {
baseElementTypes: [0, 1, 2, 3], baseElementTypes: [0, 1, 2, 3],
...@@ -445,7 +449,9 @@ export const Chapters3: ChapterData[] = [ ...@@ -445,7 +449,9 @@ export const Chapters3: ChapterData[] = [
//52 //52
{ baseElementTypes: [0, 1, 2, 4, 3], bubbleProbability: 0, stepCount: 43, passTarget: { type: 1, elements: [{ type: 6, count: 4 }] }, starScores: [6000, 12000, 21000], map: { lattices: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], connectedLats: [], elements: [1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 1, 1, 1, 5, 1, 1], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 0, type: 0 }, { index: 1, type: 0 }, { index: 2, type: 0 }, { index: 3, type: 0 }, { index: 4, type: 0 }, { index: 5, type: 0 }, { index: 6, type: 0 }, { index: 7, type: 0 }, { index: 8, type: 0 }] } }, { baseElementTypes: [0, 1, 2, 4, 3], bubbleProbability: 0, stepCount: 43, passTarget: { type: 1, elements: [{ type: 6, count: 4 }] }, starScores: [6000, 12000, 21000], map: { lattices: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], connectedLats: [], elements: [1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 1, 1, 1, 5, 1, 1], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 0, type: 0 }, { index: 1, type: 0 }, { index: 2, type: 0 }, { index: 3, type: 0 }, { index: 4, type: 0 }, { index: 5, type: 0 }, { index: 6, type: 0 }, { index: 7, type: 0 }, { index: 8, type: 0 }] } },
//53 //53
{ baseElementTypes: [0, 1, 2, 3, 4], bubbleProbability: 0, stepCount: 30, passTarget: { type: 1, elements: [{ type: 9, count: 34 }] }, starScores: [6000, 14000, 24000], map: { lattices: [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1], connectedLats: [], elements: [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 1, 1, 1, 1, 1, 2, 4, 2, 4, 2, 1, 1, 1, 2, 4, 2, 0, 2, 4, 2, 1, 2, 4, 2, 0, 0, 0, 2, 4, 2, 4, 2, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 2, type: 0 }, { index: 3, type: 0 }, { index: 4, type: 0 }, { index: 5, type: 0 }, { index: 6, type: 0 }, { index: 10, type: 0 }, { index: 16, type: 0 }, { index: 18, type: 0 }, { index: 26, type: 0 }] } }, {
baseElementTypes: [0, 1, 2, 3, 4], bubbleProbability: 0, stepCount: 30, passTarget: { type: 1, elements: [{ type: 9, count: 34 }] }, starScores: [6000, 14000, 24000], map: { lattices: [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1], connectedLats: [], elements: [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 1, 1, 1, 1, 1, 2, 4, 2, 4, 2, 1, 1, 1, 2, 4, 2, 0, 2, 4, 2, 1, 2, 4, 2, 0, 0, 0, 2, 4, 2, 4, 2, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 2, type: 0 }, { index: 3, type: 0 }, { index: 4, type: 0 }, { index: 5, type: 0 }, { index: 6, type: 0 }, { index: 10, type: 0 }, { index: 16, type: 0 }, { index: 18, type: 0 }, { index: 26, type: 0 }] }
},
//54 //54
{ {
baseElementTypes: [1, 2, 3, 4], baseElementTypes: [1, 2, 3, 4],
......
...@@ -6,7 +6,7 @@ import { ElementType } from "../enum/ElementType"; ...@@ -6,7 +6,7 @@ import { ElementType } from "../enum/ElementType";
* 61到80关数据 * 61到80关数据
*/ */
export const Chapters4: ChapterData[] = [ export const Chapters4: ChapterData[] = [
//61 鸡蛋引导,待调整 //61 鸡蛋引导 待加引导
{ {
baseElementTypes: [0, 4, 2, 3], baseElementTypes: [0, 4, 2, 3],
bubbleProbability: 0, bubbleProbability: 0,
...@@ -39,14 +39,14 @@ export const Chapters4: ChapterData[] = [ ...@@ -39,14 +39,14 @@ export const Chapters4: ChapterData[] = [
], ],
baseElements: [ baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 50, 30, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 30, 50, 50, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 50, 50, 40, 40, 10, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 40, 0, 10, 20, 30, 0, 10, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 40, 0, 10, 20, 50, 0, 30, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 40, 20, 40, 30, 30, 50, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 40, 10, 10, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 50, 30, 30, 0, 0, 0,
], ],
recycles: [], recycles: [],
generateLats: [ generateLats: [
...@@ -149,7 +149,8 @@ export const Chapters4: ChapterData[] = [ ...@@ -149,7 +149,8 @@ export const Chapters4: ChapterData[] = [
map: { map: {
lattices: [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], lattices: [1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
connectedLats: [[45, 2], [53, 6]], connectedLats: [[45, 2], [53, 6]],
elements: [1, 0, 1, 0, 1, 0, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [55, 61, 65, 69, 75, 76, 77], generateLats: [{ index: 0, type: null }, { index: 4, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 12, type: null }, { index: 14, type: null }, { index: 16, type: null }] } elements: [1, 0, 1, 0, 1, 0, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [55, 61, 65, 69, 75, 76, 77], generateLats: [{ index: 0, type: null }, { index: 4, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 12, type: null }, { index: 14, type: null }, { index: 16, type: null }]
}
}, },
//78 //78
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,10 +4,14 @@ import { Chapters2 } from "./Chapter2"; ...@@ -4,10 +4,14 @@ import { Chapters2 } from "./Chapter2";
import { Chapters3 } from "./Chapter3"; import { Chapters3 } from "./Chapter3";
import { Chapters4 } from "./Chapter4"; import { Chapters4 } from "./Chapter4";
import { Chapters5 } from "./Chapter5"; import { Chapters5 } from "./Chapter5";
import { Chapters6 } from "./Chapter6";
import { Chapters7 } from "./Chapter7";
import { Chapters8 } from "./Chapter8";
import { Chapters9 } from "./Chapter9";
import { Chapters10 } from "./Chapter10";
import { PassTargetData } from "../interface/PassTargetData"; import { PassTargetData } from "../interface/PassTargetData";
import { PassType } from "../enum/PassType"; import { PassType } from "../enum/PassType";
import { submitTran } from "../enum/ElementType"; import { submitTran } from "../enum/ElementType";
import { Chapters6 } from "./Chapter6";
//所有的关卡 //所有的关卡
const chapters: ChapterData[] = [].concat( const chapters: ChapterData[] = [].concat(
...@@ -17,6 +21,10 @@ const chapters: ChapterData[] = [].concat( ...@@ -17,6 +21,10 @@ const chapters: ChapterData[] = [].concat(
Chapters4, Chapters4,
Chapters5, Chapters5,
Chapters6, Chapters6,
Chapters7,
Chapters8,
Chapters9,
Chapters10,
) )
/** /**
* 获取关卡数据,返回关卡数据 * 获取关卡数据,返回关卡数据
...@@ -37,29 +45,30 @@ var a = { ...@@ -37,29 +45,30 @@ var a = {
"twoStarScore": 15000, "twoStarScore": 15000,
"threeStarScore": 32000 "threeStarScore": 32000
}; };
(function exportFile(chapters: ChapterData[]) { //取数据格式用,一般情况注释
var obj = [] // (function exportFile(chapters: ChapterData[]) {
for (var i = 1; i < chapters.length; i++) { // var obj = []
var chapter: ChapterData = chapters[i] // for (var i = 1; i < chapters.length; i++) {
var target: PassTargetData = chapter.passTarget // var chapter: ChapterData = chapters[i]
var a: any = {}; // var target: PassTargetData = chapter.passTarget
a["levelNum"] = i; // var a: any = {};
a["levelTarget"] = []; // a["levelNum"] = i;
if (target.type == PassType.SCORE_TARGET) { // a["levelTarget"] = [];
a["levelTarget"].push({ "targetType": 1, "targetNum": target.score }) // if (target.type == PassType.SCORE_TARGET) {
} else { // a["levelTarget"].push({ "targetType": 1, "targetNum": target.score })
for (var j = 0; j < target.elements.length; j++) { // } else {
var element = target.elements[j]; // for (var j = 0; j < target.elements.length; j++) {
a["levelTarget"].push({ "targetType": submitTran[element.type], "targetNum": element.count }) // var element = target.elements[j];
} // a["levelTarget"].push({ "targetType": submitTran[element.type], "targetNum": element.count })
} // }
// }
a["oneStarScore"] = chapter.starScores[0]; // a["oneStarScore"] = chapter.starScores[0];
a["twoStarScore"] = chapter.starScores[1]; // a["twoStarScore"] = chapter.starScores[1];
a["threeStarScore"] = chapter.starScores[2]; // a["threeStarScore"] = chapter.starScores[2];
obj.push(a) // obj.push(a)
} // }
// var file = new File([JSON.stringify(obj)], "cfg.json", { type: "text/plain;charset=utf-8" }); // var file = new File([JSON.stringify(obj)], "cfg.json", { type: "text/plain;charset=utf-8" });
// window["saveAs"](file); // window["saveAs"](file);
})(chapters) // })(chapters)
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ import { VerticalBgAni } from "../periodAni/VerticalBgAni"; ...@@ -8,7 +8,7 @@ import { VerticalBgAni } from "../periodAni/VerticalBgAni";
import { ExplosiveBgAni } from "../periodAni/ExplosiveBgAni"; import { ExplosiveBgAni } from "../periodAni/ExplosiveBgAni";
import { ChickenEgg } from "./ChickenEgg"; import { ChickenEgg } from "./ChickenEgg";
import { State } from "./State"; import { State } from "./State";
import { StateType } from "../enum/StateType"; import { StateType, stateDatas } from "../enum/StateType";
import { LockState } from "../states/LockState"; import { LockState } from "../states/LockState";
import { HairballBrownState } from "../states/HairballBrownState"; import { HairballBrownState } from "../states/HairballBrownState";
...@@ -187,34 +187,7 @@ export class Element extends eui.Component { ...@@ -187,34 +187,7 @@ export class Element extends eui.Component {
this.effectType = null; this.effectType = null;
this.temEffectType = null; this.temEffectType = null;
//所有状态重置 //所有状态重置
for (var i = 0; i < this.states.length; i++) { this.removeAllState();
let state = this.states[i];
if (!state) continue
//直接移除
this.removeChild(state);
//直接回收
var recoverType: RecoverName
switch (i) {
case StateType.LOCK:
recoverType = RecoverName.LOCK_STATE;
break;
case StateType.BUBBLE:
recoverType = RecoverName.BUBBLE_STATE;
break;
case StateType.HAIRBALLGREY:
recoverType = RecoverName.HAIRBALLGREY_STATE;
break;
case StateType.HAIRBALLBLACK:
recoverType = RecoverName.HAIRBALLBLACK_STATE;
break;
case StateType.HAIRBALLBROWN:
recoverType = RecoverName.HAIRBALLBROWN_STATE;
break;
}
Pool.recover(recoverType, state);
//置空
this.states[i] = null;
}
//如果类型是鸡蛋 //如果类型是鸡蛋
if (type == ElementType.CHICKEN_EGG) { if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = this.chickenEgg || Pool.takeOut(RecoverName.CHICKEN_EGG) this.chickenEgg = this.chickenEgg || Pool.takeOut(RecoverName.CHICKEN_EGG)
...@@ -343,56 +316,20 @@ export class Element extends eui.Component { ...@@ -343,56 +316,20 @@ export class Element extends eui.Component {
} }
//没有的话加上 //没有的话加上
else { else {
switch (state) { var stateData = stateDatas[state];
case StateType.LOCK: var recoverName: RecoverName = stateData.recoverName;
let lockState = Pool.takeOut(RecoverName.LOCK_STATE); var className = stateData.className;
if (!lockState) { let stateEx = Pool.takeOut(recoverName);
lockState = new LockState(); if (!stateEx) {
} else { stateEx = new className(data);
lockState.reset()
}
this.states[state] = lockState;
break;
case StateType.BUBBLE:
let bubbleState = Pool.takeOut(RecoverName.BUBBLE_STATE);
if (!bubbleState) {
bubbleState = new BubbleState(data);
} else {
bubbleState.reset(data)
}
this.states[state] = bubbleState;
this.showImage.alpha = 0;
break;
case StateType.HAIRBALLGREY:
let hairballGreyState = Pool.takeOut(RecoverName.HAIRBALLGREY_STATE);
if (!hairballGreyState) {
hairballGreyState = new HairballGreyState();
} else { } else {
hairballGreyState.reset() stateEx.reset(data)
}
this.states[state] = hairballGreyState;
break;
case StateType.HAIRBALLBLACK:
let hairballBlackState = Pool.takeOut(RecoverName.HAIRBALLBLACK_STATE);
if (!hairballBlackState) {
hairballBlackState = new HairballBlackState();
} else {
hairballBlackState.reset()
}
this.states[state] = hairballBlackState;
break;
case StateType.HAIRBALLBROWN:
let hairballBrowState = Pool.takeOut(RecoverName.HAIRBALLBROWN_STATE);
if (!hairballBrowState) {
hairballBrowState = new HairballBrownState();
} else {
hairballBrowState.reset()
}
this.states[state] = hairballBrowState;
break;
} }
this.states[state] = stateEx;
//视图添加 //视图添加
this.addChild(this.states[state]); this.addChild(this.states[state]);
//气泡定制逻辑
if (state === StateType.BUBBLE) this.showImage.alpha = 0;
} }
} }
} }
...@@ -407,7 +344,21 @@ export class Element extends eui.Component { ...@@ -407,7 +344,21 @@ export class Element extends eui.Component {
} }
return false return false
} }
/**
* 去掉所有状态
*/
removeAllState() {
for (var i = 0; i < this.states.length; i++) {
let state = this.states[i];
if (!state) continue
//直接移除
this.removeChild(state);
//直接回收
Pool.recover(stateDatas[i].recoverName, state);
//置空
this.states[i] = null;
}
}
/** /**
* 取得一个状态 * 取得一个状态
* @param state * @param state
......
import { RecoverName } from "./RecoverName";
import { BubbleState } from "../states/BubbleState";
import { LockState } from "../states/LockState";
import { HairballGreyState } from "../states/HairballGreyState";
import { HairballBrownState } from "../states/HairballBrownState";
import { HairballBlackState } from "../states/HairballBlackState";
/** /**
* 状态类型 * 状态类型
*/ */
...@@ -8,3 +15,13 @@ export enum StateType { ...@@ -8,3 +15,13 @@ export enum StateType {
HAIRBALLBROWN,//褐色毛球 ,只能特效消除 HAIRBALLBROWN,//褐色毛球 ,只能特效消除
HAIRBALLBLACK,//黑色毛球 ,两次消除,一次闭眼 HAIRBALLBLACK,//黑色毛球 ,两次消除,一次闭眼
} }
//与上面的枚举顺序一致
export const stateDatas: { recoverName: RecoverName, className: any }[] = [
{ recoverName: RecoverName.BUBBLE_STATE, className: BubbleState },
{ recoverName: RecoverName.LOCK_STATE, className: LockState },
{ recoverName: RecoverName.HAIRBALLGREY_STATE, className: HairballGreyState },
{ recoverName: RecoverName.HAIRBALLBROWN_STATE, className: HairballBrownState },
{ recoverName: RecoverName.HAIRBALLBLACK_STATE, className: HairballBlackState },
]
\ No newline at end of file
...@@ -21,6 +21,8 @@ export class LockState extends State { ...@@ -21,6 +21,8 @@ export class LockState extends State {
reset() { reset() {
this.alpha = 1; this.alpha = 1;
} }
//要不要把动画放在这里,这种移除动效最好统一外面,常驻动效才
recover() { recover() {
egret.Tween.get(this) egret.Tween.get(this)
.to({ alpha: 0 }, 750) .to({ alpha: 0 }, 750)
......
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