Commit b8c8ebde authored by wjf's avatar wjf

l

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