Commit 649bd363 authored by wjf's avatar wjf

l

parent 55eca18d
......@@ -215,7 +215,7 @@ export default class MainScene extends Scene {
super.start();
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
this.chapter = 81;
// this.chapter = 81;
this.chapterTxt.text = "第" + this.chapter + "关";
//关卡数据,1期定制,70,后面35关地图一致,步数减少
var mapDataIndex = this.chapter;
......
/**
* 鸡蛋的状态
*
*/
export class ChickenEgg extends eui.Image {
/**
* 小鸡数量
*/
private chickenNum: number = 0;
/**
* 鸡蛋状态变化 3 2 1 0 再往后,直接加孵鸡次数
*/
private _statusNum: number;
get statusNum() {
return this._statusNum
}
set statusNum(value: number) {
if (value >= 0) {
this._statusNum = value;
} else {
this._statusNum = 0;
this.chickenNum++;
}
}
constructor(n: number = 3) {
super()
this.source = "ele7_png";
//图片需要居中
this.chickenNum = 0;
this._statusNum = n;
}
reset(n: number = 3) {
//图片修改
this.chickenNum = 0;
this._statusNum = n;
}
/**
* 孵蛋动作
*/
hatch(callback: Function) {
if (!this.chickenNum) {
callback();
return
}
}
}
\ No newline at end of file
......@@ -70,7 +70,12 @@ export class AiControl {
}
}
}
/**
* 鸡蛋得孵化逻辑
* 与果冻不同,需要执行一次threeMatch,如无再执行callback,否则执行eleminate
* @param thisObj
* @param callback
*/
private eggMotion(thisObj: MainScene, callback: Function) {
if (!this.hasEgg) {
callback();
......@@ -120,7 +125,6 @@ function judgeEggExist(lattices: Lattice[]) {
*/
function getJellySpreadAni(lattices: Lattice[]) {
var indexs: number[] = [];
var hasJelly: boolean = false;
for (var i = 0; i < lattices.length; i++) {
var lattice = lattices[i]
//没有格子或没有元素或不是果冻 跳过
......@@ -165,3 +169,5 @@ function judgeSpread(index: number, lattices: Lattice[]): number {
}
return null
}
//
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