Commit 5dcef6ac authored by wildfirecode's avatar wildfirecode

1

parent c49cdf1e
......@@ -100,6 +100,7 @@ import jellyMonsterAI from './jellyMonsterAI';
import { createHoneyDisAni } from '../effect/createHoneyDisAni';
import Sand, { getSandDisplayBlock } from '../something/Sand';
import { SandAni } from '../something/anis/SandAni';
import doSandAI from './doSandAI';
const aniClass = {
"BoomAni": BoomAni,
......@@ -634,7 +635,6 @@ export default class MainScene extends Scene {
latticeDisplay.x = p[0];
latticeDisplay.y = p[1];
}
}
}
//生成口数据
......@@ -2025,6 +2025,7 @@ export default class MainScene extends Scene {
this.eliminate();
return
}
await doSandAI(this);
const doHoneyPotAIResult = await doHoneyPotAI(this);
if (doHoneyPotAIResult.length > 0) {//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
doHoneyPotAIResult.forEach((index) => {
......
import { ElementType } from "../something/enum/ElementType";
import MainScene from "./MainScene";
import { Tool } from "../something/Tool";
import { Element } from "../something/class/Element";
import { MonsterShootAni } from "../something/anis/MonsterShootAni";
import { Pool } from "../something/Pool";
import { RecoverName } from "../something/enum/RecoverName";
import wait from "../../libs/new_tc/wait";
import { EffectType } from "../something/enum/EffectType";
import { EggBrokenAni } from "../something/anis/EggBrokenAni";
import { StateType } from "../something/enum/StateType";
import { createHoneyBombAni } from "../effect/createHoneyBombAni";
import HoneyPotElement from "../something/class/HoneyPotElement";
import { HoneyPotShootAni } from "../something/anis/HoneyPotShootAni";
import { createHoneyBubbleAni } from "../effect/createHoneyBubbleAni";
import { HoneyPotShootAni } from "../something/anis/HoneyPotShootAni";
import { Element } from "../something/class/Element";
import HoneyPotElement from "../something/class/HoneyPotElement";
import { ElementType } from "../something/enum/ElementType";
import { RecoverName } from "../something/enum/RecoverName";
import { StateType } from "../something/enum/StateType";
import { Pool } from "../something/Pool";
import { Tool } from "../something/Tool";
import MainScene from "./MainScene";
/**
* 罐子爆炸
*/
......@@ -26,7 +23,7 @@ export default async (thisObj: MainScene) => {
lattice.element.canElimite = true;
}
}
console.log('激活的罐子', activeElementIndexs);
// console.log('激活的罐子', activeElementIndexs);
//遍历所有基础元素
const baseElements: Element[] = [];
......
import MainScene from "./MainScene";
import { Lattice } from "../something/class/Lattice";
import { Tool } from "../something/Tool";
/**
* 沙子移动
*/
export default async (thisObj: MainScene) => {
//暂时不考虑这个问题:是否应该避免石头下的沙子移动,因为被石头盖住了看不到
// const sand = thisObj.lattices.filter(lattice => {
// // return lattice.sand && (!lattice.element || lattice.element.type != ElementType.ROCK);
// });
//找出所有的沙子
const sandLattices = thisObj.lattices.filter(lattice => {
return lattice.sand;
});
console.log(sandLattices);
//map promise
//先判断是否能跳动,目前都能跳
for (let i = 0; i < sandLattices.length; i++) {
const sandLattice = sandLattices[i];
const indexEnd = judgeActionIndex(sandLattice.index, thisObj.lattices)
if (indexEnd) {//判断是否有地方可以
//先修改数据,再进行动画播放
const sand = sandLattice.sand;
sandLattice.sand=null;
const latticeEnd = thisObj.lattices[indexEnd];
latticeEnd.sand = sand;
const p = Tool.getPositionByIndex(indexEnd);
egret.Tween.get(sand).to({x:p[0],y:p[1]},200);
// sand.x = p[0];
// sand.y = p[1];
}
}
}
//找到毛球移动的目标位置
const judgeActionIndex = (index: number, lattices: Lattice[]): number => {
//四个方向尽量随机
var arr = [index - Tool.colNum, index + Tool.colNum];
var rc = Tool.indexToRc(index);
var col = rc[1];
//列数大于0才可能有左边格子
if (col > 0) arr.push(index - 1);
//列数不为最右边
if (col < Tool.colNum - 1) arr.push(index + 1);
while (arr.length) {
var rand = Math.floor(Math.random() * arr.length);
var i = arr.splice(rand, 1)[0];
if (Tool.judgeBaseEle(lattices[i]) &&
!lattices[i].element.hasAnyState() &&
!lattices[i].element.candy &&
!lattices[i].sand &&
!lattices[i].element.monster
) {
return i
}
}
return null
}
\ No newline at end of file
......@@ -66,4 +66,5 @@ export enum ElementConfigType {
*/
FISH = 15,
HONEY_POT = 16,
FLOWER = 17,
}
\ No newline at end of file
......@@ -57,6 +57,7 @@ export enum ElementType {
HONEY,// 蜂蜜
HONEY_POT,//蜂蜜罐
SAND,
FLOWER,
}
export const isMonsterEle = (t: ElementType) => {
......
......@@ -2272,6 +2272,121 @@
"levelNum": 452,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 453,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 454,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 455,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 456,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 457,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 458,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 459,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 460,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 461,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 462,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 463,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 464,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 465,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 466,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 467,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 468,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 469,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 470,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 471,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 472,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 473,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 474,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 475,
"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