Commit 17a7738d authored by wildfirecode's avatar wildfirecode

1

parent 8cdf2585
No preview for this file type
......@@ -59,7 +59,7 @@ var __boxmap__ = {
silverbox: { award: 3, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/silverbox.json', offset: [147, 77] },
goldenbox: { award: 5, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/goldenbox.json', offset: [130, 88] }
};
var __bgUrl__ = 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/bg.jpg';
var __bgUrl__ = 'resource/assets/startScene/bg.jpg';
var gameId = 1;
var CFG = {
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"river_6","version":5,"files":["../assets/startScene/river/river4.png","../assets/startScene/river/river3.png","../assets/startScene/river/river2.png","../assets/startScene/river/river1.png","../assets/startScene/river/river5.png","../assets/startScene/river/river6.png","../assets/startScene/river/river7.png"]}
\ No newline at end of file
egret/resource/assets/startScene/bg.jpg

58.7 KB | W: | H:

egret/resource/assets/startScene/bg.jpg

57.5 KB | W: | H:

egret/resource/assets/startScene/bg.jpg
egret/resource/assets/startScene/bg.jpg
egret/resource/assets/startScene/bg.jpg
egret/resource/assets/startScene/bg.jpg
  • 2-up
  • Swipe
  • Onion skin
{"file":"river.png","frames":{
"river4":{"x":28,"y":0,"w":26,"h":128,"offX":0,"offY":0,"sourceW":26,"sourceH":128},
"river3":{"x":56,"y":0,"w":18,"h":121,"offX":0,"offY":0,"sourceW":18,"sourceH":121},
"river2":{"x":0,"y":0,"w":26,"h":128,"offX":0,"offY":0,"sourceW":26,"sourceH":128},
"river1":{"x":76,"y":0,"w":22,"h":81,"offX":0,"offY":0,"sourceW":22,"sourceH":81}}}
\ No newline at end of file
......@@ -23,6 +23,10 @@
{
"keys": "prizePanelbg_png,PrizePanelX_png,prizePanelUseBtn_png",
"name": "prize"
},
{
"keys": "river4_png,river3_png,river2_png,river1_png,river5_png,river6_png,river7_png",
"name": "river"
}
],
"resources": [
......@@ -154,6 +158,47 @@
"type": "sheet",
"name": "kids_json",
"subkeys": "boy_eye,boyhand,girl_eye,girlhand,kids,kidschair"
},
{
"url": "assets/startScene/river.json",
"type": "sheet",
"name": "river_json",
"subkeys": "river1,river2,river3,river4"
},
{
"url": "assets/startScene/river/river4.png",
"type": "image",
"name": "river4_png"
},
{
"url": "assets/startScene/river/river3.png",
"type": "image",
"name": "river3_png"
},
{
"url": "assets/startScene/river/river2.png",
"type": "image",
"name": "river2_png"
},
{
"url": "assets/startScene/river/river1.png",
"type": "image",
"name": "river1_png"
},
{
"url": "assets/startScene/river/river5.png",
"type": "image",
"name": "river5_png"
},
{
"url": "assets/startScene/river/river7.png",
"type": "image",
"name": "river7_png"
},
{
"url": "assets/startScene/river/river6.png",
"type": "image",
"name": "river6_png"
}
]
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
'monkey.png',
'net.png',
'option.png',
'river.png',
'kids.png',
];
if (excludes.indexOf(file.basename) != -1) {
......
import { LotteryData } from "../../../libs/tw/data/common/lottery/LotteryData";
import { LotteryType } from "../../../libs/tw/enum/LotteryType";
import ImgSizeType from "./ImgSizeType";
const getOptionImgSize = (lottery: LotteryData) => {
let size:string;
if (
lottery.type == LotteryType.VIRTUAL ||
lottery.type == LotteryType.OBJECT) {
size = ImgSizeType.SMALL
} else {
size = ImgSizeType.BIG;
}
return size;
return ImgSizeType.BIG
}
// const getOptionImgSize = (lottery: LotteryData) => {
// let size:string;
// if (
// lottery.type == LotteryType.VIRTUAL ||
// lottery.type == LotteryType.OBJECT) {
// size = ImgSizeType.SMALL
// } else {
// size = ImgSizeType.BIG;
// }
// return size;
// }
export default getOptionImgSize
\ No newline at end of file
......@@ -61,7 +61,7 @@ export default class GuideCtrl extends egret.EventDispatcher {
pic.anchorOffsetY = pic.height >> 1;
this._guideTop.addChild(pic);
return new Promise((r) => {
egret.Tween.get(pic).set({ x: 0, y: 710+130 })
egret.Tween.get(pic).set({ x: 0, y: 710 + 130 })
.to({ x: 750 / 2 }, 200, egret.Ease.getBackOut(3)).wait(200)
.call(() => r(pic));
});
......@@ -73,7 +73,7 @@ export default class GuideCtrl extends egret.EventDispatcher {
pic.anchorOffsetY = pic.height >> 1;
this._guideTop.addChild(pic);
return new Promise((r) => {
egret.Tween.get(pic).set({ x: 750, y: 930+130 }).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));
});
}
......
......@@ -26,7 +26,7 @@ export default class Monkey extends egret.Sprite {
await this.createBg();
this.dispatchEvent(new egret.Event(egret.Event.COMPLETE));
egret.Tween.get(this)
.set({ scaleX: 0.1, scaleY: 0.1, alpha: .5, rotation: Monkey.RANGE / 3, x: 750 + 100 })
.set({ scaleX: 0.1, scaleY: 0.1, alpha: .5, rotation: Monkey.RANGE / 3, x: this.targetX })
.to({ y: this.targetY, x: this.targetX, scaleX: 1, scaleY: 1, alpha: 1 }, 1000, egret.Ease.getBackOut(.9))
.wait(500)
.call(this.startShaking, this);
......
......@@ -19,10 +19,12 @@ import Panel from "../views/Panel";
import Tips from "./view/Tips";
import DeclareTextTips from "./view/DeclareText";
import Kids from "./view/Kids";
import River from "./view/River";
const { TouchEvent } = egret;
export default class StartScene extends Scene {
private _net: Net;
private _kids: Kids;
private _monkey: Monkey;
private _boxListCtrl: BoxListCtrl;
private _guideView: Guide;
......@@ -81,7 +83,9 @@ export default class StartScene extends Scene {
this._keyResCounter--;
if (this._keyResCounter != 0) return;
const t = Date.now() - __t0__; console.log(`关键元素完全时间:${t / 1000}s`);
this.getLayer(LayerTypes.kids).addChild(new Kids());
this._kids = new Kids();
this.getLayer(LayerTypes.kids).addChild(this._kids);
this.getLayer(LayerTypes.river).addChild(new River());
}
addTouchEvent() {
......@@ -102,6 +106,7 @@ export default class StartScene extends Scene {
_isBoxFlying: boolean;
doAction() {
this._net.doAction();
if (this._kids) this._kids.doAction();
const catchedBoxs = this._boxListCtrl.boxs.filter(
box => Math.abs(box.y - Box.MIDDLE_Y) < StartScene.NET_RANGE);
const catchedBox = catchedBoxs[0];
......
......@@ -15,12 +15,13 @@ export default class Kids extends egret.Sprite {
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);
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);
const speed = 200;
egret.Tween.get(this.boyhand).to({ rotation: -50 }, speed).to({ rotation: 0 }, speed);
egret.Tween.get(this.girlhand).to({ rotation: 50 }, speed).to({ rotation: 0 }, speed);
}
addPic(picData: egret.SpriteSheet, key: string, x = 0, y = 0, anchorOffsetX = 0, anchorOffsetY = 0) {
......
export default class River extends egret.Sprite {
constructor() {
super();
this.start();
}
async start() {
const t1 = await RES.getResAsync('river1_png');
const pic1 = this.addpic(t1, 434, 493);
egret.Tween.get(pic1, { loop: true }).to({ alpha: 1 }, 1000).to({ alpha: 0 }, 1000).wait(100);
const t2 = await RES.getResAsync('river2_png');
const pic2 = this.addpic(t2, 475, 450);
egret.Tween.get(pic2, { loop: true }).to({ alpha: 1 }, 200)
.to({ y: 450 + 200 }, 1500).to({ alpha: 0 }, 200).wait(100);
const t3 = await RES.getResAsync('river3_png');
const pic3 = this.addpic(t3, 353, 410);
egret.Tween.get(pic3, { loop: true }).to({ alpha: 1 }, 200)
.to({ y: 410 + 100, x: 353 - 20 }, 1500).to({ alpha: 0 }, 200).wait(100);
const t4 = await RES.getResAsync('river4_png');
const pic4 = this.addpic(t4, 496, 625);
egret.Tween.get(pic4, { loop: true }).to({ alpha: 1 }, 200)
.to({ y: 625 + 400 }, 2000).to({ alpha: 0 }, 400);
const t5 = await RES.getResAsync('river5_png');
const pic5 = this.addpic(t5, 260, 564);
egret.Tween.get(pic5, { loop: true }).to({ alpha: 1 }, 100)
.to({ y: 564 + 200, x: 260 - 40 }, 700).to({ alpha: 0 }, 100).wait(100);
const t6 = await RES.getResAsync('river6_png');
const pic6 = this.addpic(t6, 235, 845);
egret.Tween.get(pic6, { loop: true }).to({ alpha: 1 }, 1000).to({ alpha: 0 }, 1000);
const t7 = await RES.getResAsync('river7_png');
const pic7 = this.addpic(t7, 419, 845);
setTimeout(() => {
egret.Tween.get(pic7, { loop: true }).to({ alpha: 1 }, 1000).to({ alpha: 0 }, 1000);
}, 1000);
}
private addpic(texture: egret.Texture, x = 0, y = 0) {
const pic = new egret.Bitmap(texture)
this.addChild(pic);
pic.x = x;
pic.y = y;
pic.alpha = 0;
return pic;
}
}
\ No newline at end of file
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