Commit e99b2ca2 authored by wildfirecode's avatar wildfirecode

1

parent 932e03cd
......@@ -273,7 +273,7 @@ export const Chapters13: ChapterData[] = [
3, 0, 0, 3, 3, 3, 0, 0, 3],
connectedLats: [],
elements: [
1, 1, 1, 1, 1, 1, 1, 1, 1,
11, 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,
......@@ -285,7 +285,7 @@ export const Chapters13: ChapterData[] = [
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 108, 109, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
......@@ -293,18 +293,7 @@ export const Chapters13: ChapterData[] = [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 111, 106, 107, 108, 109, 0,
// 0, 0, 0, 0, 0, 0, 0, 110, 0,
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 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: null }, { index: 3, type: null }, { index: 4, type: null }, { index: 5, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 11, type: null }, { index: 15, type: null }, { index: 16, type: null }]
}
},
//297
{ baseElementTypes: [0, 1, 2, 4], bubbleProbability: 10, stepCount: 20, passTarget: { type: 1, elements: [{ type: 6, count: 4 }] }, starScores: [15000, 20000, 25000], map: { lattices: [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 4, 1, 4, 1, 41, 1, 41, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], connectedLats: [[45, 72], [53, 80]], elements: [1, 3, 2, 1, 3, 1, 2, 3, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 111, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 5, 1, 1, 4, 2, 2, 2, 4, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 5, 2, 2, 2, 2, 2, 2, 2, 1], 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: [72, 73, 74, 75, 76, 77, 78, 79, 80], generateLats: [{ index: 1, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 4, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 7, type: null }] } }
}
]
\ No newline at end of file
import { CandyBaseElementType } from "../enum/ElementType";
import { Element } from "./Element";
export class Candy extends egret.Sprite {
ele;
ele: Element;
nextState(): any {
return new Promise((r) => {
return new Promise(async (r) => {
this._step--;
if(this._step <=0) {
this._step=0;
if (this._step < 0) {
this._step = 0;
}else {
if(this.ele) this.ele.playCandySubAni();
}
const result: any = {
element: this.ele
......@@ -43,6 +46,7 @@ export class Candy extends egret.Sprite {
this.touchEnabled = this.touchChildren = false;
this._step = this.MAX_STEP;
this._nums = new eui.BitmapLabel();
this._nums.y=2;
this._nums.font = 'candynums_fnt';
this.changeText();
this.addChild(this._nums);
......
......@@ -23,11 +23,36 @@ export class Element extends eui.Component {
resetToCandyView(baseElement: CandyBaseElementType) {
const res = transElementRes(baseElement);
this.changeSource("ele" + res + "_png");
this.showImage.x = 0;
this.showImage.y = 0;
this.showImage.anchorOffsetX = this.showImage.width / 2;
this.showImage.anchorOffsetY = this.showImage.height / 2;
this._candy = new Candy();
this._candy.ele = this;
this._candy.baseElement = baseElement;
this.addChild(this._candy);
this.addCandyStandbyAni();
}
playCandySubAni() {
return new Promise((r) => {
egret.Tween.removeTweens(this.showImage);
egret.Tween.get(this.showImage).to({ scaleX: 0, scaleY: 0 }, 200)
.to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.backOut).call(()=>{
this.addCandyStandbyAni();
r();
});
});
}
addCandyStandbyAni() {
egret.Tween.removeTweens(this.showImage);
egret.Tween.get(this.showImage, { loop: true })
.to({ scaleX: 1.1, scaleY: 0.9 }, 500).to({ scaleX: 0.9, scaleY: 1.1 }, 200).to({ scaleX: 1, scaleY: 1 }, 200).wait(1000);
}
/**
* 初始类型
*/
......@@ -199,6 +224,9 @@ export class Element extends eui.Component {
*/
reset(type: ElementType) {
this.alpha = this.scaleX = this.scaleY = 1;
this.showImage.anchorOffsetX = 0;
this.showImage.anchorOffsetY = 0;
egret.Tween.removeTweens(this.showImage);
//类型重置,showImage修改
this._type = type;
this.changeSource("ele" + type + "_png");
......@@ -238,9 +266,9 @@ export class Element extends eui.Component {
this.festivalEle = null;
}
if(this._candy) {
if (this._candy) {
this._candy.parent && this._candy.parent.removeChild(this._candy);
this._candy=null;
this._candy = null;
}
}
......@@ -429,5 +457,5 @@ export class Element extends eui.Component {
ele.y = this.y;
return ele
}
get candy(){return this._candy}
get candy() { return this._candy }
}
\ No newline at end of file
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