Commit 498edfca authored by wjf's avatar wjf

l

parent d9e23f9b
...@@ -456,7 +456,7 @@ export default class MainBase extends eui.UILayer { ...@@ -456,7 +456,7 @@ export default class MainBase extends eui.UILayer {
this.hcHome(), this.hcHome(),
this.hc_userInfo(), this.hc_userInfo(),
// this.getBackReward(), // this.getBackReward(),
this.hcRedBoobBaseInfo(), // this.hcRedBoobBaseInfo(),
]); ]);
MapScene.adData = DataManager.ins.getData('hc_advert'); MapScene.adData = DataManager.ins.getData('hc_advert');
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -66,6 +66,7 @@ import { CurScoreNum } from '../something/uis/CurScoreNum'; ...@@ -66,6 +66,7 @@ import { CurScoreNum } from '../something/uis/CurScoreNum';
import { FestivalTarget } from '../something/uis/FestivalTarget'; import { FestivalTarget } from '../something/uis/FestivalTarget';
import getRedBombAward, { getRedBombTimes } from '../getRedBombAward'; import getRedBombAward, { getRedBombTimes } from '../getRedBombAward';
import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni'; import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni';
import { RectsWaveAni } from '../something/anisCall/RectsWaveAni';
const aniClass = { const aniClass = {
"BoomAni": BoomAni, "BoomAni": BoomAni,
...@@ -702,7 +703,7 @@ export default class MainScene extends Scene { ...@@ -702,7 +703,7 @@ export default class MainScene extends Scene {
//添加节日元素,条件可能会变 //添加节日元素,条件可能会变
if (fesChapterData.indexOf(this.chapter >> 0) > -1 && if (fesChapterData.indexOf(this.chapter >> 0) > -1 &&
getRedBombTimes() && getRedBombTimes() &&
Math.random() > 0.5 && // Math.random() > 0.5 &&
this.lattices[festivalIndex] && //格子必须有 this.lattices[festivalIndex] && //格子必须有
(Tool.judgeSetFesEle(this.lattices[festivalIndex]) || !this.lattices[festivalIndex].element) //没有元素也行 (Tool.judgeSetFesEle(this.lattices[festivalIndex]) || !this.lattices[festivalIndex].element) //没有元素也行
) { ) {
...@@ -728,6 +729,7 @@ export default class MainScene extends Scene { ...@@ -728,6 +729,7 @@ export default class MainScene extends Scene {
this.lattices[festivalIndex].element.visible = false; this.lattices[festivalIndex].element.visible = false;
ani.play(p, () => { ani.play(p, () => {
this.lattices[festivalIndex].element.visible = true; this.lattices[festivalIndex].element.visible = true;
RectsWaveAni(this.lattices,this.map)
//检查三消 //检查三消
if (this.threeMatch()) { if (this.threeMatch()) {
this.eliminate(); this.eliminate();
......
...@@ -6,6 +6,7 @@ import RedBombRule from "./RedBombRule"; ...@@ -6,6 +6,7 @@ import RedBombRule from "./RedBombRule";
import { getRedBombTimes } from "../getRedBombAward"; import { getRedBombTimes } from "../getRedBombAward";
import { loadSvga } from "../loadSvga"; import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath"; import getResPath from "../../libs/new_tc/getResPath";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RedBombAlertPanel extends Panel { export default class RedBombAlertPanel extends Panel {
async start(data) { async start(data) {
...@@ -24,7 +25,12 @@ export default class RedBombAlertPanel extends Panel { ...@@ -24,7 +25,12 @@ export default class RedBombAlertPanel extends Panel {
mv.once(egret.Event.COMPLETE, () => { mv.once(egret.Event.COMPLETE, () => {
mv.stop(); mv.stop();
this.removeChild(mv); this.removeChild(mv);
this.playNoPrizeAni(); const data = DataManager.ins.getData('hc_redBombAward').data;
if(data){
this.playPrizeAni();
}else{
this.playNoPrizeAni();
}
}, this); }, this);
}); });
...@@ -33,6 +39,8 @@ export default class RedBombAlertPanel extends Panel { ...@@ -33,6 +39,8 @@ export default class RedBombAlertPanel extends Panel {
playNoPrizeAni(){ playNoPrizeAni(){
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => {
//去掉文案
egret.Tween.get(this['group']).to({alpha:0},300);
this.addChild(mv); this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => { mv.once(egret.Event.COMPLETE, () => {
mv.stop(); mv.stop();
...@@ -40,6 +48,21 @@ export default class RedBombAlertPanel extends Panel { ...@@ -40,6 +48,21 @@ export default class RedBombAlertPanel extends Panel {
}); });
} }
playPrizeAni(){
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_prize.svga').then(async (mv: any) => {
//去掉文案
egret.Tween.get(this['group']).to({alpha:0},300);
this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => {
mv.stop();
}, this);
setTimeout(()=>{
mv.setImage("img_2349","//yun.dui88.com/images/201910/e6pmpk2pne.png")
},100)
});
}
showlog() { showlog() {
} }
......
...@@ -32,7 +32,5 @@ export class FesRedBombShowAni extends egret.DisplayObjectContainer { ...@@ -32,7 +32,5 @@ export class FesRedBombShowAni extends egret.DisplayObjectContainer {
Pool.recover(RecoverName.FESREDBOMBSHOW_ANI, this); Pool.recover(RecoverName.FESREDBOMBSHOW_ANI, this);
callback() callback()
}) })
//波纹动效再说,现在来不及
} }
} }
\ No newline at end of file
...@@ -21,52 +21,58 @@ export function RectsWaveAni( ...@@ -21,52 +21,58 @@ export function RectsWaveAni(
var num = 0; var num = 0;
var maxNum = Math.max(rc[0], rc[1], Tool.rowNum - rc[0] - 1, Tool.colNum - rc[1] - 1) var maxNum = Math.max(rc[0], rc[1], Tool.rowNum - rc[0] - 1, Tool.colNum - rc[1] - 1)
//所有格子都填上 //所有格子都填上
while (num < maxNum) { while (num <= maxNum) {
//每一圈所有格子索引 //每一圈所有格子索引
var indexs: number[] = []; var indexs: number[] = [];
var rowMax = rc[0] + num;
var rowMin = rc[0] - num;
var colMax = rc[1] + num;
var colMin = rc[1] - num;
num++; if (num) {
var rowMax = rc[0] + num;
var rowMin = rc[0] - num;
var colMax = rc[1] + num;
var colMin = rc[1] - num;
var colIndexs = rangeIndexs(
colMin >= 0 ? colMin : 0, var colIndexs = rangeIndexs(
colMax < Tool.colNum ? colMax : Tool.colNum - 1 colMin >= 0 ? colMin : 0,
) colMax < Tool.colNum ? colMax : Tool.colNum - 1
var rowIndexs = rangeIndexs( )
rowMin >= 0 ? rowMin : 0, var rowIndexs = rangeIndexs(
rowMax < Tool.rowNum ? rowMax : Tool.rowNum - 1, rowMin >= 0 ? rowMin : 0,
false rowMax < Tool.rowNum ? rowMax : Tool.rowNum - 1,
) false
//上排,行数一致,列数在之内 )
if (rowMin >= 0) { //上排,行数一致,列数在之内
for (var i = 0; i < colIndexs.length; i++) { if (rowMin >= 0) {
var index = Tool.rcToIndex(rowMin, colIndexs[i]); for (var i = 0; i < colIndexs.length; i++) {
if (lattices[index]) indexs.push(index) var index = Tool.rcToIndex(rowMin, colIndexs[i]);
if (lattices[index]) indexs.push(index)
}
} }
} //下排
//下排 if (rowMax < Tool.rowNum) {
if (rowMax < Tool.rowNum) { for (var i = 0; i < colIndexs.length; i++) {
for (var i = 0; i < colIndexs.length; i++) { var index = Tool.rcToIndex(rowMax, colIndexs[i]);
var index = Tool.rcToIndex(rowMax, colIndexs[i]); if (lattices[index]) indexs.push(index)
if (lattices[index]) indexs.push(index) }
} }
} //左边
//左边 if (colMin >= 0) {
if (colMin >= 0) { for (var i = 0; i < rowIndexs.length; i++) {
for (var i = 0; i < rowIndexs.length; i++) { var index = Tool.rcToIndex(rowIndexs[i], colMin);
var index = Tool.rcToIndex(colMin, rowIndexs[i]); if (lattices[index]) indexs.push(index)
if (lattices[index]) indexs.push(index) }
} }
} //右边
//右边 if (colMax < Tool.colNum) {
if (colMax < Tool.colNum) { for (var i = 0; i < rowIndexs.length; i++) {
for (var i = 0; i < rowIndexs.length; i++) { var index = Tool.rcToIndex(rowIndexs[i], colMax);
var index = Tool.rcToIndex(colMax, rowIndexs[i]); if (lattices[index]) indexs.push(index)
if (lattices[index]) indexs.push(index) }
} }
}else{
indexs.push(centerIndex)
} }
var loop = [] var loop = []
//根据索引 //根据索引
...@@ -83,9 +89,33 @@ export function RectsWaveAni( ...@@ -83,9 +89,33 @@ export function RectsWaveAni(
} }
//总 //总
loops.push(loop); loops.push(loop);
// console.log(indexs)
num++;
} }
//动画 //动画
let loopsLen = loops.length
for (let m = 0; m < loops.length; m++) {
let loop = loops[m];
let wait = m * 100;
let loopLen = loop.length;
for (let n = 0; n < loop.length; n++) {
let rect = loop[n];
egret.Tween.get(rect)
.wait(wait)
.to({ alpha: 1 }, 150)
.to({ alpha: 0 }, 150)
.call(() => {
//回收
if(rect.parent){
rect.parent.removeChild(rect);
whiteRectPool.push(rect);
}
if (m == loopsLen-1 && n == loopLen-1 && callback) callback();
})
}
}
} }
class WhiteRect extends egret.Bitmap { class WhiteRect extends egret.Bitmap {
...@@ -93,8 +123,8 @@ class WhiteRect extends egret.Bitmap { ...@@ -93,8 +123,8 @@ class WhiteRect extends egret.Bitmap {
super(); super();
var texture: egret.Texture = RES.getRes("rectLatWhite_png"); var texture: egret.Texture = RES.getRes("rectLatWhite_png");
this.texture = texture; this.texture = texture;
this.x = -texture.textureWidth / 2; this.anchorOffsetX = texture.textureWidth / 2;
this.y = -texture.textureHeight / 2; this.anchorOffsetY = texture.textureHeight / 2;
} }
} }
......
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