Commit 5ca37007 authored by wildfirecode's avatar wildfirecode

1

parent a0d8b7db
{"file":"honeymc.png","frames":{
"合成 4_00013":{"x":1328,"y":1004,"w":341,"h":322,"offX":88,"offY":99,"sourceW":500,"sourceH":500},
"合成 4_00012":{"x":502,"y":1004,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00011":{"x":0,"y":1004,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00010":{"x":1506,"y":502,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00009":{"x":1004,"y":502,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00008":{"x":502,"y":502,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00007":{"x":0,"y":502,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00006":{"x":1506,"y":0,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00005":{"x":1004,"y":0,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00004":{"x":502,"y":0,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00003":{"x":0,"y":0,"w":500,"h":500,"offX":0,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00002":{"x":1004,"y":1004,"w":322,"h":500,"offX":91,"offY":0,"sourceW":500,"sourceH":500},
"合成 4_00001":{"x":1671,"y":1004,"w":47,"h":95,"offX":227,"offY":215,"sourceW":500,"sourceH":500}}}
\ No newline at end of file
This diff is collapsed.
......@@ -235,6 +235,10 @@
{
"keys": "lijiqianwang_png,copyCodeBg_png,shareWxpyqIcon_png,shareWxIcon_png,shareQqIcon_png,shareWeiboIcon_png,zhantiegeihaoyou_png",
"name": "sharecodepanel"
},
{
"name": "preload",
"keys": "honeymc_json"
}
],
"resources": [
......@@ -4542,6 +4546,12 @@
"url": "assets/shareCodePanel/zhantiegeihaoyou.png",
"type": "image",
"name": "zhantiegeihaoyou_png"
},
{
"name": "honeymc_json",
"type": "sheet",
"url": "assets/mc/honeymc.json",
"subkeys": "合成 4_00013,合成 4_00012,合成 4_00011,合成 4_00010,合成 4_00009,合成 4_00008,合成 4_00007,合成 4_00006,合成 4_00005,合成 4_00004,合成 4_00003,合成 4_00002,合成 4_00001"
}
]
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import { ExmlPlugin2 } from "./ExmlPlugin2";
export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
async onFile(file: plugins.File) {
const excludes = [
'honeymc.png',
'candydiebg.png',
'monsterState.png',
'candysub.png',
......
import MovieClip from "../movieclip/MovieClip";
import { getEffectFramesStr } from "./createEffect1";
export const createHoneyBombAni = async (x, y, p) => {
const spritesheet = await RES.getResAsync('honeymc_json');
const list = getEffectFramesStr('合成 4_000', 1, 13);
const movieclip = new MovieClip({
spritesheet: spritesheet,
frameInterval: 2,
frames: list,
position: [x, y],
scale: 1,
anchor: [.5, .5],
loop: false
});
p.addChild(movieclip);
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
}, this)
}
\ No newline at end of file
import getResPath from "../../libs/new_tc/getResPath";
import { loadSvga } from "../loadSvga";
export const createHoneyBubbleAni = async (x, y, p) => {
const movieclip: any = await loadSvga(getResPath() + 'resource/assets/svgas/honeypot_bubble.svga');
p.addChild(movieclip);
movieclip.anchorOffsetX= 60;
movieclip.anchorOffsetY= 60;
movieclip.x = x;
movieclip.y = y;
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
}, this);
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ export const createHoneyDisAni = async (x, y, p) => {
movieclip.anchorOffsetY= 150;
movieclip.x = x;
movieclip.y = y;
movieclip.scaleX=movieclip.scaleY=0.5;
movieclip.once(egret.Event.COMPLETE, () => {
if (movieclip.parent)
movieclip.parent.removeChild(movieclip);
......
......@@ -97,6 +97,7 @@ import doFishAI from './doFishAI';
import doHoneyPotAI from './doHoneyPotAI';
import doMonsterAI from './doMonsterAI';
import jellyMonsterAI from './jellyMonsterAI';
import { createHoneyDisAni } from '../effect/createHoneyDisAni';
const aniClass = {
"BoomAni": BoomAni,
......@@ -2430,6 +2431,7 @@ export default class MainScene extends Scene {
}
else if (ele.hasState(StateType.HONEY)) {
ele.setState(StateType.HONEY, false);
createHoneyDisAni(ele.x,ele.y,this)
this.goElementTarget(ElementType.HONEY, [ele.x, ele.y]);
}
else if (ele.monster) {//如果是独眼怪,
......
......@@ -9,6 +9,10 @@ import wait from "../../libs/new_tc/wait";
import { EffectType } from "../something/enum/EffectType";
import { EggBrokenAni } from "../something/anis/EggBrokenAni";
import { StateType } from "../something/enum/StateType";
import { createHoneyBombAni } from "../effect/createHoneyBombAni";
import HoneyPotElement from "../something/class/HoneyPotElement";
import { HoneyPotShootAni } from "../something/anis/HoneyPotShootAni";
import { createHoneyBubbleAni } from "../effect/createHoneyBubbleAni";
/**
* 罐子爆炸
*/
......@@ -52,23 +56,32 @@ export default async (thisObj: MainScene) => {
foundsResult[index] = founds;
}
activeElements.forEach((ele) => {
egret.Tween.get(ele).to({ scaleX: 1.2, scaleY: 1.2 }, 200)
.to({ scaleY: 1 }, 700).to({ scaleY: 1.2 }, 300, egret.Ease.backIn);
if (activeElements.length > 0) {
activeElements.forEach((ele:HoneyPotElement) => {
ele.fixStatus();
createHoneyBombAni(ele.x, ele.y, thisObj)
});
await wait(400);
if (activeElements.length > 0)
await wait(1000);
activeElements.forEach((ele: HoneyPotElement) => {
ele.honeyPot.playAni();
});
await wait(1200);
}
const playEffect = async (index) => {
const activeEle = activeElements[index];
let founds = foundsResult[index];
founds.forEach((ele) => {
let bonusShootAni: MonsterShootAni = Pool.takeOut(RecoverName.MONSTER_SHOOT_ANI);
let bonusShootAni: HoneyPotShootAni = Pool.takeOut(RecoverName.MONSTER_SHOOT_ANI);
if (!bonusShootAni)
bonusShootAni = new MonsterShootAni();
bonusShootAni = new HoneyPotShootAni();
var r = Tool.getForwardRotation([activeEle.x, activeEle.y], [ele.x, ele.y])
bonusShootAni.play(r * 180 / Math.PI, [activeEle.x, activeEle.y], [ele.x, ele.y], () => { });
wait(1000).then(()=>{
createHoneyBubbleAni(ele.x,ele.y,thisObj);
});
thisObj.addChild(bonusShootAni);
});
};
......@@ -76,8 +89,10 @@ export default async (thisObj: MainScene) => {
playEffect(index);
}
if (genarates.length > 0)
await wait(500);
if (genarates.length > 0) {
await wait(1300);
}
for (let index = 0; index < foundsResult.length; index++) {
const founds = foundsResult[index];
founds.forEach(ele => {
......
......@@ -399,6 +399,7 @@ export default class MapScene extends Scene {
RES.getResAsync('candydie4_json');
RES.getResAsync('candysub_json');
RES.getResAsync('monsterState_json');
RES.getResAsync('honeymc_json');
RES.getResAsync('candydiebg_json');
RES.getResAsync('redrainbg_jpg');
......
......@@ -107,16 +107,25 @@ class ShareCodePanel extends ComponentBase {
this.data = data;
//显示提示文案
this.msg.text = panelMsg[this.data.channel];
//获取code先
generateCode((s, res) => {
if (!s || !res.data || !res.data.result || !res.data.result.content) {
return
}
this.code = res.data.result.content;
}, this.data.channel, this.data.shareCode)
}
start() {
super.start();
this.height = this.stage.stageHeight;
//
if (!document.getElementById("kouling")){
var a='<div id="kouling" style="display:none" data-clipboard-text=""></div>';
document.body.insertAdjacentHTML("afterbegin",a)
}
// if (!document.getElementById("kouling")){
// var a='<div id="kouling" style="display:none" data-clipboard-text=""></div>';
// document.body.insertAdjacentHTML("afterbegin",a)
// }
}
......@@ -296,38 +305,38 @@ function generateCode(callback: Function, channel: CodeChannels, shareCode: stri
*/
function copyPassword(callback: Function, code: string) {
if (document.getElementById("kouling")) document.getElementById("kouling").setAttribute("data-clipboard-text", code)
// window["snShare"].passwordShare({
// ele: '#kouling',
// txt: code + "",
// success: function (e) {
// callback(true, e);
// // console.log(e, e.text)
// // alert('复制口令内容:'+e.text,function(){window.location.href='weixin://';});
// },
// error: function (e) {
// callback(false, e);
// // console.log(e)
window["snShare"].passwordShare({
ele: '#kouling',
txt: code + "",
success: function (e) {
callback(true, e);
// console.log(e, e.text)
// alert('复制口令内容:'+e.text,function(){window.location.href='weixin://';});
},
error: function (e) {
callback(false, e);
// console.log(e)
// alert(JSON.stringify(e))
// // alert('复制失败')
// }
// })
// alert('复制失败')
}
})
// var a='<div id="btn" style="display:none" data-clipboard-text=""></div>';document.body.insertAdjacentHTML("afterbegin",a)
// console.log(window["ClipboardJS"])
var clipboard = new window["ClipboardJS"]("#kouling", {
text: code+""
});
clipboard.on("success", e => {
clipboard.destroy();
callback(true, e);
// var clipboard = new window["ClipboardJS"]("#kouling", {
// // text: code+""
// });
// clipboard.on("success", e => {
// clipboard.destroy();
// callback(true, e);
});
clipboard.on("error", e => {
callback(false, e);
alert(JSON.stringify(e))
e.clearSelection();
clipboard.destroy();
});
document.querySelector("#kouling")["click"]()
// });
// clipboard.on("error", e => {
// callback(false, e);
// alert(JSON.stringify(e))
// e.clearSelection();
// clipboard.destroy();
// });
// document.querySelector("#kouling")["click"]()
}
/**
......
import { RecoverName } from "../enum/RecoverName";
import { Pool } from "../Pool";
/**
* 需要回调的
* 手动修改this.shoot.rotation=
*/
export class HoneyPotShootAni extends egret.DisplayObjectContainer {
shoot: egret.Bitmap;
// imageAni: ImageAni
constructor() {
super()
var texture = RES.getRes("ele34_png")
this.shoot = new egret.Bitmap(texture);
this.shoot.anchorOffsetX = 74 / 2;
this.shoot.anchorOffsetY = 74 / 2;
this.addChild(this.shoot);
}
private reset(p: number[]) {
this.x = p[0];
this.y = p[1] - 30;
}
play(rotation: number, from: number[], p: number[], callback: Function) {
this.reset(from)
// this.shoot.rotation = rotation;
egret.Tween.get(this)
.set({ scaleX: 0, scaleY: 0 })
.to({ x: p[0], y: p[1], scaleX: 1, scaleY: 1 }, 700)
.to({ scaleX: 1.2, scaleY: 1.2 }, 400)
.to({ scaleX: 1, scaleY: 1 }, 200)
.call(() => {
//播放动效
callback();
if (this.parent) {
this.parent.removeChild(this)
};
Pool.recover(RecoverName.HONEY_SHOOT_ANI, this)
})
}
}
\ No newline at end of file
......@@ -5,7 +5,35 @@ import HoneyPotElement from "./HoneyPotElement";
import wait from "../../../libs/new_tc/wait";
export class HoneyPot extends eui.Component {
async nextStatus() {
fixStatus() {
this._mvList.forEach(mv => {
mv.visible = false;
});
this._mvList[2].visible = true;
}
playAni() {
const mc = this._mvList[2];
if (!mc) return;
this._mvList.forEach(mv => {
mv.visible = false;
});
mc.visible = true;
mc.anchorOffsetY = 86;
mc.y += 86 / 2 + 3;
egret.Tween.get(mc).to({ scaleX: 1.2, scaleY: 1.2 }, 200)
.to({ scaleY: 1 }, 700).to({ scaleY: 1.2 }, 300, egret.Ease.getBackIn(20))
.wait(100).call(() => {
mc.anchorOffsetY = 86 / 2;
mc.y = 0;
egret.Tween.get(mc).wait(400).to({ scaleY: 0, scaleX: 0 }, 300);
})
}
nextStatus() {
this._statusNum++;
if (this._statusNum >= 3) {
this.removeEvents();
......@@ -46,7 +74,7 @@ export class HoneyPot extends eui.Component {
this._mvList.forEach(mv => {
this.addChild(mv);
mv.anchorOffsetX = 80 / 2;
mv.anchorOffsetY = 86 / 2;
mv.anchorOffsetY = 86 / 2 - 3;
});
// this.addEvents();
......@@ -70,9 +98,9 @@ export class HoneyPot extends eui.Component {
async changeSource(first = 0) {
if (this._mvList) {
if (!first) {
await wait(300);
// await wait(300);
egret.Tween.get(this._mvList[this._statusNum]).set({ scaleX: 0.9, scaleY: 0.9 })
.to({ scaleX: 1, scaleY: 1 }, 200, egret.Ease.getBackIn(10))
.to({ scaleX: 1, scaleY: 1 }, 600, egret.Ease.getBackIn(10))
}
this._mvList.forEach(mv => {
......
......@@ -3,6 +3,9 @@ import { Element } from "./Element";
import { HoneyPot } from "./HoneyPot";
export default class HoneyPotElement extends Element {
fixStatus() {
this.honeyPot.fixStatus();
}
honeyPot: HoneyPot;
resetView() {
......
......@@ -56,6 +56,7 @@ export enum ElementType {
FISH,//气鼓鱼
HONEY,// 蜂蜜
HONEY_POT//蜂蜜罐
// HONEY_POT//蜂蜜罐
}
export const isMonsterEle = (t: ElementType) => {
......
......@@ -8,7 +8,8 @@ export enum LatticeType {
DARK_ICE = 3,
BlOCK = 4, //会持续存在,无法像冰块一样被消除,但是上方可以存在元素。只是展示的时候
BLOCK_AND_ICE = 5,
BLOCK_AND_DARK_ICE = 6
BLOCK_AND_DARK_ICE = 6,
// BLOCK_AND_DARK_ICE = 7,
}
......
......@@ -18,6 +18,7 @@ export enum RecoverName {
//带回调的动画,和不带的合并不了,因为可能还有其他参数
BONUSSHOOT_ANI = "BonusShootAni",
MONSTER_SHOOT_ANI = "MONSTER_SHOOT_ANI",
HONEY_SHOOT_ANI = "HONEY_SHOOT_ANI",
JELLYSPREAD_ANI = "JellySpreadAni",
PIECETOEGG_ANI = "PieceToEggAni",
BUBBLE_ANI = "BubbleAni",
......
......@@ -2242,6 +2242,11 @@
"levelNum": 446,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 447,
"maxScore": 47440,
"stars": 1
}
],
......
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