Commit 8cdf2585 authored by wildfirecode's avatar wildfirecode

1

parent e704987b
No preview for this file type
...@@ -48,8 +48,8 @@ var __debug__ = 1; ...@@ -48,8 +48,8 @@ var __debug__ = 1;
var __mode__ = 2; var __mode__ = 2;
var __award_thanks_score__ = 0; var __award_thanks_score__ = 0;
var __monkeyHandSize__ = 30; var __monkeyHandSize__ = 30;
var __boxMoveSpeed__ = 3; var __boxMoveSpeed__ = 3*1.5;
var __BOX_CREATE_INTERVAL__ = 60 * 4; var __BOX_CREATE_INTERVAL__ = 60*1.5;
var __boxOpenState__ = 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/openstate.json'; var __boxOpenState__ = 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/openstate.json';
var __boxmap__ = { var __boxmap__ = {
coin: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/coin.json', offset: [117, 68] }, coin: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/coin.json', offset: [117, 68] },
......
{"file":"kids.png","frames":{
"kidschair":{"x":0,"y":286,"w":750,"h":229,"offX":0,"offY":2,"sourceW":750,"sourceH":231},
"kids":{"x":0,"y":0,"w":744,"h":284,"offX":0,"offY":0,"sourceW":744,"sourceH":284},
"girlhand":{"x":827,"y":0,"w":79,"h":60,"offX":0,"offY":0,"sourceW":79,"sourceH":60},
"girl_eye":{"x":946,"y":0,"w":36,"h":40,"offX":0,"offY":0,"sourceW":36,"sourceH":40},
"boyhand":{"x":746,"y":0,"w":79,"h":60,"offX":0,"offY":0,"sourceW":79,"sourceH":60},
"boy_eye":{"x":908,"y":0,"w":36,"h":41,"offX":0,"offY":0,"sourceW":36,"sourceH":41}}}
\ No newline at end of file
{"file":"monkey.png","frames":{
"monkey":{"x":0,"y":0,"w":265,"h":525,"offX":0,"offY":0,"sourceW":265,"sourceH":525},
"eyeright":{"x":267,"y":0,"w":51,"h":47,"offX":0,"offY":0,"sourceW":51,"sourceH":47},
"eyeleft":{"x":320,"y":0,"w":48,"h":47,"offX":0,"offY":0,"sourceW":48,"sourceH":47}}}
\ No newline at end of file
...@@ -78,11 +78,6 @@ ...@@ -78,11 +78,6 @@
"name": "net_json", "name": "net_json",
"subkeys": "00,01,02,03,04,05,06,07,08,09,10" "subkeys": "00,01,02,03,04,05,06,07,08,09,10"
}, },
{
"url": "assets/startScene/monkey.png",
"type": "image",
"name": "monkey_png"
},
{ {
"url": "assets/startScene/guide/guide_tips.png", "url": "assets/startScene/guide/guide_tips.png",
"type": "image", "type": "image",
...@@ -147,6 +142,18 @@ ...@@ -147,6 +142,18 @@
"url": "assets/prize/prizePanelUseBtn.png", "url": "assets/prize/prizePanelUseBtn.png",
"type": "image", "type": "image",
"name": "prizePanelUseBtn_png" "name": "prizePanelUseBtn_png"
},
{
"url": "assets/startScene/monkey.json",
"type": "sheet",
"name": "monkey_json",
"subkeys": "eyeleft,eyeright,monkey"
},
{
"url": "assets/startScene/kids.json",
"type": "sheet",
"name": "kids_json",
"subkeys": "boy_eye,boyhand,girl_eye,girlhand,kids,kidschair"
} }
] ]
} }
\ No newline at end of file
...@@ -18,6 +18,7 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command { ...@@ -18,6 +18,7 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
'monkey.png', 'monkey.png',
'net.png', 'net.png',
'option.png', 'option.png',
'kids.png',
]; ];
if (excludes.indexOf(file.basename) != -1) { if (excludes.indexOf(file.basename) != -1) {
return file; return file;
......
...@@ -5,7 +5,7 @@ import ImgSizeType from "./ImgSizeType"; ...@@ -5,7 +5,7 @@ import ImgSizeType from "./ImgSizeType";
const getOptionImgSize = (lottery: LotteryData) => { const getOptionImgSize = (lottery: LotteryData) => {
let size:string; let size:string;
if (lottery.type == LotteryType.ALIPAY || if (
lottery.type == LotteryType.VIRTUAL || lottery.type == LotteryType.VIRTUAL ||
lottery.type == LotteryType.OBJECT) { lottery.type == LotteryType.OBJECT) {
size = ImgSizeType.SMALL size = ImgSizeType.SMALL
......
...@@ -6,7 +6,7 @@ export default class Box extends egret.Sprite { ...@@ -6,7 +6,7 @@ export default class Box extends egret.Sprite {
private START_X = 375; private START_X = 375;
private START_Y = 350; private START_Y = 350;
private END_Y = 1100; private END_Y = 1100;
static MIDDLE_Y = 800; static MIDDLE_Y = 800+100+30;
speed = 0; speed = 0;
static hashCounter = 0 static hashCounter = 0
hash; hash;
......
...@@ -61,7 +61,7 @@ export default class GuideCtrl extends egret.EventDispatcher { ...@@ -61,7 +61,7 @@ export default class GuideCtrl extends egret.EventDispatcher {
pic.anchorOffsetY = pic.height >> 1; pic.anchorOffsetY = pic.height >> 1;
this._guideTop.addChild(pic); this._guideTop.addChild(pic);
return new Promise((r) => { return new Promise((r) => {
egret.Tween.get(pic).set({ x: 0, y: 700 + 10 }) egret.Tween.get(pic).set({ x: 0, y: 710+130 })
.to({ x: 750 / 2 }, 200, egret.Ease.getBackOut(3)).wait(200) .to({ x: 750 / 2 }, 200, egret.Ease.getBackOut(3)).wait(200)
.call(() => r(pic)); .call(() => r(pic));
}); });
...@@ -73,7 +73,7 @@ export default class GuideCtrl extends egret.EventDispatcher { ...@@ -73,7 +73,7 @@ export default class GuideCtrl extends egret.EventDispatcher {
pic.anchorOffsetY = pic.height >> 1; pic.anchorOffsetY = pic.height >> 1;
this._guideTop.addChild(pic); this._guideTop.addChild(pic);
return new Promise((r) => { return new Promise((r) => {
egret.Tween.get(pic).set({ x: 750, y: 700 + 230 }).to({ x: 750 / 2 }, 200, egret.Ease.getBackOut(3)) egret.Tween.get(pic).set({ x: 750, y: 930+130 }).to({ x: 750 / 2 }, 200, egret.Ease.getBackOut(3))
.wait(200).call(() => r(pic)); .wait(200).call(() => r(pic));
}); });
} }
......
...@@ -9,7 +9,7 @@ export default class Monkey extends egret.Sprite { ...@@ -9,7 +9,7 @@ export default class Monkey extends egret.Sprite {
private len; private len;
private targetY = 70; private targetY = 70;
private targetX = 369; private targetX = 369;
static RANGE = 60; static RANGE = 60;
private _shakeSpeed = .5; private _shakeSpeed = .5;
constructor() { constructor() {
super(); super();
...@@ -19,7 +19,7 @@ export default class Monkey extends egret.Sprite { ...@@ -19,7 +19,7 @@ export default class Monkey extends egret.Sprite {
const b = this.h - this.h0 - this.h1; const b = this.h - this.h0 - this.h1;
this.r1 = Math.tan(a / b) / Math.PI * 180; this.r1 = Math.tan(a / b) / Math.PI * 180;
this.len = Math.sqrt(a * a + b * b); this.len = Math.sqrt(a * a + b * b);
this.start() this.start();
} }
private async start() { private async start() {
...@@ -69,10 +69,26 @@ export default class Monkey extends egret.Sprite { ...@@ -69,10 +69,26 @@ export default class Monkey extends egret.Sprite {
async createBg() { async createBg() {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const picData = await RES.getResAsync('monkey_png'); const picData: egret.SpriteSheet = await RES.getResAsync('monkey_json');
const pic = new egret.Bitmap(picData); const pic = new egret.Bitmap(picData.getTexture('monkey'));
this.addChild(pic); this.addChild(pic);
const eye_left = picData.getTexture('eyeleft');
const eye_right = picData.getTexture('eyeright');
this.addAnimation(eye_left, 63, 344);
this.addAnimation(eye_right, 127, 343);
resolve(pic) resolve(pic)
}); });
} }
addAnimation(texture: egret.Texture, x: number, y: number) {
const pic = new egret.Bitmap(texture);
this.addChild(pic);
pic.anchorOffsetX = texture.textureWidth >> 1;
pic.anchorOffsetY = texture.textureHeight >> 1;
pic.x = x;
pic.y = y;
egret.Tween.get(pic, { loop: true })
.to({ scaleY: 0 }, 200)
.to({ scaleY: 1 }, 200).wait(5000);
}
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ export default class Net extends egret.Sprite { ...@@ -7,7 +7,7 @@ export default class Net extends egret.Sprite {
this._pic = new SheetAnimation(); this._pic = new SheetAnimation();
this.addChild(this._pic); this.addChild(this._pic);
this.createBg(); this.createBg();
this.y = 500; this.y = 600+30;
} }
doAction() { doAction() {
......
...@@ -18,6 +18,7 @@ import showAlertPanel from "../ctrls/showAlertPanel"; ...@@ -18,6 +18,7 @@ import showAlertPanel from "../ctrls/showAlertPanel";
import Panel from "../views/Panel"; import Panel from "../views/Panel";
import Tips from "./view/Tips"; import Tips from "./view/Tips";
import DeclareTextTips from "./view/DeclareText"; import DeclareTextTips from "./view/DeclareText";
import Kids from "./view/Kids";
const { TouchEvent } = egret; const { TouchEvent } = egret;
export default class StartScene extends Scene { export default class StartScene extends Scene {
...@@ -80,6 +81,7 @@ export default class StartScene extends Scene { ...@@ -80,6 +81,7 @@ export default class StartScene extends Scene {
this._keyResCounter--; this._keyResCounter--;
if (this._keyResCounter != 0) return; if (this._keyResCounter != 0) return;
const t = Date.now() - __t0__; console.log(`关键元素完全时间:${t / 1000}s`); const t = Date.now() - __t0__; console.log(`关键元素完全时间:${t / 1000}s`);
this.getLayer(LayerTypes.kids).addChild(new Kids());
} }
addTouchEvent() { addTouchEvent() {
...@@ -270,9 +272,9 @@ export default class StartScene extends Scene { ...@@ -270,9 +272,9 @@ export default class StartScene extends Scene {
return [ return [
LayerTypes.bg, LayerTypes.bg,
LayerTypes.river, LayerTypes.river,
LayerTypes.kids,
LayerTypes.ui, LayerTypes.ui,
LayerTypes.guide, LayerTypes.guide,
LayerTypes.kids,
LayerTypes.net, LayerTypes.net,
LayerTypes.box, LayerTypes.box,
LayerTypes.monkey, LayerTypes.monkey,
......
...@@ -6,10 +6,10 @@ export default class DeclareTextTips extends eui.Label { ...@@ -6,10 +6,10 @@ export default class DeclareTextTips extends eui.Label {
this.size = 20; this.size = 20;
this.textColor = 0x333333; this.textColor = 0x333333;
this.text = '*兑换项与活动均与设备制造商Apple Inc.公司无关'; this.text = '*兑换项与活动均与设备制造商Apple Inc.公司无关';
this.once(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this); this.once(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
} }
onAddToStage(){ onAddToStage() {
this.y = this.stage.stageHeight-this.textHeight-10; this.y = this.stage.stageHeight - this.textHeight - 10;
} }
} }
\ No newline at end of file
export default class Kids extends egret.Sprite {
constructor() {
super();
this.y = 710;
this.createBg();
}
private boyhand: egret.Bitmap;
private girlhand: egret.Bitmap;
async createBg() {
const picData: egret.SpriteSheet = await RES.getResAsync('kids_json');
this.addPic(picData, 'kidschair', 0, 160);
this.boyhand = this.addPic(picData, 'boyhand', 90, 137);
this.girlhand = this.addPic(picData, 'girlhand', 658, 138, 79, 0);
this.addPic(picData, 'kids');
this.addAnimation(picData.getTexture('boy_eye'), 122, 109);
this.addAnimation(picData.getTexture('girl_eye'), 622, 111);
egret.Tween.get(this).set({alpha:0}).to({alpha:1},200);
}
doAction() {
egret.Tween.get(this.boyhand).to({ rotation: -50 }, 100).to({ rotation: 0 }, 100);
egret.Tween.get(this.girlhand).to({ rotation: 50 }, 100).to({ rotation: 0 }, 100);
}
addPic(picData: egret.SpriteSheet, key: string, x = 0, y = 0, anchorOffsetX = 0, anchorOffsetY = 0) {
const pic = new egret.Bitmap(picData.getTexture(key));
pic.anchorOffsetX = anchorOffsetX;
pic.anchorOffsetY = anchorOffsetY;
pic.x = x;
pic.y = y;
this.addChild(pic);
return pic;
}
addAnimation(texture: egret.Texture, x: number, y: number) {
const pic = new egret.Bitmap(texture);
this.addChild(pic);
pic.anchorOffsetX = texture.textureWidth >> 1;
pic.anchorOffsetY = texture.textureHeight >> 1;
pic.x = x;
pic.y = y;
egret.Tween.get(pic, { loop: true })
.to({ scaleY: 0 }, 200)
.to({ scaleY: 1 }, 200).wait(3000);
}
}
\ No newline at end of file
...@@ -6,11 +6,19 @@ export default class Tips extends eui.Label { ...@@ -6,11 +6,19 @@ export default class Tips extends eui.Label {
this.horizontalCenter = "0"; this.horizontalCenter = "0";
this.width = 750; this.width = 750;
this.textAlign = "center"; this.textAlign = "center";
this.size = 28; this.size = 22;
this.y = 1100-50;
this.updateText(); this.updateText();
DataManager.ins.addEventListener('dataUpdate', this.updateText, this); DataManager.ins.addEventListener('dataUpdate', this.updateText, this);
this.once(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
}
onAddToStage() {
this.y = 1142;
if (this.stage.stageHeight > 1300)
this.y = 1206;
if (this.stage.stageHeight < 1206)
this.y = this.stage.stageHeight - this.textHeight - 40;
} }
updateText() { updateText() {
......
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