Commit b8c8ebde authored by wjf's avatar wjf

l

parent cc964014
......@@ -273,7 +273,18 @@ export default class MainBase extends eui.UILayer {
for (var i = 0; i <= 9; i++) {
RES.getResAsync("curScoreNum" + i + "_png")
}
for (var i = 5; i <= 14; i++) {
RES.getResAsync("ele" + i + "_png")
}
for (var i = 1; i <= 10; i++) {
RES.getResAsync("fesEleSmallDis" + i + "_png")
}
for (var i = 1; i <= 13; i++) {
RES.getResAsync("lineLight" + i + "_png")
}
var arr = [
"fesRedBigLight", "fesRedBombSta1", "fesRedCap", "fesRedDown", "fesRedSmallLight", "fesRedUp", "xingxingbi",
"tinyRedLeft", "tinyRedMid", "tinyRedRight",
"festivalTargetBg",
"hairballDisBg",
"brownBallFace",
......@@ -310,13 +321,6 @@ export default class MainBase extends eui.UILayer {
// "guideBg",
// "guideKnowBtn",
"bonusShoot",
"ele5",
"ele6",
"ele7",
"ele8",
"ele9",
"ele10",
"ele11",
"leftArrow",
"chooseRect",
"lightedStar",
......@@ -435,7 +439,7 @@ export default class MainBase extends eui.UILayer {
}
protected async createGameScene() {
window['getaward'] = ()=>{getRedBombAward((param)=>{console.log(param)})}
window['getaward'] = () => { getRedBombAward((param) => { console.log(param) }) }
await Promise.all([
this.getAd(),
this.ajaxElement(),
......
This diff is collapsed.
This diff is collapsed.
import { ElementType } from "../enum/ElementType";
import { ElementType, FiveBaseElementTypes } from "../enum/ElementType";
import { EffectType } from "../enum/EffectType";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
......@@ -16,6 +16,7 @@ import { BubbleState } from "../states/BubbleState";
import { HairballGreyState } from "../states/HairballGreyState";
import { HairballBlackState } from "../states/HairballBlackState";
import { Tool } from "../Tool";
import { FestivalEle } from "./FestivalEle";
/**
......@@ -123,6 +124,8 @@ export class Element extends eui.Component {
column: number
//鸡蛋
chickenEgg: ChickenEgg;
//节日红包大
festivalEle: FestivalEle;
/**
* 所有的状态,注意,变色气泡特殊,不能和特效共存,所以初始化时,气泡的不能加特效。生成特效,去掉气泡
......@@ -140,7 +143,7 @@ export class Element extends eui.Component {
this.showImage = new eui.Image();
this.changeSource("ele" + this.type + "_png");
this.addChild(this.showImage);
// this.showImage.touchEnabled=false
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
if (!this.chickenEgg) {
......@@ -150,7 +153,16 @@ export class Element extends eui.Component {
}
this.addChild(this.chickenEgg)
}
//
//节日红包
else if (type == ElementType.FESTIVALELE_BIG) {
this.festivalEle = Pool.takeOut(RecoverName.FESTIVAL_ELE)
if (!this.festivalEle) {
this.festivalEle = new FestivalEle();
} else {
this.festivalEle.reset();
}
this.addChild(this.festivalEle)
}
}
......@@ -206,18 +218,34 @@ export class Element extends eui.Component {
Pool.recover(RecoverName.CHICKEN_EGG, this.chickenEgg);
this.chickenEgg = null;
}
//如果类型是节日红包大
if (type == ElementType.FESTIVALELE_BIG) {
this.festivalEle = this.festivalEle || Pool.takeOut(RecoverName.FESTIVAL_ELE)
if (!this.festivalEle) {
//新建
this.festivalEle = new FestivalEle();
} else {
this.festivalEle.reset();
}
this.addChild(this.festivalEle)
} else if (this.festivalEle) {
this.removeChild(this.festivalEle);
Pool.recover(RecoverName.FESTIVAL_ELE, this.festivalEle);
this.festivalEle = null;
}
}
/**
* 只修改类型,不改变其他状态
* @param type 只应该是基础元素和特殊元素
* 只修改类型,不改变其他状态,主要针对修改基础元素类型
* @param type
*/
resetType(type: ElementType) {
//如果重置成特殊元素,或鸡蛋,或石头,或果冻,或棒棒糖,直接用reset方法
if (type == ElementType.CHICKEN_EGG ||
type == ElementType.ROCK ||
type == ElementType.JELLY ||
type == ElementType.LOLLIPOP) {
//如果类型一致,return
if (this._type == type) return
//如果目标类型不是基础元素 或者原先不是基础元素
if (FiveBaseElementTypes.indexOf(type) == -1 ||
FiveBaseElementTypes.indexOf(this._type) == -1
) {
this.reset(type)
} else {
this._type = type;
......
......@@ -2,7 +2,7 @@ import { ElementType } from "../enum/ElementType";
//三种状态的图片,剩三种了
const images = {
2: "ele" + ElementType.CHICKEN_EGG + "_png",
2: "ele" + ElementType.FESTIVALELE_BIG + "_png",
1: "eggStatus1_png",
0: "eggStatus0_png"
}
......@@ -26,10 +26,10 @@ export class FestivalEle extends eui.Component {
set statusNum(value: number) {
if (value >= 0) {
this._statusNum = value;
//修改图片
if (this.showImage.source != images[this._statusNum]) {
this.changeSource(images[this._statusNum]);
}
//播放动画,然后循环动画
// if (this.showImage.source != images[this._statusNum]) {
// this.changeSource(images[this._statusNum]);
// }
} else {
this._statusNum = 0;
this.isActive = true;
......@@ -70,4 +70,7 @@ export class FestivalEle extends eui.Component {
}
}
\ No newline at end of file
}
// class
\ No newline at end of file
......@@ -34,6 +34,9 @@ export enum RecoverName {
//元素身上的鸡蛋
CHICKEN_EGG = "ChickenEgg",
//元素上的大红包
FESTIVAL_ELE = "FestivalEle",
//所有继承ani的,能单独播放的,不带回调的
ROCK_ANI = "RockAni",
ICE_ANI = "IceAni",
......@@ -49,6 +52,7 @@ export enum RecoverName {
EGGBROKEN_ANI = "EggBrokenAni",
HAIRBALLGREYDIS_ANI = "HairballGreyDisAni",
HAIRBALLBLACKDIS_ANI = "HairballBlackDisAni",
FESTIVALELESMALLDIS_ANI = "FestivalEleSmallDisAni",
//方形遮罩
RECT_MASK = "RectMask",
......
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