Commit e9a6cbff authored by wildfirecode's avatar wildfirecode

1

parent 6d04de41
// tslint:disable: no-var-keyword
// tslint:disable: prefer-const
import { loadSvga } from "../../src/loadSvga"; import { loadSvga } from "../../src/loadSvga";
import MainScene from "../../src/mainScene/MainScene"; import MainScene from "../../src/mainScene/MainScene";
import MapScene from "../../src/mapScene/MapScene"; import MapScene from "../../src/mapScene/MapScene";
...@@ -56,6 +57,7 @@ import ScratchPanel from "../../src/panels/ScratchPanel"; ...@@ -56,6 +57,7 @@ import ScratchPanel from "../../src/panels/ScratchPanel";
import ScratchPrizePanel from "../../src/panels/ScratchPrizePanel"; import ScratchPrizePanel from "../../src/panels/ScratchPrizePanel";
import Turntable from "../../src/panels/TurntablePanel/Turntable"; import Turntable from "../../src/panels/TurntablePanel/Turntable";
import BagQuitPanel from "../../src/panels/BagQuitPanel"; import BagQuitPanel from "../../src/panels/BagQuitPanel";
import H52Scene from "../../src/H52Scene";
export default class MainBase extends eui.UILayer { export default class MainBase extends eui.UILayer {
constructor() { constructor() {
...@@ -108,6 +110,7 @@ export default class MainBase extends eui.UILayer { ...@@ -108,6 +110,7 @@ export default class MainBase extends eui.UILayer {
const scenes = [ const scenes = [
[ModuleTypes.INVITE_SCENE, { cls: H5Scene }], [ModuleTypes.INVITE_SCENE, { cls: H5Scene }],
[ModuleTypes.INVITE_SCENE2, { cls: H52Scene }],
[ModuleTypes.START_SCENE, { cls: StartScene }], [ModuleTypes.START_SCENE, { cls: StartScene }],
[ModuleTypes.MAP_SCENE, { cls: MapScene }], [ModuleTypes.MAP_SCENE, { cls: MapScene }],
[ModuleTypes.PLAY_SCENE, { cls: PlayScene }], [ModuleTypes.PLAY_SCENE, { cls: PlayScene }],
...@@ -168,6 +171,7 @@ export default class MainBase extends eui.UILayer { ...@@ -168,6 +171,7 @@ export default class MainBase extends eui.UILayer {
}) })
} }
// tslint:disable-next-line: cyclomatic-complexity
private async runGame() { private async runGame() {
await this.loadResource(); await this.loadResource();
RES.getResAsync('mapBg_mp3'); RES.getResAsync('mapBg_mp3');
...@@ -186,6 +190,7 @@ export default class MainBase extends eui.UILayer { ...@@ -186,6 +190,7 @@ export default class MainBase extends eui.UILayer {
else { else {
RES.getResAsync('main_mapbottom_png'); RES.getResAsync('main_mapbottom_png');
RES.getResAsync('lightani_png'); RES.getResAsync('lightani_png');
for (var i = 1; i < 19; i++) { for (var i = 1; i < 19; i++) {
RES.getResAsync("boom" + i + "_png") RES.getResAsync("boom" + i + "_png")
} }
...@@ -224,6 +229,7 @@ export default class MainBase extends eui.UILayer { ...@@ -224,6 +229,7 @@ export default class MainBase extends eui.UILayer {
for (var i = 1; i <= 11; i++) { for (var i = 1; i <= 11; i++) {
RES.getResAsync("stepAni" + i + "_png") RES.getResAsync("stepAni" + i + "_png")
} }
var aaa = [1, 3, 5, 7, 9, 11, 14, 16, 18, 19, 21, 23, 25, 27, 29, 32, 34]; var aaa = [1, 3, 5, 7, 9, 11, 14, 16, 18, 19, 21, 23, 25, 27, 29, 32, 34];
for (var i = 1; i <= 60; i++) { for (var i = 1; i <= 60; i++) {
if (aaa.indexOf(i) >= 0) { if (aaa.indexOf(i) >= 0) {
...@@ -301,6 +307,10 @@ export default class MainBase extends eui.UILayer { ...@@ -301,6 +307,10 @@ export default class MainBase extends eui.UILayer {
this.ajaxElement().then(() => { this.ajaxElement().then(() => {
SceneCtrl.instance.change(ModuleTypes.INVITE_SCENE); SceneCtrl.instance.change(ModuleTypes.INVITE_SCENE);
}) })
}else if (window['isInvitePage'] == 2) {
this.ajaxElement().then(() => {
SceneCtrl.instance.change(ModuleTypes.INVITE_SCENE2);
})
} }
else else
this.createGameScene(); this.createGameScene();
...@@ -317,6 +327,7 @@ export default class MainBase extends eui.UILayer { ...@@ -317,6 +327,7 @@ export default class MainBase extends eui.UILayer {
]); ]);
loadSvga(getResPath() + 'resource/assets/svgas/box.svga'); loadSvga(getResPath() + 'resource/assets/svgas/box.svga');
loadSvga(getResPath() + 'resource/assets/svgas/invite.svga'); loadSvga(getResPath() + 'resource/assets/svgas/invite.svga');
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga');
} }
catch (e) { catch (e) {
console.error(e); console.error(e);
......
export enum ModuleTypes { export enum ModuleTypes {
INVITE_SCENE, INVITE_SCENE,
INVITE_SCENE2,
START_SCENE, START_SCENE,
MAP_SCENE, MAP_SCENE,
PLAY_SCENE, PLAY_SCENE,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"resource/skins/FriendShareSkin.exml", "resource/skins/FriendShareSkin.exml",
"resource/skins/FriendSkin.exml", "resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.exml", "resource/skins/H5Skin.exml",
"resource/skins/H52Skin.exml",
"resource/skins/IconButtonSkin.exml", "resource/skins/IconButtonSkin.exml",
"resource/skins/InviteCutTimePanelSkin.exml", "resource/skins/InviteCutTimePanelSkin.exml",
"resource/skins/InviteItemSkin.exml", "resource/skins/InviteItemSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="H52Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="invitebg_jpg"/>
<e:Image id="gobtn" source="h5_gobtn_png" y="995" horizontalCenter="0"/>
<e:Image id="rulebtn" source="h5btn_png" y="954" horizontalCenter="0" visible="false"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="LoadingSceneSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="LoadingSceneSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group id="container" y="-45.45" x="-3"/>
<e:Image scaleX="1" scaleY="1" y="73.35" horizontalCenter="0" source=""/> <e:Image scaleX="1" scaleY="1" y="73.35" horizontalCenter="0" source=""/>
<e:Group horizontalCenter="0" verticalCenter="-190" touchEnabled="false"> <e:Group horizontalCenter="0" verticalCenter="-190" touchEnabled="false">
<e:Image scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" source="turntable_bg_png"/>
<e:Group id="panel" anchorOffsetX="253.5" anchorOffsetY="253.5" rotation="0" horizontalCenter="0" verticalCenter="0" width="507" height="507"> <e:Group id="panel" anchorOffsetX="253.5" anchorOffsetY="253.5" rotation="0" horizontalCenter="0" verticalCenter="0" width="507" height="507">
<e:Image scaleX="1" scaleY="1" anchorOffsetX="253.5" anchorOffsetY="253.5" rotation="0" horizontalCenter="0" verticalCenter="0" source="turntable_panel_png"/> <e:Image scaleX="1" scaleY="1" anchorOffsetX="253.5" anchorOffsetY="253.5" rotation="0" horizontalCenter="0" verticalCenter="0" source="turntable_panel_png"/>
<e:Group id="prize0" y="-10" x="179"> <e:Group id="prize0" y="-10" x="179">
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<e:Button id="start_btn" label="" anchorOffsetX="93" anchorOffsetY="140" horizontalCenter="0" verticalCenter="-25"> <e:Button id="start_btn" label="" anchorOffsetX="93" anchorOffsetY="140" horizontalCenter="0" verticalCenter="-25">
</e:Button> </e:Button>
</e:Group> </e:Group>
<e:Button id="closeBtn" label="" y="135.31" x="565.89"> <e:Button id="closeBtn" label="" y="292.88" x="565.89">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/> <e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
...@@ -41,4 +41,5 @@ ...@@ -41,4 +41,5 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Group id="container2"/>
</e:Skin> </e:Skin>
\ No newline at end of file
import Scene from "../libs/new_wx/components/Scene";
import Utils from "./Utils";
import PanelCtrl from "../libs/new_wx/ctrls/panelCtrl";
export default class H52Scene extends Scene {
async start(data?) {
super.start();
// this['rulebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
// PanelCtrl.instance.show('inviterule')
// },this);
this['gobtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
const code = Utils.getRequestByKey('shareCode2');
window.location.href = `${window['targetUrl']}&shareCode2=${code}`
},this);
}
get skinKey() { return 'H52' }
}
This diff is collapsed.
...@@ -10,11 +10,20 @@ import submit from "../../../libs/new_tw/ctrls/submit"; ...@@ -10,11 +10,20 @@ import submit from "../../../libs/new_tw/ctrls/submit";
import Loading from "../../../libs/new_wx/components/Loading"; import Loading from "../../../libs/new_wx/components/Loading";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import Utils from "../../Utils"; import Utils from "../../Utils";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
import MapScene from "../../mapScene/MapScene";
import wait from "../../../libs/new_tc/wait";
export const loadTurntableSvga = (callback) => {
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
await wait(100);
callback(mv);
})
}
export default class Turntable extends Panel { export default class Turntable extends Panel {
public panel:eui.Group; public panel: eui.Group;
public start_btn:eui.Button; public start_btn: eui.Button;
public closeBtn:eui.Button; public closeBtn: eui.Button;
public get skinKey() { public get skinKey() {
return 'Turntable' return 'Turntable'
...@@ -24,10 +33,11 @@ export default class Turntable extends Panel { ...@@ -24,10 +33,11 @@ export default class Turntable extends Panel {
super(); super();
this.data = data; this.data = data;
} }
hand;
start(data?) { async start(data?) {
super.start(); super.start();
this['container'].addChild(this.data.mv);
this.hand = await loadSvga(getResPath() + 'resource/assets/svgas/hand.svga', this['container2'])
} }
initEvents() { initEvents() {
...@@ -129,7 +139,7 @@ export default class Turntable extends Panel { ...@@ -129,7 +139,7 @@ export default class Turntable extends Panel {
*/ */
private rotate(rotation: number, time: number, callFun: Function) { private rotate(rotation: number, time: number, callFun: Function) {
let tw = egret.Tween.get(this.panel); let tw = egret.Tween.get(this.panel);
tw.to({rotation: rotation}, time, egret.Ease.cubicInOut).wait(500).call(callFun); tw.to({ rotation: rotation }, time, egret.Ease.cubicInOut).wait(500).call(callFun);
} }
protected onSkinComplete(): void { protected onSkinComplete(): void {
...@@ -151,14 +161,14 @@ export default class Turntable extends Panel { ...@@ -151,14 +161,14 @@ export default class Turntable extends Panel {
} }
private panelEffect() { private panelEffect() {
egret.Tween.get(this.panel).to({rotation: 360}, 20000).call(() => { egret.Tween.get(this.panel).to({ rotation: 360 }, 20000).call(() => {
this.panelEffect(); this.panelEffect();
}); });
} }
protected async preLoadRes() { protected async preLoadRes() {
return new Promise(function(resolve, reject) { return new Promise(function (resolve, reject) {
resolve(); resolve();
}); });
} }
......
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