Commit e3c7f4dd authored by wildfirecode's avatar wildfirecode

1

parent 98bf1fc4
...@@ -210,6 +210,7 @@ export default class MainBase extends eui.UILayer { ...@@ -210,6 +210,7 @@ export default class MainBase extends eui.UILayer {
} }
else { else {
RES.getResAsync('mapredbagicom_png'); RES.getResAsync('mapredbagicom_png');
RES.getResAsync('maplight2_png');
RES.getResAsync('main_mapbottom_png'); RES.getResAsync('main_mapbottom_png');
RES.getResAsync('lightani_png'); RES.getResAsync('lightani_png');
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
}, },
{ {
"name": "preload", "name": "preload",
"keys": "mapredbagicom_png,effect1_json,effect2_json" "keys": "maplight2_png"
} }
], ],
"resources": [ "resources": [
...@@ -3517,21 +3517,26 @@ ...@@ -3517,21 +3517,26 @@
"name": "redbagtips活动规则_png" "name": "redbagtips活动规则_png"
}, },
{ {
"name": "mapredbagicom_png", "url": "assets/map/mapredbagicom.png",
"type": "image", "type": "image",
"url": "assets/map/mapredbagicom.png" "name": "mapredbagicom_png"
}, },
{ {
"name": "effect1_json",
"type": "sheet",
"url": "assets/mc/effect1.json", "url": "assets/mc/effect1.json",
"type": "sheet",
"name": "effect1_json",
"subkeys": "红包爆炸_00000,红包爆炸_00001,红包爆炸_00002,红包爆炸_00003,红包爆炸_00004,红包爆炸_00005,红包爆炸_00006,红包爆炸_00007,红包爆炸_00008,红包爆炸_00009,红包爆炸_00010,红包爆炸_00011,红包爆炸_00012,红包爆炸_00013,红包爆炸_00014,红包爆炸_00015,红包爆炸_00016,红包爆炸_00017,红包爆炸_00018" "subkeys": "红包爆炸_00000,红包爆炸_00001,红包爆炸_00002,红包爆炸_00003,红包爆炸_00004,红包爆炸_00005,红包爆炸_00006,红包爆炸_00007,红包爆炸_00008,红包爆炸_00009,红包爆炸_00010,红包爆炸_00011,红包爆炸_00012,红包爆炸_00013,红包爆炸_00014,红包爆炸_00015,红包爆炸_00016,红包爆炸_00017,红包爆炸_00018"
}, },
{ {
"name": "effect2_json",
"type": "sheet",
"url": "assets/mc/effect2.json", "url": "assets/mc/effect2.json",
"subkeys": "反馈1_00028,反馈1_00027,反馈1_00026,反馈1_00025,反馈1_00024,反馈1_00023,反馈1_00022,反馈1_00021,反馈1_00020,反馈1_00019,反馈1_00018,反馈1_00017,反馈1_00016,反馈1_00015,反馈1_00014,反馈1_00013,反馈1_00012,反馈1_00011,反馈1_00010,反馈1_00009,反馈1_00008,反馈1_00007,反馈1_00006,反馈1_00005,反馈1_00004,反馈1_00003,反馈1_00002,反馈1_00001,反馈1_00000" "type": "sheet",
"name": "effect2_json",
"subkeys": "反馈1_00000,反馈1_00001,反馈1_00002,反馈1_00003,反馈1_00004,反馈1_00005,反馈1_00006,反馈1_00007,反馈1_00008,反馈1_00009,反馈1_00010,反馈1_00011,反馈1_00012,反馈1_00013,反馈1_00014,反馈1_00015,反馈1_00016,反馈1_00017,反馈1_00018,反馈1_00019,反馈1_00020,反馈1_00021,反馈1_00022,反馈1_00023,反馈1_00024,反馈1_00025,反馈1_00026,反馈1_00027,反馈1_00028"
},
{
"name": "maplight2_png",
"type": "image",
"url": "assets/map/maplight2.png"
} }
] ]
} }
\ No newline at end of file
import MovieClip from "../movieclip/MovieClip";
export const createEffect1MovieClip = () => {
const spritesheet = RES.getRes('effect1_json');
const list = getEffectFramesStr('红包爆炸_000', 0, 18);
const movieclip = new MovieClip({
spritesheet: spritesheet,
frameInterval: 2,
frames: list,
position: [750 / 2, 750 - 100],
scale: 1,
anchor: [.5, .5],
loop: false
});
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
}, this)
return movieclip
}
const getNumStr = (num) => {
return num >= 10 ? `${num}` : `0${num}`;
}
export const getEffectFramesStr = (str, start, end) => {
const list = [];
for (let index = start; index <= end; index++) {
list.push(str + getNumStr(index));
}
return list;
}
\ No newline at end of file
import MovieClip from "../movieclip/MovieClip";
import { getEffectFramesStr } from "./createEffect1";
export const createEffect2MovieClip = (x,y) => {
const spritesheet = RES.getRes('effect2_json');
const list = getEffectFramesStr('反馈1_000', 0, 28);
const movieclip = new MovieClip({
spritesheet: spritesheet,
frameInterval: 1,
frames: list,
position: [x , y-70],
scale: 1,
anchor: [.5, .5],
loop: false
});
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
}, this)
return movieclip
}
\ No newline at end of file
...@@ -27,6 +27,7 @@ import MapRpeatPart from "./MapRpeatPart"; ...@@ -27,6 +27,7 @@ import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart"; import MapTopPart from "./MapTopPart";
import createRegTriangle from "../playScene/factory/createRegTriangle"; import createRegTriangle from "../playScene/factory/createRegTriangle";
import RedBagAni, { createRedBagIcon } from "./RedBagAni"; import RedBagAni, { createRedBagIcon } from "./RedBagAni";
import { createEffect2MovieClip } from "../effect/createEffect2";
let doHelpFlag = false; let doHelpFlag = false;
// let doScratchHelpFlag = false; // let doScratchHelpFlag = false;
...@@ -948,30 +949,44 @@ export default class MapScene extends Scene { ...@@ -948,30 +949,44 @@ export default class MapScene extends Scene {
if (ele.parent) if (ele.parent)
keys.push(key); keys.push(key);
} }
const p0 = new egret.Point(750/2,750/1.5); const p0 = new egret.Point(750 / 2, 750 / 1.5);
const pics = []; const pics = [];
for (const key of keys) { for (const key of keys) {
const icon = MapScene.iconHash[key] as egret.DisplayObject; const icon = MapScene.iconHash[key] as egret.DisplayObject;
const p = (icon.localToGlobal(0, 0)); const p = (icon.localToGlobal(0, 0));
const pic = createRedBagIcon(this); const pic = createRedBagIcon(this);
pic.visible=false; pic.visible = false;
pic['__p2__'] = p; pic['__p2__'] = p;
p.x+=50; pic['__icon__'] = icon;
p.y+=25; p.x += 50;
p.y += 25;
pics.push(pic); pics.push(pic);
} }
// console.log(keys); // console.log(keys);
pics.forEach( (pic,index)=>{ pics.forEach((pic, index) => {
wait(50*index).then(()=>{ wait(50 * index).then(() => {
pic.visible=true; pic.visible = true;
const p2 = pic['__p2__'] as egret.Point; const p2 = pic['__p2__'] as egret.Point;
let dir = 100; let dir = 100;
if(p2.y < p0.y) if (p2.y < p0.y)
dir *= -1; dir *= -1;
const p1x = (p0.x +p2.x)/2+ dir; const p1x = (p0.x + p2.x) / 2 + dir;
const p1y = (p0.y +p2.y)/2; const p1y = (p0.y + p2.y) / 2;
const p1 = new egret.Point(p1x,p1y); const p1 = new egret.Point(p1x, p1y);
new RedBagAni(p0,p1,p2,pic); new RedBagAni(p0, p1, p2, pic, () => {
const mc = createEffect2MovieClip(p2.x, p2.y);
this.addChild(mc);
const x0=pic['__icon__'].x;const y0=pic['__icon__'].y;
egret.Tween.get(pic['__icon__']).to({y:y0+10},100).to({y:y0},100);
const light =new egret.Bitmap( RES.getRes('maplight2_png'));
light.anchorOffsetX=75;light.anchorOffsetY=49;
light.x=50;light.y=40+5;
pic['__icon__'].addChildAt(light,0);
egret.Tween.get(light).to({scaleX:1.5,scaleY:1.5,},200).call(()=>{
pic['__icon__'].removeChild(light);
});
});
}); });
}) })
} }
......
...@@ -63,7 +63,7 @@ export default class MovieClip extends egret.Bitmap { ...@@ -63,7 +63,7 @@ export default class MovieClip extends egret.Bitmap {
this.currentFrame = 0; this.currentFrame = 0;
} else { } else {
this.stop(); this.stop();
this.dispatchEvent(new egret.Event(egret.Event.COMPLETE)) this.dispatchEvent(new egret.Event(egret.Event.COMPLETE));
} }
} }
} }
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { createEffect1MovieClip } from "../effect/createEffect1";
export default class BombTipsPanel extends Panel { export default class BombTipsPanel extends Panel {
start(data) { async start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 8000); egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 8000);
...@@ -19,6 +20,11 @@ export default class BombTipsPanel extends Panel { ...@@ -19,6 +20,11 @@ export default class BombTipsPanel extends Panel {
egret.Tween.get(this['ele4'], { loop: true }).to({ x: this['ele4'].x - 30, y: this['ele4'].y + 30 }, 1000) egret.Tween.get(this['ele4'], { loop: true }).to({ x: this['ele4'].x - 30, y: this['ele4'].y + 30 }, 1000)
.to({ x: this['ele4'].x, y: this['ele4'].y }, 1000); .to({ x: this['ele4'].x, y: this['ele4'].y }, 1000);
this.touchChildren = this.touchEnabled = false;
await RES.getResAsync('effect1_json');
await RES.getResAsync('effect2_json');
this.touchChildren = this.touchEnabled = true;
} }
showlog() { showlog() {
...@@ -30,23 +36,27 @@ export default class BombTipsPanel extends Panel { ...@@ -30,23 +36,27 @@ export default class BombTipsPanel extends Panel {
} }
onTapInvite() { onTapInvite() {
this['btn'].touchEnabled=false;
const eles = ['btn', 'rulebtn', 'bg', 'ele1', 'ele2', 'ele3', 'ele4', 'light']; const eles = ['btn', 'rulebtn', 'bg', 'ele1', 'ele2', 'ele3', 'ele4', 'light'];
const dur = 100; const dur = 100;
eles.forEach((e, index) => { eles.forEach((e, index) => {
// if (index == 0)
// egret.Tween.get(this[e]).to({ alpha: 0 }, dur).call(() => {
// });
// else
egret.Tween.get(this[e]).to({ alpha: 0 }, dur); egret.Tween.get(this[e]).to({ alpha: 0 }, dur);
}); });
const mask = PanelCtrl.instance._mask; const mask = PanelCtrl.instance._mask;
egret.Tween.get(mask).to({ alpha: 0 }, dur); egret.Tween.get(mask).to({ alpha: 0 }, dur);
egret.Tween.get(this['redbag']).to({ scaleX: 0.7, scaleY: 0.7 }, 100) egret.Tween.get(this['redbag']).to({ scaleX: 0.7, scaleY: 0.7 }, 100)
.to({ scaleX: 1.5, scaleY: 1.5, alpha: 0 }, 300); .to({ scaleX: 1.5, scaleY: 1.5, alpha: 0 }, 300);
setTimeout(() => {
const mc = createEffect1MovieClip();
this.addChild(mc);
}, 200);
setTimeout(() => { setTimeout(() => {
SceneCtrl.instance.currentScene['showRedBagAni'](); SceneCtrl.instance.currentScene['showRedBagAni']();
}, 400);
setTimeout(() => {
this.hidePanel(); this.hidePanel();
}, 1000); }, 1000);
} }
......
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