Commit e9bcbca9 authored by wildfirecode's avatar wildfirecode

1

parent 799b7543
......@@ -610,7 +610,7 @@ export default class MainScene extends Scene {
initConveyor() {
const conveyorList = this.chapterData.map.conveyor;
if(!conveyorList)return;
if (!conveyorList) return;
const tex = RES.getRes('arrowbg_png');
for (const conveyor of conveyorList) {
const dir = getArrowDir(conveyor);
......@@ -620,10 +620,9 @@ export default class MainScene extends Scene {
arrow.rotation = getArrowRotation(dir);
this.conveyor.addChild(arrow);
const p = Tool.getPositionByIndex(i);
this.conveyorMap[i]=arrow;
this.conveyorMap[i] = arrow;
arrow.x = p[0];
arrow.y = p[1];
// egret.Tween.get(arrow).to({y:p[1]+500},7000)
});
}
}
......@@ -2058,8 +2057,6 @@ export default class MainScene extends Scene {
}
await doConveyorAI(this);
await doSandAI(this);
if(this.lattices.some(lat=>!lat.element))
throw new Error('123')
const doHoneyPotAIResult = await doHoneyPotAI(this);
if (doHoneyPotAIResult.length > 0) {//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
doHoneyPotAIResult.forEach((index) => {
......
import { ARROW_DIR, fillConveyor, findTarget, getArrowDir } from "../something/conveyor/conveyorTool";
import MainScene from "./MainScene";
import { Tool } from "../something/Tool";
import { Lattice } from "../something/class/Lattice";
const getTargetIndexs = (conveyor: number[]) => {
const dir = getArrowDir(conveyor);
......@@ -10,23 +11,44 @@ const getTargetIndexs = (conveyor: number[]) => {
} else if (dir == ARROW_DIR.LEFT || dir == ARROW_DIR.UP) {
list.unshift(list.pop());
}
return list;
}
let conveyorAniList: { [key: string]: ConveyorAni; } = null;
//单个皮带转动动效
class ConveyorAni {
private orign: any[];
private list: any[];
private views: any[] = []
constructor(conveyor) {
this.list = fillConveyor(conveyor);
this.orign = JSON.parse(JSON.stringify(this.list));
this.views = this.list;
}
play() {
}
}
export default async (thisObj: MainScene) => {
//移动了传送带之后,可能会有可消除的,需要检查消除
//加上传送带的动画
//移动的动画,如果是两头的需要一个带遮罩的动画
//检查与其他元素的兼容性
const conveyorList = thisObj.chapterData.map.conveyor;
if (!conveyorList) return;
const elementsList = []; //所有轨道元素组的列表
const targetLatticesList = []; //所有轨道目标地图组的列表
const targetLatticesList: Lattice[][] = []; //所有轨道目标地图组的列表
const latticesList = []; //所有轨道当前地图组的列表
const targetIndexsList = [];
let listItems = [];
if (!conveyorAniList) conveyorAniList = {};
for (const conveyor of conveyorList) {
const list = fillConveyor(conveyor);
listItems = listItems.concat(list);
const targetIndexs = getTargetIndexs(conveyor);
conveyorAniList[conveyor.toString()] = new ConveyorAni(conveyor);
const dir = getArrowDir(conveyor);
let foundTarget: number;
......@@ -47,21 +69,8 @@ export default async (thisObj: MainScene) => {
targetLatticesList.push(targetLattices);
latticesList.push(lattices);
targetIndexsList.push(targetIndexs);
// lattices.forEach(lat => lat.element = null);
// list.forEach((index, i) => {
// const c = thisObj.conveyorMap[index];
// const targetP = Tool.getPositionByIndex(targetIndexs[i]);
// egret.Tween.get(c).to({ x: targetP[0], y: targetP[1] }, 200);
// });
// elements.forEach((ele, i) => {
// targetLattices[i].element = ele;
// const targetP = Tool.getPositionByIndex(targetIndexs[i]);
// egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 200);
}
listItems.forEach(item => thisObj.conveyorMap[item] = null);
latticesList.forEach(lattices => {
lattices.forEach(lat => lat.element = null);
});
......@@ -75,11 +84,9 @@ export default async (thisObj: MainScene) => {
elements.forEach((ele, eleIndex) => {
targetLattices[eleIndex].element = ele;
const targetP = Tool.getPositionByIndex(targetIndexs[eleIndex]);
const promise = new Promise((r) => {
egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 500).call(r);
egret.Tween.get(ele).to({ x: targetP[0], y: targetP[1] }, 200).call(r);
});
promiseList.push(promise)
});
});
......
......@@ -31,15 +31,19 @@ export const Chapters20: ChapterData[] = [
],
conveyor: [
// [29,56],
// [57,60],
// [51, 33],
[29,56],
[57,60],
[51, 33],
[32, 30],
],
conveyorConnectedLats: [
// [56,57],
// [60,29],
// [56,51],
// [33,29],
[56,57],
[60,51],
[33, 32],
[30, 51],
[30, 29],
],
generateLats: [
{ index: 11, type: [0], cus: [] },
......
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//451-471
export const Chapters18: ChapterData[] = [
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45,
},
],
},
starScores: [1000, 5000, 10000],
map: {
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
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,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
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,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 20, 0, 0, 0, 20, 0, 0,
0, 20, 10, 20, 0, 20, 10, 20, 0,
20, 10, 20, 10, 20, 10, 20, 10, 20,
20, 10, 20, 20, 10, 20, 20, 10, 20,
0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 0, 20, 10, 20, 10, 20, 0, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0,
0, 0, 0, 0, 20, 0, 0, 0, 0,
],
// recycles: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//501-525
export const Chapters20: ChapterData[] = [
{
baseElementTypes: [0, 1, 2, 3, 4],
bubbleProbability: 0,
stepCount: 999,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 995,
},
],
},
starScores: [1000, 5000, 10000],
map: {
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
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,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
conveyor: [
[29,56],
[57,60],
[51, 33],
[32, 30],
],
conveyorConnectedLats: [
[56,57],
[60,51],
[33, 32],
[30, 29],
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[76, 11]],
elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
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,
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: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
......@@ -27,6 +27,11 @@ export class Lattice {
get element(): Element {
return this._element
}
private _conveyor;
get conveyor() {
return this._conveyor
}
/**
* value为null或元素
*/
......
......@@ -2513,6 +2513,131 @@
"levelNum": 500,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 501,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 502,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 503,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 504,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 505,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 506,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 507,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 508,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 509,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 510,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 511,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 512,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 513,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 514,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 515,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 516,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 517,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 518,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 519,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 520,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 521,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 522,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 523,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 524,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 525,
"maxScore": 47440,
"stars": 1
}
],
......
......@@ -2513,6 +2513,131 @@
"levelNum": 500,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 501,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 502,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 503,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 504,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 505,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 506,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 507,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 508,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 509,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 510,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 511,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 512,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 513,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 514,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 515,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 516,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 517,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 518,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 519,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 520,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 521,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 522,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 523,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 524,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 525,
"maxScore": 47440,
"stars": 1
}
],
......
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