Commit ad6070ef authored by wildfirecode's avatar wildfirecode

1

parents 25b62910 ccb88c3c
......@@ -25,3 +25,4 @@ node_modules
bin-release
.DS_Store
egret/.DS_Store
**/*/.tmproject
\ No newline at end of file
{
"global": {
"globalBindingDataTestObj": []
},
"1667fb18fa6": {
"bindingDataTestObj": [
{
"key": "list",
"value": "[1,2]"
}
]
},
"16680af117c": {
"bindingDataTestObj": []
},
"16680af117d": {
"bindingDataTestObj": [
{
"key": "data.message",
"value": "积分不足 \\n 多赚点再来吧"
}
]
}
}
\ No newline at end of file
{
"version": "0.2.0",
"configurations": [
{
"name": "Wing 内置播放器调试",
"type": "chrome",
"request": "launch",
"file": "index.html",
//"url": "http://mysite.com/index.html",
"runtimeExecutable": "${execPath}",
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"preLaunchTask":"build",
"port":5826
},
{
"name": "使用本机 Chrome 调试",
"type": "chrome",
"request": "launch",
"file": "index.html",
//"url": "http://mysite.com/index.html",
"runtimeExecutable": "",
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"preLaunchTask":"build",
"userDataDir":"${tmpdir}",
"port":5826
}
]
}
\ No newline at end of file
{
"version": "0.1.0",
"command": "egret",
"isShellCommand": true,
"tasks": [
{
"taskName": "build",
"showOutput": "always",
"args": [
"build",
"-sourcemap"
],
"problemMatcher": "$tsc"
},
{
"taskName": "clean",
"showOutput": "always",
"args": [
"build",
"-e"
],
"problemMatcher": "$tsc"
},
{
"taskName": "publish",
"showOutput": "always",
"args": [
"publish"
],
"problemMatcher": "$tsc"
}
]
}
\ No newline at end of file
......@@ -13,7 +13,6 @@
<style>
html,
body {
-ms-touch-action: none;
background: #888888;
padding: 0;
border: 0;
......@@ -25,8 +24,8 @@
<body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" data-orientation="auto"
data-scale-mode="showAll" data-frame-rate="30" data-content-width="750" data-content-height="1624" data-multi-fingered="2"
data-show-fps="false" data-show-log="false" data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
data-scale-mode="showAll" data-frame-rate="60" data-content-width="750" data-content-height="1624"
data-multi-fingered="2" data-show-fps="false" data-show-log="false" data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div>
<script src="libs/modules/egret/egret.js"></script>
......@@ -41,7 +40,27 @@
<script src="libs/physics.min.js"></script>
<!-- <script src="default.thm.js"></script> -->
<script src="output.js"></script>
<script src="libs/downloadApp.js"></script>
<script>
// localStorage.clear();
var __t0__ = Date.now();
var __debug__ = 1;
var __mode__ = 2;
var __award_thanks_score__ = 0;
var __monkeyHandSize__ = 30;
var __boxMoveSpeed__ = 3*1.5;
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 __boxmap__ = {
coin: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/coin.json', offset: [117, 68] },
gift: { award: 0, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/gift.json', offset: [119, 103] },
gift2: { award: 1, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/gift2.json', offset: [122, 87] },
woodbox: { award: 1, skin: 'https://yun.duiba.com.cn/db_games/activity/fishing/1539596765/resource/assets/startScene/woodbox.json', offset: [115, 80] },
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__ = 'resource/assets/startScene/bg.jpg';
var gameId = 1;
var CFG = {
appInfo: {
......@@ -67,6 +86,7 @@
}
}
var recordUrl = 'record/';
var resPath = '';
function resolve(a) {
var b = eval(a);
return b;
......
declare var resPath:string;
declare var requirelogin:Function;
declare var CFG;
declare var __debug__:number;
declare var __t0__:number;
declare interface IBoxItem {
award: number;
skin: string;
offset: number[];
}
/**
* 1.捞一次扣一次积分,不管捞没捞到宝箱,不管宝箱是否被猴子抢走;2.只有捞到宝箱,参与了一次抽奖才扣积分
*/
declare var __mode__:number;
declare var __award_thanks_score__:number;
declare var __boxmap__: { [key: string]: IBoxItem };
declare var __bgUrl__:string;
declare var __monkeyHandSize__:number;
declare var __boxMoveSpeed__:number;
declare var __BOX_CREATE_INTERVAL__:number;
declare var __boxOpenState__:string;
\ No newline at end of file
/**
* @note 函数 window.downloadApp
* @modify by zsl@duiba.com.cn
* @date 2016-07-31
* @modify 2016-09-01
*/
;
(function($) {
var ua = navigator.userAgent.toLowerCase();
// -------------------------- downloadApp主要函数 --------------------------//
var downloadApp = function() {
if (window.downloadAppConfig) {
if (ua.match(/iphone/ig) || ua.match(/ipad/ig)){
//ios
download();
}else{
if (window.downloadAppConfig.confirm || window.downloadAppConfig.confirm == 'true') {
$.modal({
type: 'confirm',
title: '下载确认',
section: '即将开始下载,是否继续',
callback: {
save: function() {
if (window.downloadAppConfig.stats) {
$.ajax({
url: window.downloadAppConfig.stats,
complete: function() {
download();
}
})
} else {
download();
}
}
}
})
}else{
download();
}
}
}else {
console.error('请先配置参数window.downloadAppConfig');
}
}
// -------------------------- format函数 --------------------------//
var formatUrl = function(downloadUrl) {
if (downloadUrl.indexOf('dbnewopen') != -1) {
window.location.href = downloadUrl;
} else {
if (downloadUrl.indexOf('?') !== -1) {
// modify by zsl date2016-07-28
if (downloadUrl.indexOf('#') !== -1) {
// 如果包含#号
window.location.href = downloadUrl.split('#')[0] + '&dbnewopen#' + downloadUrl.split('#')[1];
}else {
window.location.href = downloadUrl + '&dbnewopen';
}
} else if (downloadUrl !== '') {
window.location.href = downloadUrl + '?dbnewopen';
}
}
}
// -------------------------- URL处理函数 --------------------------//
var download = function() {
var openUrl = window.downloadAppConfig.openUrl || '';
var downloadUrl = '';
// 淘客url处理 start ------------------------------------------------------------
var TKHelper,
isSpecial = false;
if ( window.TBSDK_ADA !== undefined ) {
TKHelper = function(downloadUrl) {
var isTBSDK = function() {
isSpecial = true;
if (window.isSpecialApp) {
window.location.href = downloadUrl;
} else {
window.BC_SDK.openPage({
url: downloadUrl
});
}
};
// 如果包含手淘url 唤起手淘App的功能
if (downloadUrl.indexOf('taoquan.taobao.com') !== -1 || downloadUrl.indexOf('shop.m.taobao.com') !== -1 ) {
window.BC_SDK = TBSDK_ADA.init({
"appkey": '23402401',
openTBAPP: true
});
isTBSDK();
}
// 如果是s.click.taobao.com的URL,点击则调用百川goTaoke方法唤起手淘
if(downloadUrl.indexOf('s.click.taobao.com') !== -1) {
window.BC_SDK = TBSDK_ADA.init({
"appkey": '23454468',
"appSecret": '3846ae97316a0b31321a8f493f826986',
openTBAPP: true
});
isTBSDK();
}
};
}
// 淘客url处理 end -----------------------------------------------------------
// 特殊处理
var handleSpecial = function(downloadUrl) {
// 如果downloadUrl是weixin直接打开url(加了&dbnewopen SDK唤起weixin 中间会产生一个空白页)
if (downloadUrl && downloadUrl.indexOf('weixin://') !== -1) {
isSpecial = true;
window.location.href = downloadUrl;
return;
}
// @special openUrl为微信服务,
if (openUrl && openUrl.indexOf('weixin://') !== -1) {
return;
}
// 如果含有手淘url 唤起手淘App的功能
if (window.TBSDK_ADA !== undefined ) {
TKHelper(downloadUrl);
}
};
if (ua.match(/iphone/ig) || ua.match(/ipad/ig)) {
// ios
downloadUrl = window.downloadAppConfig.iosDownloadUrl;
handleSpecial(downloadUrl);
if(isSpecial){
return;
}
if (ua.match(/MicroMessenger/ig)) {
formatUrl(downloadUrl);
} else {
if (openUrl) {
window.location.href = openUrl;
} else {
if (downloadUrl.indexOf('itunes.apple.com') != -1) {
var ifr = document.createElement('iframe');
ifr.src = downloadUrl;
ifr.style.display = 'none';
window.setTimeout(function() {
document.body.appendChild(ifr);
}, 300)
} else {
formatUrl(downloadUrl);
}
}
}
} else {
// android
downloadUrl = window.downloadAppConfig.androidDownloadUrl;
handleSpecial(downloadUrl);
if(isSpecial){
return;
}
// 如果有oepnUrl
if (openUrl) {
window.location.href = openUrl;
return;
}
if (downloadUrl.indexOf('.apk') != -1 || downloadUrl.indexOf('dbnewopen') != -1) {
window.location.href = downloadUrl;
} else {
formatUrl(downloadUrl);
}
}
}
window.downloadApp = downloadApp;
})(Zepto);
declare class StartSkin extends eui.Skin{
}
import Loading from "../../loading/Loading";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { DataManager } from "../../../libs/tw/manager/DataManager";
const getStartOrderStatus = (callback: Function, customizedType?: number) => {
NetManager.ins.getStartStatus(
callback,
DataManager.ins.doStartData.ticketId,
() => { return DataManager.ins.getStartStatusData.code != 1; },
5,
customizedType);
}
/**
* 开始游戏
* @param {string} isAgain 是否是再来一次
* @param {number} credits 主动要求花费多少积分玩游戏
* @param {number} customizedType xx类型
*/
export default
(isAgain = false, credits?: number, customizedType?: number) => new Promise((resolve) => {
* 开始游戏
* @param callback
* @param isAgain
* @param credits
* @param customizedType
*/
const doStart = (callback: Function, isAgain = false, credits?: number, customizedType?: number) => {
if (window['requirelogin']) {
window['requirelogin']();
return;
}
const callback = (data) => {
Loading.instace.hide();
resolve(data);
}
Loading.instace.show();
NetManager.ins.doStart((success: boolean) => {
if (success) {
getStartOrderStatus(callback, customizedType);
......@@ -38,4 +23,20 @@ export default
isAgain,
credits,
customizedType);
});
\ No newline at end of file
}
/**
* 查询订单结果
* @param callback
* @param ticketId
* @param customizedType
*/
const getStartOrderStatus = (callback: Function, customizedType?: number) => {
NetManager.ins.getStartStatus(
callback,
DataManager.ins.doStartData.ticketId,
() => { return DataManager.ins.getStartStatusData.code != 1; },
5,
customizedType);
}
export default doStart;
\ No newline at end of file
import { IDynamicData } from "../../tw/data/game/datapash/IDynamicData";
import { NetManager } from "../../tw/manager/NetManager";
import { DataManager } from "../../tw/manager/DataManager";
/**
* 提交游戏成绩
* @param callback
* @param score 得分
* @param checkScore 是否校验得分
* @param customizedType 定制类型 1推币机
*/
const submit = (callback: Function, score: number, checkScore?: boolean, customizedType?: number) => {
const allDynamics = [];
gameSubmitData(callback, score, allDynamics, checkScore, customizedType);
}
/**
* 提交游戏成绩
* @param callback
* @param score 得分
* @param allDynamics 防作弊数据
* @param checkScore 是否校验得分
* @param customizedType 定制类型 1推币机
*/
const gameSubmitData = (callback: Function, score: number, allDynamics: IDynamicData[][], checkScore?: boolean, customizedType?: number) => {
NetManager.ins.gameSubmit(
(success: boolean) => {
if (success) {
getSubmitResult(callback, DataManager.ins.gameSubmitData.orderId);
} else {
callback(success);
}
},
DataManager.ins.doStartData.ticketId,
score,
'[]',
DataManager.ins.doStartData.submitToken,
JSON.stringify(allDynamics),
checkScore,
customizedType);
}
/**
* 查询提交结果
* @param callback
* @param orderId
*/
const getSubmitResult = (callback: Function, orderId: number) => {
NetManager.ins.getSubmitResult(callback, orderId, () => {
return DataManager.ins.gameGetSubmitResultData.flag;
});
}
export default submit;
\ No newline at end of file
import doStart from "./doStart";
import submit from "./submit";
const submitAfterDostart = (cb, score) => {
doStart(
() => submit(cb, score)
)
}
export default submitAfterDostart
\ No newline at end of file
// import { GLang } from './util/GLang';
// import { INetData } from './interface/INetData';
// import { GTime } from './util/GTime';
// import { GPool } from './util/GPool';
// import { GMath } from './util/GMath';
// import { GFun,getImgURL } from './util/GFun';
// import { GDispatcher } from './util/GDispatcher';
// import { GConsole } from './util/GConsole';
// import { GCache } from './util/GCache';
// import { ABPanelManager } from './manager/ABPanelManager';
// import { IModuleData } from './interface/IModuleData';
// import { IDestroy } from './interface/IDestroy';
// import { TimeFormat } from './enum/TimeFormat';
// import { ResPriority } from './enum/ResPriority';
// import { ModuleType } from './enum/ModuleType';
// import { LayoutType } from './enum/LayoutType';
// import { ABModule } from "./component/ABModule";
// import { IData } from './interface/IData';
// import { ABAnimationManager } from './manager/ABAnimationManager';
// import { ABAudioManager } from './manager/ABAudioManager';
// import { ABResManager } from './manager/ABResManager';
// import { ABSceneManager } from './manager/ABSceneManager';
// import { ABStageManager } from './manager/ABStageManager';
// import { ABDataManager } from './manager/ABDataManager';
// import { ABModuleManager } from './manager/ABModuleManager';
// import { ABNetManager } from './manager/ABNetManager';
// import { ABVideoManager } from './manager/ABVideoManager';
// export {
// ABModule, LayoutType, ModuleType, ResPriority, TimeFormat, IData, IDestroy, INetData,
// IModuleData, ABAnimationManager, ABAudioManager, ABDataManager, ABModuleManager, ABNetManager,
// ABPanelManager, ABResManager, ABSceneManager, ABStageManager, ABVideoManager, GCache, GConsole,
// GDispatcher, GFun, GMath, GPool, GTime, GLang,getImgURL
// }
export const a =1
\ No newline at end of file
......@@ -2,7 +2,7 @@
*Created by cuiliqiang on 2018/3/8
* 数据管理
*/
export abstract class ABDataManager {
export abstract class ABDataManager extends egret.EventDispatcher {
/**
* 更新数据
* @param {number} name 接口名字
......
......@@ -69,27 +69,26 @@ export class GFun {
}
}
const check_webp_feature = (callback) => {
export const check_webp_feature = () => {
const _support_webp_ = localStorage.getItem('_support_webp_');
if (_support_webp_ !== null) {
return callback(_support_webp_ === '1')
return _support_webp_ === '1';
}
const img = new Image();
img.onload = function () {
const result = (img.width > 0) && (img.height > 0);
callback(result);
localStorage.setItem('_support_webp_', result ? '1' : '0')
};
img.onerror = function () {
callback(false);
localStorage.setItem('_support_webp_', '0')
};
img.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA";
return false;
}
export const getImgURL = (url: string, cb) => {
check_webp_feature((isSupport) => {
if (isSupport) url += '?x-oss-process=image/format,webp';
cb(url)
})
}
\ No newline at end of file
// export const getImgURL = (url: string): any => {
// const isSupport = check_webp_feature();
// if (isSupport)
// return url + '?x-oss-process=image/format,webp';
// return url;
// }
\ No newline at end of file
export default function isIPhoneX() {
var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
return isIOS && screen.height == 812 && screen.width == 375
}
\ No newline at end of file
import PanelCtrl from "../../src/ctrls/panelCtrl";
import SceneCtrl from "../../src/ctrls/sceneCtrl";
import Loading from "../../src/loading/Loading";
import { getResPath } from "../../src/utils";
import layers from "../../src/views/layers";
import { DataManager } from "../tw/manager/DataManager";
import { NetManager } from "../tw/manager/NetManager";
import AssetAdapter from "./adapter/AssetAdapter";
import ThemeAdapter from "./adapter/ThemeAdapter";
import { check_webp_feature } from "../tc/util/GFun";
export default class MainBase extends eui.UILayer {
constructor() {
super();
check_webp_feature();
}
private injectRES() {
if (RES.fileSystem['getFileOld']) return;
RES.fileSystem['getFileOld'] = RES.fileSystem.getFile;
window['RES'].fileSystem.getFile = function (filename: string) {
//生效情况
//RES.getResByUrl spritesheet类型
//不生效
//RES.getResAsync('net_png') spritesheet类型
// if (filename.indexOf('.json') != -1) {
// var arr = filename.split('.json')[0].split('/');
// var filename1 = arr[arr.length - 1] + '_png';
// var filename2 = filename.split('.json')[0] + '.png';
// if (!RES.fileSystem['fsData'][filename1])
// RES.fileSystem['fsData'][filename1] =
// { name: filename1, type: 'image', url: filename2, root: '', extra: '1' };
// }
var result = RES.fileSystem['getFileOld'](filename);
if (result && result.url && check_webp_feature()) {
//生效情况
//RES.getResByUrl jpg or png类型
//RES.getResAsync('monkey_png')
if (filename.indexOf('png') != -1 || filename.indexOf('jpg') != -1)
result = JSON.parse(JSON.stringify(result));
// result.url = result.url.replace('.png', '.png?x-oss-process=image/format,webp');
result.url = result.url.replace('.jpg', '.jpg?x-oss-process=image/format,webp');
}
return result;
}
}
protected createChildren(): void {
super.createChildren();
egret.lifecycle.addLifecycleListener((context) => {
// custom lifecycle plugin
})
egret.lifecycle.onPause = () => {
// egret.ticker.pause();
}
egret.lifecycle.onResume = () => {
// egret.ticker.resume();
}
//inject the custom material parser
//注入自定义的素材解析器
let assetAdapter = new AssetAdapter();
egret.registerImplementation("eui.IAssetAdapter", assetAdapter);
egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
egret.ImageLoader.crossOrigin = "anonymous";
DataManager.ins.gameCfgData = window['CFG'];
DataManager.ins.gameCfgData.gameInfo.gameId = window["gameId"];
layers.init(this);
Loading.init(layers.topLayer);
PanelCtrl.instance.init(layers.popupLayer);
SceneCtrl.instance.init(layers.sceneLayer);
this.stage.scaleMode = egret.StageScaleMode.FIXED_WIDTH;
this.registerModules();
this.getData();
RES.setMaxLoadingThread(10);
this.runGame().catch(e => {
console.log(e);
})
}
protected getData() {
}
protected registerModules() { }
private async runGame() {
await this.loadResource()
this.createGameScene();
}
private async loadResource() {
try {
await RES.loadConfig("default.res.json", getResPath() + "resource/");
await this.loadTheme();
// this.injectRES();
}
catch (e) {
console.error(e);
}
}
private loadTheme() {
return new Promise((resolve, reject) => {
// load skin theme configuration file, you can manually modify the file. And replace the default skin.
//加载皮肤主题配置文件,可以手动修改这个文件。替换默认皮肤。
let theme = new eui.Theme("resource/default.thm.json", this.stage);
theme.addEventListener(eui.UIEvent.COMPLETE, () => {
resolve();
}, this);
})
}
/**
* 创建场景界面
* Create scene interface
*/
protected createGameScene() {
}
}
\ No newline at end of file
//////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014-present, Egret Technology.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Egret nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
export default class AssetAdapter implements eui.IAssetAdapter {
/**
* @language zh_CN
......
//////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014-present, Egret Technology.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Egret nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
export default class ThemeAdapter implements eui.IThemeAdapter {
/**
......
......@@ -155,21 +155,21 @@ export class DataManager extends ABDataManager {
public petsIndexData: PetsIndexData = new PetsIndexData();//外来宠物活动主页
private _getHomeInfoData: GetHomeInfoData;//活动主信息接口
private _getActToysListData: any = [];//商店道具接口
private _toyExchangesData:ToyExchangesData;//道具兑换
private _useToyData:UseToyData;//道具使用
private _getUserToysListData:GetUserToysListData;//已购买的道具
private _batchollectFoodData:Data;//粮食收取返回
private _toyExchangesData: ToyExchangesData;//道具兑换
private _useToyData: UseToyData;//道具使用
private _getUserToysListData: GetUserToysListData;//已购买的道具
private _batchollectFoodData: Data;//粮食收取返回
private _visitStatisticsData: VisitStatisticsData;//来访统计
private _getVisitInfoData:GetVisitInfoData;//来访统计
private _getVisitInfoData: GetVisitInfoData;//来访统计
private _visitDetailData: VisitDetailData;//到访记录详情
private _collectGiftRecord:Data;//礼物收取
private _collectGiftRecord: Data;//礼物收取
/**
* 插件信息列表
*/
private _getPrizeInfoList: any = {};
private _getRecordData:GetRecordData;
private _getRecordData: GetRecordData;
/**
* 更新数据
......@@ -510,7 +510,7 @@ export class DataManager extends ABDataManager {
data.update(result);
break;
case NetName.PETS_GET_HOME_INFO://外来宠物养成---活动主信息接口
if(!this._getHomeInfoData) {
if (!this._getHomeInfoData) {
this._getHomeInfoData = new GetHomeInfoData();
}
this._getHomeInfoData.update(result);
......@@ -518,35 +518,35 @@ export class DataManager extends ABDataManager {
break;
case NetName.PETS_GET_ACT_TOYS://外来宠物养成---商店道具接口
const toyType = param.toyType;
if(!this._getActToysListData[toyType]) {
if (!this._getActToysListData[toyType]) {
this._getActToysListData[toyType] = new GetActToysListData();
}
this._getActToysListData[toyType].update(result);
data = this._getActToysListData[toyType];
break;
case NetName.PETS_TOY_EXCHANGE://外来宠物养成---道具兑换
if(!this._toyExchangesData) {
if (!this._toyExchangesData) {
this._toyExchangesData = new ToyExchangesData();
}
this._toyExchangesData.update(result);
data = this._toyExchangesData;
break;
case NetName.PETS_USE_TOYS://外来宠物养成---道具使用
if(!this._useToyData) {
if (!this._useToyData) {
this._useToyData = new UseToyData();
}
this._useToyData.update(result);
data = this._useToyData;
break;
case NetName.PETS_GET_USER_TOYS://外来宠物养成---已购买的道具
if(!this._getUserToysListData) {
if (!this._getUserToysListData) {
this._getUserToysListData = new GetUserToysListData();
}
this._getUserToysListData.update(result);
data = this._getUserToysListData;
break;
case NetName.PETS_BATCHOLLECT_FOOD://外来宠物养成---收取猫草
if(!this._batchollectFoodData){
if (!this._batchollectFoodData) {
this._batchollectFoodData = new Data();
}
......@@ -554,14 +554,14 @@ export class DataManager extends ABDataManager {
data = this._batchollectFoodData;
break;
case NetName.PETS_VISI_STATISTICS://外来宠物养成---来访统计
if(!this._visitStatisticsData) {
if (!this._visitStatisticsData) {
this._visitStatisticsData = new VisitStatisticsData();
}
this._visitStatisticsData.update(result);
data = this._visitStatisticsData;
break;
case NetName.PETS_GET_VISIT_INFO://未来宠物养成---动态信息列表
if(!this._getVisitInfoData){
if (!this._getVisitInfoData) {
this._getVisitInfoData = new GetVisitInfoData();
}
......@@ -569,14 +569,14 @@ export class DataManager extends ABDataManager {
data = this._getVisitInfoData;
break;
case NetName.PETS_VISIT_DETAIL://外来宠物养成---到访记录详情
if(!this._visitDetailData) {
if (!this._visitDetailData) {
this._visitDetailData = new VisitDetailData();
}
this._visitDetailData.update(result);
data = this._visitDetailData;
break;
case NetName.PETS_COLLECT_GIFT_RECORD:
if(!this._collectGiftRecord) {
if (!this._collectGiftRecord) {
this._collectGiftRecord = new Data();
}
this._collectGiftRecord.update(result);
......@@ -609,22 +609,23 @@ export class DataManager extends ABDataManager {
data = result;
break;
case NetName.GET_RECORD://查询我的奖品记录
if(!this._getRecordData){
if (!this._getRecordData) {
this._getRecordData = new GetRecordData();
}
this._getRecordData.update(result);
data = this._getRecordData;
default:
this[this.getKey(name)]=result;
this[this.getKey(name)] = result;
}
this.dispatchEvent(new egret.Event('dataUpdate', false, false, name));
return data || result;
}
getData(name){
getData(name) {
return this[this.getKey(name)]
}
private getKey(name){
private getKey(name) {
return `_tw_data_${name}_`
}
......@@ -915,24 +916,24 @@ export class DataManager extends ABDataManager {
/**
* 查询我的奖品记录
*/
public get getRecordData():GetRecordData{
public get getRecordData(): GetRecordData {
return this._getRecordData;
}
/**
* 外来宠物养成--活动主信息接口
*/
public get getHomeInfoData():GetHomeInfoData{
public get getHomeInfoData(): GetHomeInfoData {
return this._getHomeInfoData;
}
public set getHomeInfoData(d:GetHomeInfoData){
public set getHomeInfoData(d: GetHomeInfoData) {
this._getHomeInfoData = d;
}
/**
* 收取猫草回调数据
*/
public get gtBatchollectFoodData():Data{
public get gtBatchollectFoodData(): Data {
return this._batchollectFoodData;
}
......@@ -940,50 +941,50 @@ export class DataManager extends ABDataManager {
/**
* 外来宠物养成--商店道具接口
*/
public get getActToysListData():GetActToysListData[]{
public get getActToysListData(): GetActToysListData[] {
return this._getActToysListData;
}
public set getActToysListData(d:GetActToysListData[]){
public set getActToysListData(d: GetActToysListData[]) {
this._getActToysListData = d;
}
/**
* 外来宠物养成--商店道具接口
*/
public get getUserToysListData():GetUserToysListData{
public get getUserToysListData(): GetUserToysListData {
return this._getUserToysListData;
}
public set getUserToysListData(d:GetUserToysListData){
public set getUserToysListData(d: GetUserToysListData) {
this._getUserToysListData = d;
}
/**
* 外来宠物养成--来访统计
*/
public get visitStatisticsData():VisitStatisticsData{
public get visitStatisticsData(): VisitStatisticsData {
return this._visitStatisticsData;
}
/**
* 外来宠物养成--动态信息列表
*/
public get getVisitInfoData():GetVisitInfoData{
public get getVisitInfoData(): GetVisitInfoData {
return this._getVisitInfoData;
}
/**
* 外来宠物养成--到访记录详情
*/
public get visitDetailData():VisitDetailData{
public get visitDetailData(): VisitDetailData {
return this._visitDetailData;
}
/**
* 外来宠物养成--礼物收取
*/
public get collectGiftRecord():Data{
public get collectGiftRecord(): Data {
return this._collectGiftRecord;
}
......
......@@ -171,7 +171,7 @@ export class NetManager extends ABNetManager {
/**
* 游戏基础信息
*/
public getInfo(callback: Function): void {
public getInfo(callback?: Function): void {
const net: INetData = {
name: NetName.GAME_INFO,
uri: '/ngame/new/getInfo',
......
{
"initial": [
"libs/modules/egret/egret.js",
"libs/modules/egret/egret.web.js",
"libs/modules/eui/eui.js",
"libs/modules/assetsmanager/assetsmanager.js",
"libs/modules/tween/tween.js",
"libs/modules/game/game.js",
"libs/modules/promise/promise.js"
],
"game": [
"bin-debug/libs/tw/data/pet/IToyItemData.js",
"bin-debug/libs/tc/index.js",
"bin-debug/libs/tc/enum/ModuleType.js",
"bin-debug/libs/tc/interface/IModuleData.js",
"bin-debug/libs/tc/interface/IDestroy.js",
"bin-debug/libs/tc/component/ABModule.js",
"bin-debug/libs/tc/enum/LayoutType.js",
"bin-debug/libs/tc/enum/TimeFormat.js",
"bin-debug/libs/tc/interface/IData.js",
"bin-debug/libs/tc/interface/INetData.js",
"bin-debug/libs/tc/manager/ABAnimationManager.js",
"bin-debug/libs/tc/manager/ABAudioManager.js",
"bin-debug/libs/tc/manager/ABDataManager.js",
"bin-debug/libs/tc/manager/ABModuleManager.js",
"bin-debug/libs/tc/util/GTime.js",
"bin-debug/libs/tc/util/GConsole.js",
"bin-debug/libs/tc/manager/ABNetManager.js",
"bin-debug/libs/tc/manager/ABPanelManager.js",
"bin-debug/libs/tc/manager/ABResManager.js",
"bin-debug/libs/tc/manager/ABSceneManager.js",
"bin-debug/libs/tc/manager/ABStageManager.js",
"bin-debug/libs/tc/manager/ABVideoManager.js",
"bin-debug/libs/tc/util/GMath.js",
"bin-debug/libs/tc/util/GFun.js",
"bin-debug/libs/tc/util/GCache.js",
"bin-debug/libs/tc/util/GDispatcher.js",
"bin-debug/libs/tc/util/GLang.js",
"bin-debug/libs/tc/util/GPool.js",
"bin-debug/types/sceneTypes.js",
"bin-debug/utils.js",
"bin-debug/components/ComponentBase.js",
"bin-debug/views/Panel.js",
"bin-debug/ctrls/panelCtrl.js",
"bin-debug/views/Scene.js",
"bin-debug/ctrls/sceneCtrl.js",
"bin-debug/loading/Loading.js",
"bin-debug/views/layers.js",
"bin-debug/libs/tw/data/pets/IPetMsgData.js",
"bin-debug/libs/tw/data/Data.js",
"bin-debug/libs/tw/data/pets/GetVisitInfoData.js",
"bin-debug/libs/tw/data/game/getInfo/IStatusData.js",
"bin-debug/libs/tw/data/game/getInfo/GetSummerInfoData.js",
"bin-debug/libs/tw/data/game/doRevive/GetReviveCardNumData.js",
"bin-debug/libs/tw/data/game/doRevive/DoReviveData.js",
"bin-debug/libs/tw/data/plug/doJoinPlugDraw/DoJoinPlugDrawData.js",
"bin-debug/libs/tw/enum/NetName.js",
"bin-debug/libs/tw/data/custom/questionSbumit/QuestionSubmitData.js",
"bin-debug/libs/tw/data/common/getCollectRule/ICollectGoodData.js",
"bin-debug/libs/tw/data/common/getCollectRule/ICollectRuleData.js",
"bin-debug/libs/tw/data/common/getCollectRule/GetCollectRuleData.js",
"bin-debug/libs/tw/data/game/datapash/DatapashData.js",
"bin-debug/libs/tw/data/common/openCollectGoodsPrize/openCollectGoodsPrizeData.js",
"bin-debug/libs/tw/util/TwLang.js",
"bin-debug/libs/tw/data/game/doStart/ExtraData.js",
"bin-debug/libs/tw/data/game/doStart/DoStartData.js",
"bin-debug/libs/tw/data/game/doStart/GetStartStatusData.js",
"bin-debug/libs/tw/data/game/getInfo/GetInfoData.js",
"bin-debug/libs/tw/data/game/getOptions/IGameOptionData.js",
"bin-debug/libs/tw/data/game/getOptions/GetOptionsData.js",
"bin-debug/libs/tw/data/game/getRule/GetRuleData.js",
"bin-debug/libs/tw/data/game/getUserTotalScore/GetUserTotalScoreData.js",
"bin-debug/libs/tw/data/game/guessPoker/GuessPokerData.js",
"bin-debug/libs/tw/data/game/submit/GameSubmitData.js",
"bin-debug/libs/tw/data/game/common/IUserData.js",
"bin-debug/libs/tw/data/game/realtimerank/RealTimeRankData.js",
"bin-debug/libs/tw/data/game/winranks/IConsumerData.js",
"bin-debug/libs/tw/data/game/winranks/IRankData.js",
"bin-debug/libs/tw/data/game/winranks/WinRanksData.js",
"bin-debug/libs/tw/data/custom/ajaxElement/ICustomOptionData.js",
"bin-debug/libs/tw/data/custom/ajaxElement/IElementData.js",
"bin-debug/libs/tw/data/custom/ajaxElement/AjaxElementData.js",
"bin-debug/libs/tw/data/custom/doJoin/DoJoinData.js",
"bin-debug/libs/tw/data/custom/ajaxThroughInfo/IThroughInfoData.js",
"bin-debug/libs/tw/data/custom/ajaxThroughInfo/AjaxThroughInfoData.js",
"bin-debug/libs/tw/data/custom/getOrderInfo/GetOrderInfoData.js",
"bin-debug/libs/tw/enum/LotteryType.js",
"bin-debug/libs/tw/data/common/IExposureData.js",
"bin-debug/libs/tw/data/common/lottery/LotteryData.js",
"bin-debug/libs/tw/data/custom/doJoin/GetCustomOrderStatusData.js",
"bin-debug/libs/tw/data/common/getRole/GetRoleData.js",
"bin-debug/libs/tw/data/common/getCredits/GetCreditsData.js",
"bin-debug/libs/tw/data/common/addTimesForActivity/AddTimesForActivityData.js",
"bin-debug/libs/tw/data/common/setRole/SetRoleData.js",
"bin-debug/libs/tw/data/game/submit/GameGetSubmitResultData.js",
"bin-debug/libs/tw/data/custom/throughSubmit/ThroughSubmitData.js",
"bin-debug/libs/tw/data/custom/beforSubmit/BeforSubmitData.js",
"bin-debug/libs/tw/data/pet/PetAdopteData.js",
"bin-debug/libs/tw/data/pet/PetFeedData.js",
"bin-debug/libs/tw/data/pet/PetStatusData.js",
"bin-debug/libs/tw/data/pet/SignInfoVo.js",
"bin-debug/libs/tw/data/pet/SignInfoData.js",
"bin-debug/libs/tw/data/pet/IPetToyData.js",
"bin-debug/libs/tw/data/pet/PetHomeInfoData.js",
"bin-debug/libs/tc/enum/ResPriority.js",
"bin-debug/libs/tw/data/pet/GetToysData.js",
"bin-debug/libs/tw/data/pet/ToyExchangeData.js",
"bin-debug/libs/tw/data/pet/ToyUseData.js",
"bin-debug/libs/tw/data/pet/CollectData.js",
"bin-debug/libs/tw/data/plug/doJoinPlugDraw/GetPlugOrderStatusData.js",
"bin-debug/libs/tw/data/plug/optionInfo/IPlugOptionData.js",
"bin-debug/libs/tw/data/plug/optionInfo/IPlugData.js",
"bin-debug/libs/tw/data/plug/optionInfo/OptionInfoData.js",
"bin-debug/libs/tw/data/plug/unblocking/UnblockingData.js",
"bin-debug/libs/tw/data/plug/getPrizeInfo/IPrizeData.js",
"bin-debug/libs/tw/data/plug/getPrizeInfo/GetPrizeInfoData.js",
"bin-debug/libs/tw/data/pet/PetIndexData.js",
"bin-debug/libs/tw/data/game/cfg/IAppData.js",
"bin-debug/libs/tw/data/game/cfg/IDefenseStrategyData.js",
"bin-debug/libs/tw/data/game/cfg/IExtraCfgData.js",
"bin-debug/libs/tw/data/game/cfg/IRecommendData.js",
"bin-debug/libs/tw/data/game/cfg/IGameData.js",
"bin-debug/libs/tw/data/game/cfg/IGameCfgData.js",
"bin-debug/libs/tw/data/pet/GetRankItemData.js",
"bin-debug/libs/tw/data/pet/GetRankListData.js",
"bin-debug/libs/tw/data/pet/GetFoodPilesData.js",
"bin-debug/libs/tw/data/common/record/RecordData.js",
"bin-debug/libs/tw/data/common/GetRecordData.js",
"bin-debug/libs/tw/data/pets/UseToyData.js",
"bin-debug/libs/tw/data/pets/GetActToysItemData.js",
"bin-debug/libs/tw/data/pets/GetActToysListData.js",
"bin-debug/libs/tw/data/pets/ToyExchangesData.js",
"bin-debug/libs/tw/data/pets/GetUserToysItemData.js",
"bin-debug/libs/tw/data/pets/GetUserToysListData.js",
"bin-debug/libs/tw/data/pets/IUsingPetToysData.js",
"bin-debug/libs/tw/data/pets/IWanderPetData.js",
"bin-debug/libs/tw/data/pets/GetHomeInfoData.js",
"bin-debug/libs/tw/data/pets/PetsIndexData.js",
"bin-debug/libs/tw/data/pets/IVisitPetData.js",
"bin-debug/libs/tw/data/pets/VisitStatisticsData.js",
"bin-debug/libs/tw/data/pets/IPlayToyDetailData.js",
"bin-debug/libs/tw/data/pets/VisitDetailData.js",
"bin-debug/libs/tw/data/custom/cfg/ICustomCfgData.js",
"bin-debug/libs/tw/manager/DataManager.js",
"bin-debug/libs/tw/manager/NetManager.js",
"bin-debug/libs/tl/adapter/AssetAdapter.js",
"bin-debug/libs/tl/adapter/ThemeAdapter.js",
"bin-debug/libs/tl/MainBase.js",
"bin-debug/libs/tw/data/common/IShareData.js",
"bin-debug/libs/tw/data/common/winners/IWinnerData.js",
"bin-debug/libs/tw/data/common/winners/WinnersData.js",
"bin-debug/libs/tw/data/game/datapash/IDynamicData.js",
"bin-debug/libs/tw/model/Model.js",
"bin-debug/libs/tw/model/common/ActivityModel.js",
"bin-debug/libs/tw/model/common/CustomModel.js",
"bin-debug/libs/tw/model/common/GameModel.js",
"bin-debug/libs/tw/model/common/RuleModel.js",
"bin-debug/libs/tw/model/common/SignModel.js",
"bin-debug/libs/tw/model/custom/CustomOptionInfoModel.js",
"bin-debug/libs/tw/model/custom/CustomPlayModel.js",
"bin-debug/libs/tw/model/custom/CustomPlayBeforModel.js",
"bin-debug/libs/tw/model/custom/CustomPlayThroughModel.js",
"bin-debug/libs/tw/model/custom/CustomWinModel.js",
"bin-debug/libs/tw/model/game/GameEndModel.js",
"bin-debug/libs/tw/model/game/GameEndRankModel.js",
"bin-debug/libs/tw/model/game/GameLoseModel.js",
"bin-debug/libs/tw/model/game/GameOptionModel.js",
"bin-debug/libs/tw/model/game/GamePlayModel.js",
"bin-debug/libs/tw/model/game/GameRealTimeRankModel.js",
"bin-debug/libs/tw/model/game/GameStartModel.js",
"bin-debug/libs/tw/model/game/GameWinModel.js",
"bin-debug/libs/tw/model/game/GameWinnerModel.js",
"bin-debug/libs/tw/model/plug/PlugWinModel.js",
"bin-debug/libs/tw/model/sign/SignAdopteModel.js",
"bin-debug/libs/tw/model/sign/SignPlayModel.js",
"bin-debug/libs/tw/util/Buried.js",
"bin-debug/libs/tw/util/Share.js",
"bin-debug/libs/tw/util/TwFun.js",
"bin-debug/scripts/ExmlPlugin2.js",
"bin-debug/scripts/MyExmlPlugin.js",
"bin-debug/scripts/PublishExmlOnly.js",
"bin-debug/scripts/config.js",
"bin-debug/alert/Msg.js",
"bin-debug/rulePanel/RulePanel.js",
"bin-debug/components/SheetAnimation.js",
"bin-debug/startScene/Box.js",
"bin-debug/startScene/BoxListCtrl.js",
"bin-debug/startScene/Monkey.js",
"bin-debug/startScene/Net.js",
"bin-debug/startScene/StartScene.js",
"bin-debug/Main.js",
"bin-debug/alert/Alert.js",
"bin-debug/ctrls/showAlertPanel.js",
"bin-debug/ctrls/net/doStart.js",
"bin-debug/ctrls/net/getRule.js",
"bin-debug/ctrls/net/realtimerank.js",
"bin-debug/startScene/data/getBoxList.js"
]
}
\ No newline at end of file
{
"type": "activity",
"name": "demo"
"name": "fishing"
}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert_3","version":5,"files":["../assets/alert/Bitmap-4.png","../assets/alert/Bitmap-2.png","../assets/alert/Bitmap-1.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_4","version":5,"files":["../assets/rule/ruleBg.png","../assets/rule/X.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert_4","version":5,"files":["../assets/alert/alertbg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"guide_1","version":5,"files":["../assets/startScene/guide/guide_tips.png","../assets/startScene/guide/guide_hand.png","../assets/startScene/guide/guide_dialog.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"option_3","version":5,"files":["../assets/option/line2.png","../assets/option/prizeBg.png","../assets/option/X-1.png","../assets/option/line.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"playScene_1","version":5,"files":["../assets/playScene/wheelBg2.png","../assets/playScene/wating.png","../assets/playScene/startBtnBg.png","../assets/playScene/sideLightL.png","../assets/playScene/sideLightD.png","../assets/playScene/ruleBtn.png","../assets/playScene/redPacket.png","../assets/playScene/outShell.png","../assets/playScene/myCreditsBg.png","../assets/playScene/multiple3.png","../assets/playScene/multiple.png","../assets/playScene/heartB.png","../assets/playScene/go.png","../assets/playScene/gift.png","../assets/playScene/finger.png","../assets/playScene/earnPanel.png","../assets/playScene/coinIcon.png","../assets/playScene/coinf8.png","../assets/playScene/coinf7.png","../assets/playScene/coinf6.png","../assets/playScene/coinf5.png","../assets/playScene/coinf4.png","../assets/playScene/coinf3.png","../assets/playScene/coinf2.png","../assets/playScene/coinf1.png","../assets/playScene/circleLight2.png","../assets/playScene/circleLight1.png","../assets/playScene/+.png","../assets/playScene/-_.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize_5","version":5,"files":["../assets/prize/prizePanelbg.png","../assets/prize/PrizePanelX.png","../assets/prize/prizePanelUseBtn.png"]}
\ No newline at end of file
{"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
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"loading_2","version":5,"files":["../assets/loading/bg.png","../assets/loading/progress.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_0","version":5,"files":["../assets/rule/ruleBg.png","../assets/rule/X.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"msg_0","version":5,"files":["../assets/msg/msgBg.png","../assets/msg/x.png","../assets/msg/sureBtn.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"startscene_2","version":5,"files":["../assets/startScene/ruleBtn.png","../assets/startScene/optionBtn.png"]}
\ No newline at end of file
{"mc":{
"coin":{
"frameRate":24,
"labels":[
{"name":"rotate","frame":1,"end":8}
],
"events":[
],
"frames":[
{
"res":"DB0A020",
"x":0,
"y":0
},
{
"res":"11118EED",
"x":0,
"y":0
},
{
"res":"3ED3A22C",
"x":8,
"y":0
},
{
"res":"EA81E94D",
"x":20,
"y":0
},
{
"res":"9D677726",
"x":37,
"y":0
},
{
"res":"7A80B82A",
"x":20,
"y":0
},
{
"res":"AA7CF946",
"x":8,
"y":0
},
{
"res":"2E51F51A",
"x":0,
"y":0
}
]
}},
"res":{
"AA7CF946":{"x":176,"y":97,"w":78,"h":94},
"11118EED":{"x":1,"y":1,"w":93,"h":94},
"EA81E94D":{"x":191,"y":1,"w":53,"h":94},
"2E51F51A":{"x":96,"y":1,"w":93,"h":94},
"7A80B82A":{"x":1,"y":193,"w":53,"h":94},
"3ED3A22C":{"x":96,"y":97,"w":78,"h":94},
"9D677726":{"x":56,"y":193,"w":20,"h":94},
"DB0A020":{"x":1,"y":97,"w":93,"h":94}
}}
\ No newline at end of file
{"mc":{
"go":{
"frameRate":20,
"labels":[
{"name":"light","frame":1,"end":30}
],
"events":[
],
"frames":[
{
"res":"A9D1D9F7",
"x":8,
"y":5
},
{
"res":"A9D1D9F7",
"x":8,
"y":5
},
{
"res":"165B8393",
"x":8,
"y":5
},
{
"res":"165B8393",
"x":8,
"y":5
},
{
"res":"C533ADB8",
"x":8,
"y":5
},
{
"res":"C533ADB8",
"x":8,
"y":5
},
{
"res":"7C56153B",
"x":6,
"y":5
},
{
"res":"C3226410",
"x":6,
"y":5
},
{
"res":"C3226410",
"x":6,
"y":5
},
{
"res":"8A450EA9",
"x":8,
"y":5
},
{
"res":"764FAFD2",
"x":8,
"y":5
},
{
"res":"A86D3DEA",
"x":8,
"y":5
},
{
"res":"F8A55074",
"x":8,
"y":4
},
{
"res":"6DDF7B77",
"x":8,
"y":4
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"AF8A3362",
"x":8,
"y":5
},
{
"res":"10E93F01",
"x":8,
"y":5
}
]
}},
"res":{
"10E93F01":{"x":709,"y":1,"w":174,"h":176},
"C3226410":{"x":1,"y":1,"w":176,"h":176},
"764FAFD2":{"x":1,"y":179,"w":174,"h":176},
"C533ADB8":{"x":1,"y":357,"w":174,"h":176},
"6DDF7B77":{"x":533,"y":1,"w":174,"h":177},
"F8A55074":{"x":357,"y":1,"w":174,"h":177},
"A86D3DEA":{"x":177,"y":179,"w":174,"h":176},
"165B8393":{"x":709,"y":179,"w":174,"h":176},
"A9D1D9F7":{"x":353,"y":180,"w":174,"h":176},
"AF8A3362":{"x":529,"y":180,"w":174,"h":176},
"7C56153B":{"x":179,"y":1,"w":176,"h":176},
"8A450EA9":{"x":177,"y":357,"w":174,"h":176}
}}
\ No newline at end of file
egret/resource/assets/rule/X.png

5.36 KB | W: | H:

egret/resource/assets/rule/X.png

3.92 KB | W: | H:

egret/resource/assets/rule/X.png
egret/resource/assets/rule/X.png
egret/resource/assets/rule/X.png
egret/resource/assets/rule/X.png
  • 2-up
  • Swipe
  • Onion skin
{"file":"coin.png","frames":{
"00":{"x":852,"y":163,"w":109,"h":111,"offX":64,"offY":10,"sourceW":246,"sourceH":181},
"01":{"x":856,"y":0,"w":109,"h":161,"offX":61,"offY":11,"sourceW":246,"sourceH":181},
"03":{"x":637,"y":311,"w":189,"h":158,"offX":24,"offY":14,"sourceW":246,"sourceH":181},
"02":{"x":828,"y":311,"w":186,"h":160,"offX":25,"offY":12,"sourceW":246,"sourceH":181},
"06":{"x":435,"y":158,"w":200,"h":153,"offX":19,"offY":19,"sourceW":246,"sourceH":181},
"07":{"x":647,"y":156,"w":203,"h":153,"offX":18,"offY":19,"sourceW":246,"sourceH":181},
"11":{"x":0,"y":0,"w":217,"h":160,"offX":12,"offY":12,"sourceW":246,"sourceH":181},
"05":{"x":0,"y":162,"w":196,"h":155,"offX":21,"offY":18,"sourceW":246,"sourceH":181},
"04":{"x":219,"y":161,"w":193,"h":158,"offX":22,"offY":16,"sourceW":246,"sourceH":181},
"10":{"x":219,"y":0,"w":214,"h":159,"offX":13,"offY":14,"sourceW":246,"sourceH":181},
"09":{"x":435,"y":0,"w":210,"h":156,"offX":15,"offY":16,"sourceW":246,"sourceH":181},
"08":{"x":647,"y":0,"w":207,"h":154,"offX":16,"offY":18,"sourceW":246,"sourceH":181}}}
\ No newline at end of file
{"file":"gift.png","frames":{
"00":{"x":0,"y":615,"w":152,"h":148,"offX":40,"offY":20,"sourceW":237,"sourceH":239},
"01":{"x":194,"y":811,"w":152,"h":209,"offX":40,"offY":20,"sourceW":237,"sourceH":239},
"03":{"x":200,"y":405,"w":189,"h":205,"offX":23,"offY":24,"sourceW":237,"sourceH":239},
"02":{"x":0,"y":406,"w":186,"h":207,"offX":24,"offY":21,"sourceW":237,"sourceH":239},
"06":{"x":0,"y":207,"w":198,"h":197,"offX":20,"offY":32,"sourceW":237,"sourceH":239},
"07":{"x":210,"y":204,"w":202,"h":199,"offX":19,"offY":30,"sourceW":237,"sourceH":239},
"05":{"x":188,"y":612,"w":195,"h":197,"offX":21,"offY":31,"sourceW":237,"sourceH":239},
"04":{"x":0,"y":811,"w":192,"h":200,"offX":22,"offY":28,"sourceW":237,"sourceH":239},
"09":{"x":0,"y":0,"w":208,"h":205,"offX":17,"offY":24,"sourceW":237,"sourceH":239},
"08":{"x":210,"y":0,"w":205,"h":202,"offX":18,"offY":27,"sourceW":237,"sourceH":239}}}
\ No newline at end of file
{"file":"gift2.png","frames":{
"00":{"x":347,"y":320,"w":156,"h":157,"offX":42,"offY":7,"sourceW":244,"sourceH":184},
"01":{"x":189,"y":320,"w":156,"h":157,"offX":42,"offY":7,"sourceW":244,"sourceH":184},
"03":{"x":817,"y":160,"w":191,"h":158,"offX":27,"offY":10,"sourceW":244,"sourceH":184},
"02":{"x":0,"y":319,"w":187,"h":157,"offX":29,"offY":8,"sourceW":244,"sourceH":184},
"06":{"x":211,"y":160,"w":204,"h":158,"offX":20,"offY":18,"sourceW":244,"sourceH":184},
"07":{"x":0,"y":159,"w":209,"h":158,"offX":17,"offY":18,"sourceW":244,"sourceH":184},
"11":{"x":0,"y":0,"w":225,"h":157,"offX":8,"offY":8,"sourceW":244,"sourceH":184},
"05":{"x":417,"y":160,"w":200,"h":158,"offX":22,"offY":16,"sourceW":244,"sourceH":184},
"04":{"x":619,"y":160,"w":196,"h":158,"offX":24,"offY":13,"sourceW":244,"sourceH":184},
"10":{"x":227,"y":0,"w":222,"h":158,"offX":10,"offY":10,"sourceW":244,"sourceH":184},
"09":{"x":451,"y":0,"w":217,"h":158,"offX":13,"offY":13,"sourceW":244,"sourceH":184},
"08":{"x":670,"y":0,"w":213,"h":158,"offX":15,"offY":16,"sourceW":244,"sourceH":184}}}
\ No newline at end of file
{"file":"goldenbox.png","frames":{
"00":{"x":208,"y":259,"w":163,"h":126,"offX":47,"offY":21,"sourceW":260,"sourceH":170},
"01":{"x":848,"y":258,"w":163,"h":126,"offX":47,"offY":21,"sourceW":260,"sourceH":170},
"03":{"x":444,"y":258,"w":202,"h":127,"offX":29,"offY":24,"sourceW":260,"sourceH":170},
"02":{"x":648,"y":258,"w":198,"h":127,"offX":31,"offY":22,"sourceW":260,"sourceH":170},
"06":{"x":682,"y":129,"w":213,"h":127,"offX":23,"offY":30,"sourceW":260,"sourceH":170},
"07":{"x":463,"y":129,"w":217,"h":127,"offX":21,"offY":30,"sourceW":260,"sourceH":170},
"11":{"x":0,"y":0,"w":231,"h":132,"offX":14,"offY":22,"sourceW":260,"sourceH":170},
"05":{"x":233,"y":130,"w":209,"h":127,"offX":25,"offY":28,"sourceW":260,"sourceH":170},
"04":{"x":0,"y":134,"w":206,"h":127,"offX":27,"offY":26,"sourceW":260,"sourceH":170},
"10":{"x":233,"y":0,"w":228,"h":128,"offX":15,"offY":24,"sourceW":260,"sourceH":170},
"09":{"x":463,"y":0,"w":224,"h":127,"offX":17,"offY":26,"sourceW":260,"sourceH":170},
"08":{"x":689,"y":0,"w":221,"h":127,"offX":19,"offY":28,"sourceW":260,"sourceH":170}}}
\ No newline at end of file
{"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
{"file":"net.png","frames":{
"00":{"x":0,"y":430,"w":609,"h":428,"offX":69,"offY":104,"sourceW":750,"sourceH":558},
"01":{"x":1222,"y":0,"w":609,"h":428,"offX":69,"offY":104,"sourceW":750,"sourceH":558},
"03":{"x":611,"y":855,"w":610,"h":383,"offX":68,"offY":59,"sourceW":750,"sourceH":558},
"02":{"x":1223,"y":430,"w":610,"h":414,"offX":68,"offY":81,"sourceW":750,"sourceH":558},
"06":{"x":0,"y":1240,"w":610,"h":372,"offX":68,"offY":39,"sourceW":750,"sourceH":558},
"07":{"x":1223,"y":846,"w":610,"h":389,"offX":68,"offY":84,"sourceW":750,"sourceH":558},
"05":{"x":612,"y":1610,"w":610,"h":371,"offX":68,"offY":19,"sourceW":750,"sourceH":558},
"04":{"x":1223,"y":1237,"w":612,"h":371,"offX":65,"offY":32,"sourceW":750,"sourceH":558},
"10":{"x":611,"y":0,"w":609,"h":428,"offX":69,"offY":104,"sourceW":750,"sourceH":558},
"09":{"x":0,"y":0,"w":609,"h":428,"offX":69,"offY":104,"sourceW":750,"sourceH":558},
"08":{"x":611,"y":430,"w":610,"h":423,"offX":68,"offY":100,"sourceW":750,"sourceH":558}}}
\ No newline at end of file
{"file":"openstate.png","frames":{
"silverboxOpenState":{"x":0,"y":0,"w":292,"h":222,"offX":0,"offY":0,"sourceW":292,"sourceH":222},
"woodboxOpenState":{"x":762,"y":0,"w":220,"h":209,"offX":0,"offY":0,"sourceW":220,"sourceH":209},
"coinOpenState":{"x":294,"y":216,"w":148,"h":151,"offX":2,"offY":3,"sourceW":150,"sourceH":154},
"gift2OpenState":{"x":543,"y":0,"w":217,"h":232,"offX":0,"offY":0,"sourceW":217,"sourceH":232},
"goldenboxOpenState":{"x":294,"y":0,"w":247,"h":214,"offX":0,"offY":0,"sourceW":247,"sourceH":214},
"giftOpenState":{"x":762,"y":211,"w":206,"h":218,"offX":0,"offY":0,"sourceW":206,"sourceH":218}}}
\ No newline at end of file
{"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
{"file":"silverbox.png","frames":{
"00":{"x":750,"y":266,"w":160,"h":130,"offX":67,"offY":12,"sourceW":273,"sourceH":166},
"01":{"x":588,"y":266,"w":160,"h":130,"offX":67,"offY":12,"sourceW":273,"sourceH":166},
"03":{"x":0,"y":266,"w":213,"h":131,"offX":36,"offY":15,"sourceW":273,"sourceH":166},
"02":{"x":215,"y":266,"w":209,"h":131,"offX":38,"offY":13,"sourceW":273,"sourceH":166},
"06":{"x":231,"y":133,"w":225,"h":131,"offX":30,"offY":23,"sourceW":273,"sourceH":166},
"12":{"x":426,"y":266,"w":160,"h":130,"offX":67,"offY":12,"sourceW":273,"sourceH":166},
"07":{"x":0,"y":133,"w":229,"h":131,"offX":28,"offY":23,"sourceW":273,"sourceH":166},
"11":{"x":0,"y":0,"w":245,"h":131,"offX":20,"offY":13,"sourceW":273,"sourceH":166},
"05":{"x":458,"y":133,"w":221,"h":131,"offX":32,"offY":21,"sourceW":273,"sourceH":166},
"04":{"x":681,"y":133,"w":217,"h":131,"offX":34,"offY":18,"sourceW":273,"sourceH":166},
"10":{"x":247,"y":0,"w":241,"h":131,"offX":22,"offY":15,"sourceW":273,"sourceH":166},
"09":{"x":490,"y":0,"w":237,"h":131,"offX":24,"offY":18,"sourceW":273,"sourceH":166},
"08":{"x":729,"y":0,"w":233,"h":131,"offX":26,"offY":21,"sourceW":273,"sourceH":166}}}
\ No newline at end of file
{"file":"woodbox.png","frames":{
"00":{"x":0,"y":301,"w":147,"h":148,"offX":44,"offY":5,"sourceW":230,"sourceH":180},
"01":{"x":149,"y":301,"w":146,"h":148,"offX":44,"offY":5,"sourceW":230,"sourceH":180},
"03":{"x":564,"y":151,"w":177,"h":148,"offX":28,"offY":8,"sourceW":230,"sourceH":180},
"02":{"x":743,"y":151,"w":173,"h":148,"offX":30,"offY":6,"sourceW":230,"sourceH":180},
"06":{"x":0,"y":150,"w":190,"h":149,"offX":21,"offY":14,"sourceW":230,"sourceH":180},
"07":{"x":826,"y":0,"w":194,"h":149,"offX":18,"offY":14,"sourceW":230,"sourceH":180},
"11":{"x":0,"y":0,"w":211,"h":148,"offX":9,"offY":6,"sourceW":230,"sourceH":180},
"05":{"x":192,"y":150,"w":186,"h":149,"offX":23,"offY":13,"sourceW":230,"sourceH":180},
"04":{"x":380,"y":151,"w":182,"h":149,"offX":25,"offY":10,"sourceW":230,"sourceH":180},
"10":{"x":213,"y":0,"w":207,"h":148,"offX":11,"offY":8,"sourceW":230,"sourceH":180},
"09":{"x":422,"y":0,"w":202,"h":149,"offX":14,"offY":10,"sourceW":230,"sourceH":180},
"08":{"x":626,"y":0,"w":198,"h":149,"offX":16,"offY":13,"sourceW":230,"sourceH":180}}}
\ No newline at end of file
{
"groups": [
{
"keys": "msgBg_png,x_png,sureBtn_png",
"name": "msg"
},
{
"keys": "wheelBg2_png,wating_png,startBtnBg_png,sideLightL_png,sideLightD_png,ruleBtn_png,redPacket_png,outShell_png,myCreditsBg_png,multiple3_png,multiple_png,heartB_png,goBtn_png,goBtn_json,go_png,gift_png,finger_png,earnPanel_png,coinIcon_png,coinf8_png,coinf7_png,coinf6_png,coinf5_png,coinf4_png,coinf3_png,coinf2_png,coinf1_png,coin_png,coin_json,circleLight2_png,circleLight1_png,+_png,-__png,playSceneBg_jpg",
"name": "playScene"
},
{
"keys": "bg_png,progress_png",
"name": "loading"
},
{
"keys": "Bitmap-4_png,Bitmap-2_png,Bitmap-1_png",
"name": "alert"
},
{
"keys": "ruleBg_png,X_png",
"name": "rule"
},
{
"keys": "playSceneBg_jpg",
"name": "preload"
}
],
"resources": [
{
"url": "assets/alert/Bitmap-1.png",
"type": "image",
"name": "Bitmap-1_png"
"keys": "guide_tips_png,guide_hand_png,guide_dialog_png",
"name": "guide"
},
{
"url": "assets/alert/Bitmap-2.png",
"type": "image",
"name": "Bitmap-2_png"
"keys": "ruleBtn_png,optionBtn_png",
"name": "startscene"
},
{
"url": "assets/alert/Bitmap-4.png",
"type": "image",
"name": "Bitmap-4_png"
"keys": "line2_png,prizeBg_png,X-1_png,line_png",
"name": "option"
},
{
"url": "assets/msg/msgBg.png",
"type": "image",
"name": "msgBg_png"
"keys": "alertbg_png",
"name": "alert"
},
{
"url": "assets/msg/sureBtn.png",
"type": "image",
"name": "sureBtn_png"
"keys": "prizePanelbg_png,PrizePanelX_png,prizePanelUseBtn_png",
"name": "prize"
},
{
"url": "assets/msg/x.png",
"type": "image",
"name": "x_png"
},
"keys": "river4_png,river3_png,river2_png,river1_png,river5_png,river6_png,river7_png",
"name": "river"
}
],
"resources": [
{
"url": "assets/playScene/+.png",
"url": "assets/rule/X.png",
"type": "image",
"name": "+_png"
"name": "X_png"
},
{
"url": "assets/playScene/-_.png",
"url": "assets/rule/ruleBg.png",
"type": "image",
"name": "-__png"
"name": "ruleBg_png"
},
{
"url": "assets/playScene/circleLight1.png",
"url": "assets/startScene/bg.jpg",
"type": "image",
"name": "circleLight1_png"
"name": "bg_jpg"
},
{
"url": "assets/playScene/circleLight2.png",
"url": "assets/startScene/gift2.png",
"type": "image",
"name": "circleLight2_png"
"name": "gift2_png"
},
{
"url": "assets/playScene/coin.png",
"url": "assets/startScene/coin.png",
"type": "image",
"name": "coin_png"
},
{
"url": "assets/playScene/coinIcon.png",
"type": "image",
"name": "coinIcon_png"
},
{
"url": "assets/playScene/coinf1.png",
"type": "image",
"name": "coinf1_png"
},
{
"url": "assets/playScene/coinf2.png",
"url": "assets/startScene/gift.png",
"type": "image",
"name": "coinf2_png"
"name": "gift_png"
},
{
"url": "assets/playScene/coinf3.png",
"url": "assets/startScene/goldenbox.png",
"type": "image",
"name": "coinf3_png"
"name": "goldenbox_png"
},
{
"url": "assets/playScene/coinf4.png",
"url": "assets/startScene/silverbox.png",
"type": "image",
"name": "coinf4_png"
"name": "silverbox_png"
},
{
"url": "assets/playScene/coinf5.png",
"type": "image",
"name": "coinf5_png"
"url": "assets/startScene/woodbox.json",
"type": "sheet",
"name": "woodbox_json",
"subkeys": "00,01,02,03,04,05,06,07,08,09,10,11"
},
{
"url": "assets/playScene/coinf6.png",
"type": "image",
"name": "coinf6_png"
"url": "assets/startScene/net.json",
"type": "sheet",
"name": "net_json",
"subkeys": "00,01,02,03,04,05,06,07,08,09,10"
},
{
"url": "assets/playScene/coinf7.png",
"url": "assets/startScene/guide/guide_tips.png",
"type": "image",
"name": "coinf7_png"
"name": "guide_tips_png"
},
{
"url": "assets/playScene/coinf8.png",
"url": "assets/startScene/guide/guide_hand.png",
"type": "image",
"name": "coinf8_png"
"name": "guide_hand_png"
},
{
"url": "assets/playScene/earnPanel.png",
"url": "assets/startScene/guide/guide_dialog.png",
"type": "image",
"name": "earnPanel_png"
"name": "guide_dialog_png"
},
{
"url": "assets/playScene/finger.png",
"url": "assets/startScene/optionBtn.png",
"type": "image",
"name": "finger_png"
},
{
"url": "assets/playScene/gift.png",
"type": "image",
"name": "gift_png"
"name": "optionBtn_png"
},
{
"url": "assets/playScene/go.png",
"url": "assets/startScene/ruleBtn.png",
"type": "image",
"name": "go_png"
"name": "ruleBtn_png"
},
{
"url": "assets/playScene/goBtn.png",
"url": "assets/option/line2.png",
"type": "image",
"name": "goBtn_png"
"name": "line2_png"
},
{
"url": "assets/playScene/heartB.png",
"url": "assets/option/prizeBg.png",
"type": "image",
"name": "heartB_png"
"name": "prizeBg_png"
},
{
"url": "assets/playScene/multiple.png",
"url": "assets/option/X-1.png",
"type": "image",
"name": "multiple_png"
"name": "X-1_png"
},
{
"url": "assets/playScene/multiple3.png",
"url": "assets/option/line.png",
"type": "image",
"name": "multiple3_png"
"name": "line_png"
},
{
"url": "assets/playScene/myCreditsBg.png",
"url": "assets/alert/alertbg.png",
"type": "image",
"name": "myCreditsBg_png"
"name": "alertbg_png"
},
{
"url": "assets/playScene/outShell.png",
"url": "assets/prize/prizePanelbg.png",
"type": "image",
"name": "outShell_png"
"name": "prizePanelbg_png"
},
{
"url": "assets/playScene/redPacket.png",
"url": "assets/prize/PrizePanelX.png",
"type": "image",
"name": "redPacket_png"
"name": "PrizePanelX_png"
},
{
"url": "assets/playScene/ruleBtn.png",
"url": "assets/prize/prizePanelUseBtn.png",
"type": "image",
"name": "ruleBtn_png"
"name": "prizePanelUseBtn_png"
},
{
"url": "assets/playScene/sideLightD.png",
"type": "image",
"name": "sideLightD_png"
"url": "assets/startScene/monkey.json",
"type": "sheet",
"name": "monkey_json",
"subkeys": "eyeleft,eyeright,monkey"
},
{
"url": "assets/playScene/sideLightL.png",
"type": "image",
"name": "sideLightL_png"
"url": "assets/startScene/kids.json",
"type": "sheet",
"name": "kids_json",
"subkeys": "boy_eye,boyhand,girl_eye,girlhand,kids,kidschair"
},
{
"url": "assets/playScene/startBtnBg.png",
"type": "image",
"name": "startBtnBg_png"
"url": "assets/startScene/river.json",
"type": "sheet",
"name": "river_json",
"subkeys": "river1,river2,river3,river4"
},
{
"url": "assets/playScene/wating.png",
"url": "assets/startScene/river/river4.png",
"type": "image",
"name": "wating_png"
"name": "river4_png"
},
{
"url": "assets/playScene/wheelBg2.png",
"url": "assets/startScene/river/river3.png",
"type": "image",
"name": "wheelBg2_png"
"name": "river3_png"
},
{
"url": "assets/loading/bg.png",
"url": "assets/startScene/river/river2.png",
"type": "image",
"name": "bg_png"
"name": "river2_png"
},
{
"url": "assets/loading/progress.png",
"url": "assets/startScene/river/river1.png",
"type": "image",
"name": "progress_png"
"name": "river1_png"
},
{
"url": "assets/rule/X.png",
"url": "assets/startScene/river/river5.png",
"type": "image",
"name": "X_png"
"name": "river5_png"
},
{
"url": "assets/rule/ruleBg.png",
"url": "assets/startScene/river/river7.png",
"type": "image",
"name": "ruleBg_png"
},
{
"url": "assets/playScene/coin.json",
"type": "json",
"name": "coin_json"
},
{
"url": "assets/playScene/goBtn.json",
"type": "json",
"name": "goBtn_json"
"name": "river7_png"
},
{
"url": "assets/playScene/playSceneBg.jpg",
"url": "assets/startScene/river/river6.png",
"type": "image",
"name": "playSceneBg_jpg"
"name": "river6_png"
}
]
}
\ No newline at end of file
......@@ -3,16 +3,12 @@
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/AlertSkin.exml",
"resource/skins/LoadingSkin.exml",
"resource/skins/MsgSkin.exml",
"resource/skins/PlaySkin.exml",
"resource/skins/OptionItemSkin.exml",
"resource/skins/OptionsSkin.exml",
"resource/skins/PrizeSkin.exml",
"resource/skins/RuleSkin.exml",
"resource/skins/component/ResultPanel.exml",
"resource/skins/component/WheelBg.exml",
"resource/skins/component/WheelGift.exml",
"resource/skins/ui/IconButtonSkin.exml",
"resource/skins/ui/ProgressBarSkin.exml",
"resource/skins/ui/StartButtonSkin.exml"
"resource/skins/StartSkin.exml",
"resource/skins/VScrollBarSkin.exml"
],
"path": "resource/default.thm.json"
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="AlertSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="Bitmap-1_png" y="175" horizontalCenter="0"/>
<e:Button id="confirmBtn" label="{data.btnTxt}" y="361" horizontalCenter="0">
<w:Config id="16680af117d"/>
<e:Button id="closeBtn" label="" y="99" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="Bitmap-2_png" source.down="Bitmap-2_png" source.disabled="Bitmap-2_png" horizontalCenter.down="0" verticalCenter.down="0"/>
<e:Image width="100%" height="100%" source="alertbg_png" source.down="alertbg_png" source.disabled="alertbg_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="closeBtn" label="" x="586.18" y="143">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="Bitmap-4_png" source.down="Bitmap-4_png" source.disabled="Bitmap-4_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label text="{data.message}" y="239" textColor="0x000000" horizontalCenter="0"/>
<e:Label touchEnabled="false" text="{data.message}" y="489" textColor="0xdd773d" size="50" width="452" anchorOffsetY="0" horizontalCenter="0" height="181" textAlign="center" bold="true"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="loadingSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:tween="egret.tween.*">
<w:Declarations>
</w:Declarations>
<e:Image y="288" source="bg_png" horizontalCenter="0"/>
<e:Image id="waitImg" source="progress_png" y="380" anchorOffsetX="28" anchorOffsetY="28" horizontalCenter="0" rotation="{data.speed}"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="MsgSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect id="dark" width="750" height="1624" x="0" y="0" fillAlpha="0.5"/>
<e:Image id="bg" y="160" x="105.5" source="msgBg_png"/>
<e:Button id="confirmBtn" label="{data.btnTxt}" y="610" x="209.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="sureBtn_png" source.down="sureBtn_png" source.disabled="sureBtn_png"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="closeBtn" label="" x="562.83" y="398.51">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="x_png" source.down="x_png" source.disabled="x_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="msgTxt" text="{data.message}" y="469.51" textColor="0xeeeeee" anchorOffsetX="0" width="380.66" anchorOffsetY="0" height="113.34" size="34" textAlign="center" horizontalCenter="0"/>
<e:Button id="creditsOutBtn" label="" x="209.33" y="610">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="sureBtn_png" source.down="sureBtn_png" source.disabled="sureBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="OptionItemSkin" width="525" xmlns:e="http://ns.egret.com/eui" height="200">
<e:Label x="145" y="0" width="190" textAlign="center" textColor="0x000000" size="24" height="30" verticalAlign="middle" text="{data.scope}"/>
<e:Label text="{data.name}" x="173.55" y="43.5" textAlign="left" textColor="0x000000" />
<e:Label x="173.55" y="92" textAlign="left" width="296.5" textColor="0x000000" text="{data.description}" size="24" />
<e:Image width="120" height="120" x="0" y="46" source="{data.logo}" />
<e:Image x="0" y="14" source="line_png"/>
<e:Image x="344" y="14" source="line2_png"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="OptionsSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<w:Config id="1667fb18fa6"/>
<e:Image y="126" horizontalCenter="0" source="prizeBg_png"/>
<e:Button id="closeBtn" label="" x="687" y="157">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="X-1_png" source.down="X-1_png" source.disabled="X-1_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Scroller id="scroll" width="500" height="638" y="302" horizontalCenter="0" scrollPolicyH="off" scrollPolicyV="on">
<e:Group id="group" y="-2">
<e:List id="list" width="100%">
</e:List>
</e:Group>
</e:Scroller>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PlaySkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" >
<e:Image id="gamebg" x="0" y="0" source="playSceneBg_jpg"/>
<e:Button id="ruleBtn" label="" skinName="ui.IconButtonSkin" icon="ruleBtn_png" name="ruleBtn" horizontalCenter="-340" verticalCenter="-522.5"/>
<e:Button id="addBtn" label="" icon="+_png" name="addBtn" skinName="ui.IconButtonSkin" horizontalCenter="129.5" verticalCenter="388"/>
<e:Button id="reduceBtn" label="" icon="-__png" name="reduceBtn" skinName="ui.IconButtonSkin" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="-61.5" verticalCenter="388"/>
<e:Component id="WheelBg" skinName="WheelBg" width="603" height="603" horizontalCenter="0" verticalCenter="-23.5"/>
<e:Image id="outShell" source="outShell_png" verticalCenter="-20.5" horizontalCenter="3.5"/>
<e:Button id="startBtn" label="" icon="startBtnBg_png" horizontalCenter="0.5" verticalCenter="-40" skinName="ui.StartButtonSkin"/>
<e:Label id="unitTxt" text="投入积分" x="201.61" y="960" anchorOffsetX="0" width="63.39" anchorOffsetY="0" height="63.97" textAlign="center" textColor="0xffc303" fontFamily="微软雅黑"/>
<e:Label id="costTxt" text="40" size="40" anchorOffsetX="0" width="132" x="343" y="974.24" textAlign="center"/>
<e:Image id="myCreditsBg" source="myCreditsBg_png" y="884" horizontalCenter="0"/>
<e:Image x="233.31" y="893" anchorOffsetX="0" width="36" anchorOffsetY="0" height="36" source="coinIcon_png"/>
<e:Label id="userCreditsUnitName" text="总积分积分" x="276.8" y="898.34" anchorOffsetX="0" width="156.03" size="22" textColor="0xf7de4c" fontFamily="微软雅黑" height="25.33" anchorOffsetY="0"/>
<e:Label id="userCreditsNum" text="2000" x="384.33" y="895" anchorOffsetX="0" width="129.87" size="30" textAlign="center" textColor="0xf7de4c" height="24"/>
<e:Image id="circleLight1" source="circleLight1_png" y="265" height="630" width="630" horizontalCenter="0"/>
<e:Image id="circleLight2" source="circleLight2_png" width="630" height="630" horizontalCenter="0" verticalCenter="-23"/>
<e:Image id="sideLightD" source="sideLightD_png" x="46" y="396"/>
<e:Image id="sideLightL" source="sideLightL_png" x="-10" y="361.67"/>
<e:Image id="finger" source="finger_png" horizontalCenter="87.5" verticalCenter="44"/>
<e:Panel id="resulePanel" width="374" height="159" skinName="component.ResultPanel" anchorOffsetX="187" anchorOffsetY="79.5" scaleX="0" scaleY="0" horizontalCenter="-1" verticalCenter="-23.5"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PrizeSkin" width="750" height="1000" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="prizePanelbg_png" y="114.85" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="602" y="60">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="PrizePanelX_png" source.down="PrizePanelX_png" source.disabled="PrizePanelX_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="useBtn" label="" x="234.5" y="712">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="prizePanelUseBtn_png" source.down="prizePanelUseBtn_png" source.disabled="prizePanelUseBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Image id="img" y="403" horizontalCenter="0" touchEnabled="true" source="{data.img}"/>
<e:Label text="{data.name}" y="659" horizontalCenter="0" width="508" textAlign="center" size="28"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RuleSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect id="dark" width="750" height="1624" x="0" y="0" fillAlpha="0.5"/>
<e:Image id="ruleBg" source="ruleBg_png" horizontalCenter="0.5" verticalCenter="-231"/>
<e:Button id="closeBtn" label="" horizontalCenter="296.5" verticalCenter="-561">
<e:skinName>
......@@ -10,4 +9,9 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Scroller id="scroller" width="528" x="112" height="641" y="351">
<e:Group width="100%">
<e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0x333333"/>
</e:Group>
</e:Scroller>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="StartSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Button id="ruleBtn" label="" x="29.27" y="42">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="ruleBtn_png" source.down="ruleBtn_png" source.disabled="ruleBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="optionBtn" label="" x="632.57" y="42">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="optionBtn_png" source.down="optionBtn_png" source.disabled="optionBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.VScrollBarSkin" minWidth="8" minHeight="20" xmlns:e="http://ns.egret.com/eui">
<e:Image id="thumb" source="roundthumb_png" scale9Grid="3,3,2,2" height="30" width="8" horizontalCenter="0"/>
</e:Skin>
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="component.ResultPanel" width="378" height="164" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="bg" source="earnPanel_png" x="0" y="0"/>
<e:Label id="credits" text="0" x="41.5" y="65" size="64" anchorOffsetX="0" width="292" textAlign="center"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="WheelBg" width="603" height="603" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="wheelBg" source="wheelBg2_png" anchorOffsetX="301.5" anchorOffsetY="301.5" left="0" top="0"/>
<e:Image source="gift_png" x="176.5" y="76.5" rotation="-22.5"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="WheelGift" width="92" height="300" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="gift" source="gift_png" y="61" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ui.IconButtonSkin" xmlns:e="http://ns.egret.com/eui" xmlns:ns1="*" states="up,down,disabled" >
<e:Image id="iconDisplay" source="" horizontalCenter="0" verticalCenter="0" scaleX.down="0.95" scaleY.down="0.95"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ui.ProgressBarSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="thumb" source="loading_progress_thumb" x="3" y="3"/>
<e:Image id="track" source="loading_progress_track" scale9Grid="16,13,2,2" width="404"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ui.StartButtonSkin" xmlns:e="http://ns.egret.com/eui" xmlns:ns1="*" states="up,down,disabled,wating" >
<e:Image id="iconDisplay" source="" horizontalCenter="0" verticalCenter="0" scaleX.down="0.95" scaleY.down="0.95"/>
<e:Image source="startBtnBg_png" includeIn="wating" x="0" y="0"/>
<e:Image source="wating_png" includeIn="wating" horizontalCenter="0" verticalCenter="23.5"/>
<e:Image source="startBtnBg_png" includeIn="disabled" x="0" y="0"/>
<e:Image source="go_png" includeIn="disabled" x="62" y="143"/>
<e:Image source="startBtnBg_png" includeIn="down" x="0" y="0" scaleX="0.95" scaleY="0.95"/>
<e:Image source="go_png" includeIn="down" horizontalCenter="0.5" verticalCenter="25.5" scaleX="0.95" scaleY="0.95"/>
<e:Image source="startBtnBg_png" includeIn="up" horizontalCenter="0" verticalCenter="0"/>
<e:Image source="go_png" includeIn="up" horizontalCenter="0.5" verticalCenter="25.5"/>
</e:Skin>
\ No newline at end of file
......@@ -8,8 +8,18 @@ import { ExmlPlugin2 } from "./ExmlPlugin2";
export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
async onFile(file: plugins.File) {
const excludes = [
'openstate.png',
'coin.png',
'goBtn.png',
'gift.png',
'gift2.png',
'goldenbox.png',
'silverbox.png',
'woodbox.png',
'monkey.png',
'net.png',
'option.png',
'river.png',
'kids.png',
];
if (excludes.indexOf(file.basename) != -1) {
return file;
......
/**
* 示例自定义插件,您可以查阅 http://developer.egret.com/cn/github/egret-docs/Engine2D/projectConfig/cmdExtensionPlugin/index.html
* 了解如何开发一个自定义插件
*/
export class CustomPlugin implements plugins.Command {
constructor() {
}
async onFile(file: plugins.File) {
// console.log(file.relative)
return file;
}
async onFinish(commandContext: plugins.CommandContext) {
// console.log(commandContext.projectRoot)
// const path = require('path');
// commandContext.createFile('test.txt', new Buffer('123'));
}
}
\ No newline at end of file
export default class LoadingUI extends egret.Sprite implements RES.PromiseTaskReporter {
public constructor() {
super();
this.createView();
}
private textField: egret.TextField;
private createView(): void {
this.textField = new egret.TextField();
this.addChild(this.textField);
this.textField.y = 300;
this.textField.width = 480;
this.textField.height = 100;
this.textField.textAlign = "center";
}
public onProgress(current: number, total: number): void {
this.textField.text = `Loading...${current}/${total}`;
}
}
import { DataManager } from "../libs/tw/manager/DataManager";
import MainBase from "../libs/tl/MainBase";
import { NetManager } from "../libs/tw/manager/NetManager";
import Msg from "./alert/Msg";
import AssetAdapter from "./AssetAdapter";
import Alert from "./alert/Alert";
import PanelCtrl from "./ctrls/panelCtrl";
import SceneCtrl from "./ctrls/sceneCtrl";
import Loading from "./loading/Loading";
import PlayScene from "./playScene/PlayScene";
import OptionsPanel from "./optionsPanel/OptionsPanel";
import RulePanel from "./rulePanel/RulePanel";
import ThemeAdapter from "./ThemeAdapter";
import StartScene from "./startScene/StartScene";
import { ModuleTypes } from "./types/sceneTypes";
import { getResPath } from "./utils";
import layers from "./views/layers";
import PrizePanel from "./prizePanel/PrizePanel";
class Main extends eui.UILayer {
protected createChildren(): void {
super.createChildren();
// alert(1)
egret.lifecycle.addLifecycleListener((context) => {
// custom lifecycle plugin
})
egret.lifecycle.onPause = () => {
egret.ticker.pause();
}
egret.lifecycle.onResume = () => {
egret.ticker.resume();
}
//inject the custom material parser
//注入自定义的素材解析器
let assetAdapter = new AssetAdapter();
egret.registerImplementation("eui.IAssetAdapter", assetAdapter);
egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
egret.ImageLoader.crossOrigin = "anonymous";
DataManager.ins.gameCfgData = window['CFG'];
DataManager.ins.gameCfgData.gameInfo.gameId = window["gameId"];
NetManager.ins.getCredits(()=>{});
layers.init(this);
Loading.init(layers.topLayer);
PanelCtrl.instance.init(layers.popupLayer);
SceneCtrl.instance.init(layers.sceneLayer);
this.stage.scaleMode = egret.StageScaleMode.FIXED_WIDTH;
PanelCtrl.instance.registerPanelClass(ModuleTypes.MSG_PANEL, Msg);
class Main extends MainBase {
protected registerModules() {
PanelCtrl.instance.registerPanelClass(ModuleTypes.ALERT_PANEL, Alert);
PanelCtrl.instance.registerPanelClass(ModuleTypes.RULE_PANEL, RulePanel);
SceneCtrl.instance.registerSceneClass(ModuleTypes.PALY_SCENE, PlayScene);
PanelCtrl.instance.registerPanelClass(ModuleTypes.OPTIONS_PANEL, OptionsPanel);
PanelCtrl.instance.registerPanelClass(ModuleTypes.PRIZE_PANEL, PrizePanel);
this.runGame().catch(e => {
console.log(e);
})
SceneCtrl.instance.registerSceneClass(ModuleTypes.START_SCENE, StartScene);
}
private async runGame() {
await this.loadResource()
this.createGameScene();
RES.loadGroup("msg", 10);
protected getData() {
super.getData();
NetManager.ins.getInfo();
}
private async loadResource() {
try {
// const loadingView = new LoadingUI();
// this.stage.addChild(loadingView);
await RES.loadConfig("default.res.json", getResPath() + "resource/");
await this.loadTheme();
// await RES.loadGroup("msg", 10);
// this.stage.removeChild(loadingView);
}
catch (e) {
console.error(e);
}
}
private loadTheme() {
return new Promise((resolve, reject) => {
// load skin theme configuration file, you can manually modify the file. And replace the default skin.
//加载皮肤主题配置文件,可以手动修改这个文件。替换默认皮肤。
let theme = new eui.Theme("resource/default.thm.json", this.stage);
theme.addEventListener(eui.UIEvent.COMPLETE, () => {
resolve();
}, this);
})
}
private textfield: egret.TextField;
/**
* 创建场景界面
* Create scene interface
*/
protected createGameScene(): void {
NetManager.ins.getInfo(() => {
// 等待开奖 ↓
if (DataManager.ins.getInfoData.status.code == 4) {
// 已开奖 ↓
} else if (DataManager.ins.getInfoData.status.code == 5) {
// 正常游戏 ↓
} else {
SceneCtrl.instance.change(ModuleTypes.PALY_SCENE)
}
});
// setTimeout(() => {
// // panelCtrl.showAlertPanel('te111st');
// // Loading.instace.show()
// }, 3000);
protected async createGameScene() {
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
}
......
/**
* 平台数据接口。
* 由于每款游戏通常需要发布到多个平台上,所以提取出一个统一的接口用于开发者获取平台数据信息
* 推荐开发者通过这种方式封装平台逻辑,以保证整体结构的稳定
* 由于不同平台的接口形式各有不同,白鹭推荐开发者将所有接口封装为基于 Promise 的异步形式
*/
declare interface Platform {
getUserInfo(): Promise<any>;
login(): Promise<any>
}
export class DebugPlatform implements Platform {
async getUserInfo() {
return { nickName: "username" }
}
async login() {
}
}
export declare let platform: Platform;
export declare interface Window {
platform: Platform
}
import Panel from "../views/Panel";
export default class Alert extends Panel {
set message(val) {
}
set btnTxt(val) {
}
start(data) {
const { message, btnTxt } = data;
this.data.message = message;
......@@ -17,6 +9,6 @@ export default class Alert extends Panel {
protected get skinKey() { return 'Alert' }
protected get closeBtns(): eui.Button[] {
return [this['closeBtn'], this['confirmBtn']]
return [this['closeBtn']]
}
}
\ No newline at end of file
import Panel from "../views/Panel";
export default class Msg extends Panel {
constructor(){
super()
}
set message(val) {
}
set btnTxt(val) {
}
start(data) {
const { msg } = data;
this.data.message = msg;
this['msgTxt'].text = `${this.data.message }`
switch(data.type){
case 'creditsOut':
if(this['creditsOutBtn']){
this['creditsOutBtn'].visible = true;
this['creditsOutBtn'].enabled = true;
}
if(this['confirmBtn']){
this['confirmBtn'].visible = false;
this['confirmBtn'].enabled = false;
}
break;
case 'err':
if(this['creditsOutBtn']){
this['creditsOutBtn'].visible = false;
this['creditsOutBtn'].enabled = false;
}
if(this['confirmBtn']){
this['confirmBtn'].visible = true;
this['confirmBtn'].enabled = true;
}
break;
default:
if(this['creditsOutBtn']){
this['creditsOutBtn'].visible = false;
this['creditsOutBtn'].enabled = false;
}
if(this['confirmBtn']){
this['confirmBtn'].visible = true;
this['confirmBtn'].enabled = true;
}
break;
}
}
protected get creditsOutBtns(): eui.Button[] {
return [this['creditsOutBtn']]
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
protected get skinKey() { return 'Msg' }
}
\ No newline at end of file
......@@ -6,9 +6,10 @@ export default class ComponentBase extends eui.Component {
super();
this.data = {};
this.skinName = getSkinPath(this.skinKey);
this.addEventListener(egret.Event.COMPLETE, this.onSkinComplete, this);
if (this.skin) {
this.onSkinComplete();
} else {
this.addEventListener(egret.Event.COMPLETE, this.onSkinComplete, this);
}
}
......
export default class SheetAnimation extends egret.Bitmap {
private _counter: number;
private _sheet: egret.SpriteSheet;
private _fps = 24;
private _fpscounter = 1;
totalFrames: number;
onEnterFrame() {
if (this._fpscounter == 1) {
let key = '0' + this._counter;
if (this._counter >= 10)
key = this._counter + '';
const picData = this._sheet.getTexture(key);
this.$setBitmapData(picData);
this.dispatchEvent(new egret.Event('frameUpdate', false, false, this._counter));
this._counter++;
if (this._counter > this.totalFrames)
this._counter = 1;
}
this._fpscounter++;
if (this._fpscounter > Math.ceil(60 / this._fps))
this._fpscounter = 1;
}
set sheet(val: egret.SpriteSheet) {
this._sheet = val;
this.stopAtFirstFrame();
this.totalFrames = this.getTotalFrames() - 1;
}
get sheet(){return this._sheet}
private getTotalFrames() {
let counter = 0;
for (const key in this._sheet._textureMap) {
counter++;
}
return counter;
}
stopAtFirstFrame() {
const picData = this._sheet.getTexture('01');
this.$setBitmapData(picData);
this.stop();
}
stopAtIdleFrame() {
const picData = this._sheet.getTexture('00');
this.$setBitmapData(picData);
this.stop();
}
set fps(val: number) {
this._fps = val;
}
play() {
this._fpscounter = 1;
this._counter = 1;
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
private stop() {
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
destroy() {
this.stop();
this._sheet = null;
}
}
\ No newline at end of file
......@@ -2,8 +2,7 @@ import { ModuleTypes } from "../types/sceneTypes";
import Panel from "../views/Panel";
export default class PanelCtrl {
private _parent: egret.Sprite;
private _mask: egret.Shape;
private _mask: egret.Sprite;
static _instance: PanelCtrl;
static get instance() {
return PanelCtrl._instance || (PanelCtrl._instance = new PanelCtrl())
......@@ -14,35 +13,54 @@ export default class PanelCtrl {
}
show(type: ModuleTypes, data?) {
this.addMask();
const cls = this._panelClassMap[type];
const panel: Panel = new cls(data);
this._current = panel;
panel.start(data);
this.add(panel);
egret.Tween.get(panel).set({ y: -200 }).to({ y: 0 }, 500, egret.Ease.getBackOut(2));
return panel;
}
addMask() {
if (!this._mask) {
this._mask = new egret.Sprite();
this._mask.touchEnabled = true;
this._mask.graphics.beginFill(0, .7);
this._mask.graphics.drawRect(0, 0, 750, 1624);
this._mask.graphics.endFill();
}
this._mask.alpha=1;
this._parent.addChild(this._mask);
}
removeMask() {
if (this._mask) {
egret.Tween.get(this._mask).to({ alpha: 0 }, 200).call(
() => this._parent.removeChild(this._mask), this);
}
}
private add(panel: Panel) {
this._parent.addChild(panel);
panel.addEventListener('onDestroy', this.onPanelHide, this);
panel.addEventListener('onCreditsOut', this.onCreditsOut, this);
}
private remove(panel: Panel) {
const tw = egret.Tween.get(panel);
tw.to({ y: 1624 }, 400, egret.Ease.getBackIn(2))
.call(() => {
this._parent.removeChild(panel);
this.removeMask();
}, this);
}
private onPanelHide(e: egret.Event) {
const panel = e.target as Panel;
panel.removeEventListener('onDestroy', this.onPanelHide, this);
panel.removeEventListener('onCreditsOut', this.onCreditsOut, this);
this.remove(panel);
}
private onCreditsOut(e: egret.Event){
if(!window['CFG'] || !window['CFG'].appInfo) return;
window.location.href = window['CFG'].appInfo.earnCreditsUrl;
}
private _panelClassMap: any;
registerPanelClass(name, definition) {
this._panelClassMap = this._panelClassMap || {};
......
import { ModuleTypes } from "../types/sceneTypes";
import PanelCtrl from "./panelCtrl";
export default (message: string, btnTxt?: string) => {
PanelCtrl.instance.show(ModuleTypes.ALERT_PANEL, { message: message, btnTxt: btnTxt })
}
\ No newline at end of file
export default (message: string, btnTxt?: string) =>
PanelCtrl.instance.show(ModuleTypes.ALERT_PANEL, { message: message, btnTxt: btnTxt });
\ No newline at end of file
import { IGameOptionData } from "../../libs/tw/data/game/getOptions/IGameOptionData";
import { getSkinPath } from "../utils";
export default class ItemRenderder extends eui.ItemRenderer {
constructor() {
super();
this.skinName = getSkinPath('OptionItem');
}
}
\ No newline at end of file
import { DataManager } from '../../libs/tw/manager/DataManager';
import { NetManager } from '../../libs/tw/manager/NetManager';
import Panel from "../views/Panel";
import ItemRenderder from './ItemRenderder';
import { IGameOptionData } from '../../libs/tw/data/game/getOptions/IGameOptionData';
export default class OptionsPanel extends Panel {
start() {
if (!DataManager.ins.getOptionsData)
NetManager.ins.getOptions(() => {
this.updatePanel();
});
else
this.updatePanel();
}
group: eui.Group;
list: eui.List;
updatePanel() {
DataManager.ins.getOptionsData.optionList.forEach(item => {
item['scopeOrigin'] = item['scopeOrigin'] || item.scope;
item.scope = this.getScope(item);
});
this.list.useVirtualLayout = false;
this.list.itemRenderer = ItemRenderder;
const ac = new eui.ArrayCollection(DataManager.ins.getOptionsData.optionList);
this.list.dataProvider = ac;
}
getScope(data: IGameOptionData) {
if (data.autoOpen) {
return '阳光普照';
}
return `第${data['scopeOrigin']}名`;
}
protected get skinKey() { return 'Options' }
}
\ No newline at end of file
// import { INetData } from '../../libs/tc/interface/INetData';
// import { DataManager } from '../../libs/tw/manager/DataManager'; import { NetManager } from '../../libs/tw/manager/NetManager';
import { INetData } from '../../libs/tc/interface/INetData';
import PanelCtrl from '../ctrls/panelCtrl';
import { ModuleTypes } from '../types/sceneTypes';
import Scene from "../views/Scene";
import { DataManager } from '../../libs/tw/manager/DataManager';
import { NetManager } from '../../libs/tw/manager/NetManager';
const { TouchEvent } = egret;
export default class PlayScene extends Scene {
// 游戏参数
private userCredits:number = 0;
private unitNum:number = 10;
private unitName:string;
private currCostCredits:number = 0;
private lightCount:number = 0;
private lightRate = 30;
private isLight:boolean = false;
private wbgloop:any;
private multiplesArr:any[] = [];
private angleArr:any[] = [];
private ranArr:any[] = [];
private coinsArr:any[] = [];
private gravity:number = 4.5;
private multiple:number;
// 导出的元件
public bg:eui.Image;
public ruleBtn:eui.Button;
public addBtn:eui.Button;
public reduceBtn:eui.Button;
public WheelBg:eui.Component;
public outShell:eui.Image;
public startBtn:eui.Button;
public unitTxt:eui.Label;
public costTxt:eui.Label;
public myCreditsBg:eui.Image;
public userCreditsUnitName:eui.Label;
public userCreditsNum:eui.Label;
public circleLight1:eui.Image;
public circleLight2:eui.Image;
public sideLightD:eui.Image;
public sideLightL:eui.Image;
public finger:eui.Image;
public resulePanel:eui.Panel;
public rulePanel:eui.Panel;
initEvents() {
this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_startBtn,this);
this.reduceBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_reduceBtn,this);
this.addBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_addBtn,this);
this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_ruleBtn,this);
}
removeEvents() {
this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_startBtn,this);
this.reduceBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_reduceBtn,this);
this.addBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_addBtn,this);
this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onClick_ruleBtn,this);
}
start() {
this.once(egret.Event.ADDED_TO_STAGE,this.onLoad,this);
this.circleLight1.$touchEnabled = false;
this.circleLight2.$touchEnabled = false;
this.finger.$touchEnabled = false;
this.sideLightL.visible = false;
this.userCredits = DataManager.ins.getInfoData ? DataManager.ins.getInfoData.credits : 0;
this.unitName = DataManager.ins.getCreditsData ? `${DataManager.ins.getCreditsData.unitName}` : `积分`;
if(this.userCredits<10){
this.currCostCredits = 0;
}else if(this.userCredits <= 200){
this.currCostCredits = 10;
}else if(this.userCredits <= 500){
this.currCostCredits = 20;
}else if(this.userCredits <= 1000){
this.currCostCredits = 30;
}else if(this.userCredits <= 5000){
this.currCostCredits = 50;
}else if(this.userCredits <= 10000){
this.currCostCredits = 100;
}else if(this.userCredits > 10000){
this.currCostCredits = 200;
}
this.costTxt.text = `${this.currCostCredits}`;
this.unitTxt.text = `投入${this.unitName}`;
this.userCreditsUnitName.text = `总${this.unitName}`;
this.userCreditsNum.text = `${this.userCredits}`;
let fingerTw = egret.Tween.get( this.finger, {loop: true} );
fingerTw.to({scaleX:0.9, scaleY:0.9}, 500).to({scaleX:1, scaleY:1}, 500)
this.WheelBg['realRotation'] = 0;
console.log(this.WheelBg)
// 按从小到大排序
this.multiplesArr = [0, 0.2, 0.4, 0.5, 0.8, 1.0, 1.1, 1.2, 1.4, 1.5, 2];
let unitAngle = 360/16;
this.angleArr = [13*unitAngle, 11*unitAngle, 0, 5*unitAngle, 8*unitAngle, 14*unitAngle, 12*unitAngle, 6*unitAngle, 10*unitAngle, 3*unitAngle, 2*unitAngle];
this.ranArr = [1/11,1/11,1/11,1/11,1/11,1/11,1/11,1/11,1/11,1/11,1/11];
}
private timeOnEnterFrame:number = 0;
private onLoad(event:egret.Event) {
this.addEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this);
}
private onEnterFrame(e:egret.Event){
let scope = this;
scope.lightCount ++;
if(scope.lightCount%scope.lightRate == 0){
scope.isLight = !scope.isLight;
}
scope.circleLight2.visible = scope.isLight;
if(scope.coinsArr.length > 0){
for(let c = scope.coinsArr.length-1; c>=0;c--){
scope.coinsArr[c].x += scope.coinsArr[c].dirX * scope.coinsArr[c].vx;
scope.coinsArr[c].y -= scope.coinsArr[c].vy;
scope.coinsArr[c].vy -= scope.gravity;
}
}
}
// 开始游戏
private onClick_startBtn(e:egret.TouchEvent){
if(window['requirelogin']) {
window['requirelogin']();
return;
}
if(this.userCredits < 10){
let data = {msg:`${this.unitName}不足最小投值10${this.unitName}快去赚取${this.unitName}吧`, type:'creditsOut'}
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, data)
return;
}
let scope = this;
let wbg = egret.Tween.get( this.WheelBg, {onChange: scope.onWbgRotationChange.bind(scope)});
scope.removeChild(scope.goAni)
let func:Function;
wbg.to({realRotation:(scope.WheelBg['realRotation'] + 3600)}, 2000, egret.Ease.quartIn).call( func = function(){
let _rotation = scope.WheelBg['realRotation'] + 360;
scope.wbgloop = egret.Tween.get( scope.WheelBg, {onChange: scope.onWbgRotationChange.bind(scope), loop: true});
scope.wbgloop.to({realRotation: _rotation}, 300).call(()=>{
_rotation = scope.WheelBg['realRotation'] + 360;
});
});
this.finger.visible = false;
this.lightRate = 5;
this.sideLightL.visible = true;
this.buttonEnable(false);
this.startBtn.currentState = 'wating';
this.doStart(this.doStartResult.bind(this), false, this.currCostCredits, 1);
}
// 开始游戏接口
public doStart(callback: Function, isAgain = false, credits?: number, customizedType?: number): void {
if(window['requirelogin']) {
window['requirelogin']();
return;
}
NetManager.ins.doStart((success: boolean) => {
if(success) {
this.getStartStatus(callback, customizedType);
} else {
callback(success);
}
},
isAgain,
credits,
customizedType);
}
// 查询开始状态
private getStartStatus(callback: Function, customizedType?: number): void {
const param: any = {
ticketId: DataManager.ins.doStartData.ticketId
};
if (customizedType) {
param.customizedType = customizedType
}
const net: INetData = {
name: 'getStartStatus',
uri: '/ngapi/getStartStatus',
type: 'post',
dataType: 'json',
param: param,
callback: callback,
pollingCount: 5,
pollingCheck: () => { return DataManager.ins.getData('getStartStatus').code != 1; }
};
NetManager.ins.send(net)
}
// 开始的回调
private doStartResult(success:boolean){
let scope = this;
if(!success) {
this.defaultErr()
return;
}
let upperCreditsLimit = DataManager.ins.getData('getStartStatus').upperCreditsLimit ? DataManager.ins.getData('getStartStatus').upperCreditsLimit : scope.currCostCredits;
// 取得的返回最大倍数
let maxMultiple = upperCreditsLimit/scope.currCostCredits;
console.log(`最大倍数:${maxMultiple}`)
// 改变数组
let newMultiplesArr:any[] = [];
for(let m = 0; m<scope.multiplesArr.length; m++){
if(scope.multiplesArr[m] < maxMultiple){
newMultiplesArr.push(scope.multiplesArr[m]);
}
}
// 更新用户积分文案
scope.userCreditsNum.text = `${DataManager.ins.getInfoData ? DataManager.ins.getInfoData.credits : scope.userCredits}`
// 拿到倍数
let newAngleArr:any[] = [];
let newRanArr:any[] = [];
let arr:any[] = [];
for(let i = 0; i < newMultiplesArr.length; i++){
newAngleArr.push(scope.angleArr[i]);
newRanArr.push(scope.ranArr[i]);
let num = Math.round(120 * newRanArr[i]);
let a = (new Array(num))["fill"](newAngleArr[i]);
arr = arr.concat(a);
}
let randomT = (e, n?) => {
return e && "number" == typeof e.length && e.length ? e[Math.floor(Math.random() * e.length)] : ("number" != typeof n && (n = e || 1, e = 0), e + Math.random() * (n - e))
}
let targetAngle = randomT(arr);
let i = scope.angleArr.indexOf(targetAngle);
let multiple = scope.multiplesArr[i];
this.multiple = multiple;
console.log(`随机倍数:${multiple}`)
let timeout = setTimeout(() => {
clearTimeout(timeout)
egret.Tween.removeTweens( scope.WheelBg );
let tw = egret.Tween.get( scope.WheelBg, {onChange:scope.onWbgRotationChange.bind(scope)} );
let _rotation = Math.random() > 0.5 ? scope.WheelBg['realRotation'] + ( 360 - scope.WheelBg['realRotation'] % 360 ) + targetAngle + 1440 + Math.random() * 8 : scope.WheelBg['realRotation'] + ( 360 - scope.WheelBg['realRotation'] % 360 ) + targetAngle + 1440 - Math.random() * 8;
tw.to({realRotation:_rotation}, 8000 ,egret.Ease.quartOut).call(()=>{
scope.startBtn.currentState = 'up';
scope.buttonEnable(false)
scope.sideLightL.visible = false;
scope.lightRate = 30;
scope.coinsFall(true)
});
}, 1000);
// 延时提交分数
let timeout2 = setTimeout(()=>{
this.gameSubmitData(this.gameSubmitResult.bind(this), this.currCostCredits * multiple, false, 1);
},500)
}
private gameSubmitResult(){
NetManager.ins.getInfo(()=>{})
console.log('提交成功')
}
/**
* 提交游戏成绩
* @param callback
* @param score 得分
* @param allDynamics 防作弊数据
* @param checkScore 是否校验得分
* @param customizedType 定制类型 1推币机
*/
protected gameSubmitData(callback: Function, score: number, checkScore?: boolean, customizedType?: number): void {
NetManager.ins.gameSubmit(
(success: boolean) => {
if(success) {
this.getSubmitResult(callback, DataManager.ins.gameSubmitData.orderId);
} else {
callback(success);
}
},
DataManager.ins.doStartData.ticketId,
score,
'[]',
DataManager.ins.doStartData.submitToken,
'',
checkScore,
customizedType);
}
/**
* 查询提交结果
* @param callback
* @param orderId
*/
private getSubmitResult(callback: Function, orderId: number): void {
NetManager.ins.getSubmitResult(callback, orderId, () => {
return DataManager.ins.gameGetSubmitResultData.flag;
});
}
// 默认出错——转到0后弹错误窗
private defaultErr(){
let timeout = setTimeout(() => {
clearTimeout(timeout)
egret.Tween.removeTweens( this.WheelBg );
let tw = egret.Tween.get( this.WheelBg, {onChange:this.onWbgRotationChange.bind(this)} );
this.multiple = 0;
let _rotation = this.WheelBg['realRotation'] + ( 360 - this.WheelBg['realRotation'] % 360 ) + 360*13/16 + 1440;
tw.to({realRotation:_rotation}, 8000 ,egret.Ease.quartOut).call(()=>{
this.startBtn.currentState = 'up';
this.buttonEnable(true);
this.sideLightL.visible = false;
this.lightRate = 30;
this.coinsFall(false)
});
}, 2000);
}
private onWbgRotationChange(){
this.WheelBg.rotation = this.WheelBg['realRotation'];
}
// 减号
private onClick_reduceBtn(e:egret.TouchEvent){
if(window['requirelogin']) {
window['requirelogin']();
return;
}
if((this.currCostCredits - this.unitNum) > 0 && (this.userCredits - this.unitNum) > 0 ){
this.currCostCredits -= this.unitNum;
}
this.costTxt.text = `${this.currCostCredits}`;
}
// 加号
private onClick_addBtn(e:egret.TouchEvent){
if(window['requirelogin']) {
window['requirelogin']();
return;
}
if((this.currCostCredits + this.unitNum) <= this.userCredits && this.currCostCredits < 500){
this.currCostCredits += this.unitNum;
}
this.costTxt.text = `${this.currCostCredits}`;
}
// 规则按钮
private onClick_ruleBtn(e:egret.TouchEvent){
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
}
// 加载动画资源
private goAni:any;
protected childrenCreated():void{
super.childrenCreated();
this.ayncLoad2Mc("goBtn_json");
this.ayncLoad2Mc("coin_json");
}
private ayncLoad2Mc( resname : string) : void{
let scope = this;
RES.getResAsync(resname,
(data: any,key: string): void => {
if(key == "coin_json") {
scope.ayncLoad2Mc("coin_png");
}else if(key == "coin_png") {
for(let i=0;i<100;i++){
let data2mc = RES.getRes("coin_json");
let texture2mc = RES.getRes("coin_png");
let mcFactory : egret.MovieClipDataFactory = new egret.MovieClipDataFactory(data2mc,texture2mc);
let mc:egret.MovieClip = new egret.MovieClip(mcFactory.generateMovieClipData("coin"));
scope.coinsArr.push(mc);
}
}else if(key == "goBtn_json") {
scope.ayncLoad2Mc("goBtn_png");
}else if(key == "goBtn_png") {
let data2mc = RES.getRes("goBtn_json");
let texture2mc = RES.getRes("goBtn_png");
let mcFactory : egret.MovieClipDataFactory = new egret.MovieClipDataFactory(data2mc,texture2mc);
let mc:egret.MovieClip = new egret.MovieClip(mcFactory.generateMovieClipData("go"));
mc.gotoAndPlay('light', -1);
scope.goAni = mc;
scope.addChild(scope.goAni)
scope.addChild(scope.finger)
mc.x = 279;
mc.y = 494;
}
},
this);
}
// 金币掉落效果
private coinsFall(isSuccess:boolean):void{
let scope = this;
let count = 0;
let coinsFall = setInterval(()=>{
if(count<100){
scope.addChild(scope.coinsArr[count]);
scope.coinsArr[count].gotoAndPlay('rotate', -1);
if(Math.random()>0.5){
scope.coinsArr[count].dirX = 1;
}else{
scope.coinsArr[count].dirX = -1;
}
scope.coinsArr[count].vy = Math.random() * 60;
scope.coinsArr[count].vx = Math.random() * 30;
scope.coinsArr[count].x = this.stage.stageWidth/2 - scope.coinsArr[count].width/2;
scope.coinsArr[count].y = 500;
count++;
this.addChild(this.resulePanel)
}else{
if(!isSuccess){
// 失败
let msg = DataManager.ins.doStartData ? DataManager.ins.doStartData.message : `网络出了点小问题请退出后重试`;
let data = {msg:msg, type:'err'}
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, data)
}
clearInterval(coinsFall)
}
},10)
scope.showResultPanel()
}
private currEarnCredits:number = 0;
private showResultPanel(){
let scope = this;
scope.currEarnCredits = scope.currCostCredits * scope.multiple;
let resultPanelTw = egret.Tween.get( scope.resulePanel );
resultPanelTw.to({scaleX:1, scaleY:1}, 300).wait(2000).call(()=>{
scope.resulePanel.scaleX = 0;
scope.resulePanel.scaleY = 0;
scope.buttonEnable(true);
scope.addChild(scope.goAni);
})
this.resulePanel['credits'].text = `0`;
let credits:any = {num:0};
credits.num = Number(this.resulePanel['credits'].text);
let creditTw = egret.Tween.get( credits , { onChange:onCreditsChange});
creditTw.to({num: this.currEarnCredits},1000)
function onCreditsChange(){
let c = Math.floor(credits.num);
scope.resulePanel['credits'].text = `${c}`
}
}
// 按钮状态
private buttonEnable(enabled:boolean){
this.startBtn.enabled = enabled;
this.addBtn.enabled = enabled;
this.reduceBtn.enabled = enabled;
this.ruleBtn.enabled = enabled;
}
protected get skinKey() { return 'Play' }
}
\ No newline at end of file
import Panel from "../views/Panel";
import { DataManager } from "../../libs/tw/manager/DataManager";
import getOptionImgSize from "./data/getOptionImgSize";
import ImgSizeType from "./data/ImgSizeType";
import { LotteryType } from "../../libs/tw/enum/LotteryType";
import { NetManager } from "../../libs/tw/manager/NetManager";
import showLog from "./ctrl/showLog";
export default class PrizePanel extends Panel {
start(data) {
const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
this.data = lottery;
const sizeType = getOptionImgSize(lottery);
if (ImgSizeType.BIG === sizeType) {
this.img.width = this.picBigWidth;
this.img.height = this.picBigWidth / this.bigPicRatio;
} else {
this.img.width = this.img.height = this.picWidth;
}
showLog(lottery);
}
get picWidth() { return 240 };
get picBigWidth() { return 510 };
get bigPicRatio() { return 640 / 300 }
initEvents() {
super.initEvents();
this.useBtn.once(egret.TouchEvent.TOUCH_TAP, this.onUse, this);
this.img.once(egret.TouchEvent.TOUCH_TAP, this.onUse, this);
}
onUse() {
const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
window["downloadAppConfig"] =
{
openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false
};
window["downloadApp"]();
if (lottery.type == "lucky") {
NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure);
}
}
else {
window.location.href = lottery.link;
}
}
img: eui.Image;
useBtn: eui.Button;
protected get skinKey() { return 'Prize' }
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
}
\ No newline at end of file
import { LotteryData } from "../../../libs/tw/data/common/lottery/LotteryData";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { DataManager } from "../../../libs/tw/manager/DataManager";
const showLog = (lottery: LotteryData) => {
//曝光埋点
if (lottery.imgExposure) {
NetManager.ins.showLog(lottery.imgExposure);
}
//如果是福袋还需要推啊曝光
if (lottery.type == "lucky") {
NetManager.ins.spmshow(DataManager.ins.gameGetSubmitResultData.exposure);
}
}
export default showLog;
\ No newline at end of file
class ImgSizeType {
static BIG = 'big';
static SMALL = 'small';
}
export default ImgSizeType
\ No newline at end of file
import { LotteryData } from "../../../libs/tw/data/common/lottery/LotteryData";
import ImgSizeType from "./ImgSizeType";
const getOptionImgSize = (lottery: LotteryData) => {
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
import Panel from "../views/Panel";
import { NetManager } from '../../libs/tw/manager/NetManager';
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class RulePanel extends Panel {
constructor(){
super()
NetManager.ins.getRule(()=>{
var tx:egret.TextField = new egret.TextField;
tx.width = this.stage.stageWidth - 220;
tx.textFlow = (new egret.HtmlTextParser).parser(
DataManager.ins.getRuleData ? DataManager.ins.getRuleData.ruleText :
(DataManager.ins.ajaxElementData ? DataManager.ins.ajaxElementData.rule :
(window['ruleCFG'] ? window['ruleCFG'] : "规则")
)
);
tx.x = 110;
tx.y = 330;
tx.textColor = 0x333333;
this.addChild( tx );
})
public labContent: eui.Label;
public scroller: eui.Scroller;
start() {
if (!DataManager.ins.getRuleData)
NetManager.ins.getRule(() => {
this.addRule();
});
else
this.addRule();
}
private addRule() {
// this.labContent.textFlow = alien.Utils.parseHtmlText(content);
this.labContent.textFlow = (new egret.HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
}
protected get skinKey() { return 'Rule' }
......
import SheetAnimation from "../components/SheetAnimation";
export default class Box extends egret.Sprite {
private _pic: SheetAnimation;
private _type: string;
private START_SCALE = 0.5;
private START_X = 375;
private START_Y = 350;
private END_Y = 1100;
static MIDDLE_Y = 800+100+30;
speed = 0;
static hashCounter = 0
hash;
constructor(type) {
super();
this.hash = Box.hashCounter++;
this._type = type;
this._pic = new SheetAnimation();
this.addChild(this._pic);
}
private _passMiddleTag: boolean;
onEnterFrame() {
this.y += this.speed;
let distance = this.y - this.START_Y;
const totalDistance = (Box.MIDDLE_Y - this.START_Y);
if (distance > totalDistance) {
distance = totalDistance;
}
if (this.y > Box.MIDDLE_Y && !this._passMiddleTag) {
this._passMiddleTag = true;
this.dispatchEvent(new egret.Event('onPassMiddle'));
}
const scale = this.START_SCALE + (1 - this.START_SCALE) * (distance / totalDistance);
this.scaleX = this.scaleY = scale;
if (this.y > this.END_Y && !this._onDisappear) {
this.disappear();
}
}
move() {
this._pic.play();
if (!this._isPausing)
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
private _onDisappear: boolean;
disappear() {
if (!this._onDisappear)
this.dispatchEvent(new egret.Event('onDisappear'));
this._onDisappear = true;
this._pic.destroy();
egret.Tween.get(this).to({ alpha: 0 }, 500).call(this.destroy, this);
}
destroy() {
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.parent.removeChild(this);
}
private _isPausing: boolean;
pause() {
this._isPausing = true;
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
resume() {
this._isPausing = false;
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
async createBg() {
let url = this.boxData.skin;
return new Promise((resolve) => {
RES.getResByUrl(url, (sheet: egret.SpriteSheet) => {
this._pic.sheet = sheet;
this._pic.fps = 10;
egret.Tween.get(this)
.set({ alpha: 0, scaleX: 0, scaleY: 0, x: this.START_X, y: this.START_Y })
.to({ alpha: 1, scaleX: this.START_SCALE, scaleY: this.START_SCALE }, 500, egret.Ease.getBackInOut(2))
.call(this.move, this);
this.anchorOffsetX = this.boxData.offset[0];
this.anchorOffsetY = this.boxData.offset[1];
resolve(this);
}, this, RES.ResourceItem.TYPE_SHEET);
});
}
async createFirstBg() {
let url = this.boxData.skin;
return new Promise((resolve) => {
RES.getResByUrl(url, (sheet: egret.SpriteSheet) => {
this._pic.sheet = sheet;
this._pic.fps = 10;
this.x = this.START_X;
this.y = this.START_Y
this.scaleX = this.scaleY = this.START_SCALE;
this.move();
this.anchorOffsetX = this.boxData.offset[0];
this.anchorOffsetY = this.boxData.offset[1];
resolve(this);
}, this, RES.ResourceItem.TYPE_SHEET);
});
}
private _vyStart = 25;
private _vy: number;
private _gy: number;
private _throwStartVY: number;
private _scaleMax = 2;
onThrowTick() {
this._vy += this._gy;
this.y += this._vy;
const scale = (this._vyStart * this._scaleMax - Math.abs(this._vy)) / this._vyStart;
this.scaleX = this.scaleY = scale;
}
doThrow() {
this._pic.stopAtIdleFrame();
this._throwStartVY = this._vy;
this._vy = -this._vyStart;
this._gy = .55;
this.y = Box.MIDDLE_Y;
}
get vy() { return this._vy }
get type() { return this._type }
get boxData() { return __boxmap__[this._type] }
}
\ No newline at end of file
import Box from "./Box";
import { getBoxKeyList } from "./data/getBoxKeyList";
export default class BoxListCtrl extends egret.EventDispatcher {
private _parent: egret.Sprite;
private _boxKeys: string[];
private _boxs: Box[];
private _boxSpeed: number;
constructor(parent: egret.Sprite) {
super();
this._parent = parent;
this._boxs = [];
this.init();
this._boxSpeed = __boxMoveSpeed__;
}
init() {
this._boxKeys = getBoxKeyList();
}
private _timer: number;
private _currentBoxIndex = 0;
private _frameCounter = 0;
/** 创建其他的boxs */
resume() {
this._parent.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this._boxs.forEach(box => box.resume());
}
pause() {
this._parent.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this._boxs.forEach(box => box.pause());
}
onEnterFrame() {
this._frameCounter++;
if (this._frameCounter > __BOX_CREATE_INTERVAL__) {
this._frameCounter = 0;
this.createBox();
this._currentBoxIndex++;
if (this._currentBoxIndex >= this._boxKeys.length)
this._currentBoxIndex = 0;
}
}
createBox() {
const box = new Box(this._boxKeys[this._currentBoxIndex]);
box.speed = this._boxSpeed;
box.addEventListener('onDisappear', this.onDisappear, this);
this._parent.addChild(box);
box.createBg();
this._boxs.push(box);
}
onDisappear(e: egret.Event) {
const currentBox = e.target as Box;
this.removeBoxFromList(currentBox);
}
removeBoxFromList(currentBox: Box) {
const index = this._boxs.indexOf(currentBox);
if (index != -1) this._boxs.splice(index, 1);
}
reset() {
clearInterval(this._timer);
this._timer = 0;
this._currentBoxIndex = 0;
}
createFirstBox() {
return new Promise(async (resolve) => {
const box = new Box(this._boxKeys[this._currentBoxIndex]);
box.speed = this._boxSpeed;
box.addEventListener('onDisappear', this.onDisappear, this);
this._boxs.push(box);
this._parent.addChild(box);
this._currentBoxIndex++;
await box.createFirstBg();
this.dispatchEvent(new egret.Event(egret.Event.COMPLETE));
resolve();
})
}
updateSpeed(val: number) {
this._boxSpeed = val;
this._boxs.forEach((box) => {
box.speed = this._boxSpeed;
});
}
get boxs() { return this._boxs }
}
\ No newline at end of file
export default class Guide extends egret.Sprite {
destroy(): any {
this.parent.removeChild(this);
}
constructor(parent: egret.Sprite) {
super();
this.touchEnabled=true;
this.graphics.beginFill(0, .7);
this.graphics.drawRect(0, 0, parent.stage.stageWidth, parent.stage.stageHeight);
this.graphics.endFill();
parent.addChild(this);
}
}
\ No newline at end of file
import StartScene from "./StartScene";
import Monkey from "./Monkey";
export default class GuideCtrl extends egret.EventDispatcher {
private _main: StartScene;
private _tag: boolean;
private _guideTop: egret.Sprite;
constructor(view: StartScene) {
super();
this._main = view;
this.init();
}
start() {
if (this._tag) {
this._main.guideView.destroy();
this._main.addTouchEvent();
this.doComplete();
}
else {
this.startGuide();
}
}
private startGuide() {
this._guideTop = new egret.Sprite();
this._main.topLay.addChild(this._guideTop);
this._main.monkey.once('onStartShaking', this.onMonkeyStartShaking, this);
this._main.boxListCtrl.boxs[0].once('onPassMiddle', this.onPassMiddle, this);
this._main.boxListCtrl.updateSpeed(__boxMoveSpeed__ * 10);
}
onPassMiddle() {
this._main.boxListCtrl.pause();
this.addGuide();
}
tips;
async addGuide() {
const hand = await RES.getResAsync('guide_hand_png');
const tips = await RES.getResAsync('guide_tips_png');
const guide_dialog = await RES.getResAsync('guide_dialog_png');
this.doComplete();
await this.showtipsAni(tips);
await this.showhandAni(hand);
await this.showguideAni(guide_dialog);
}
private doComplete() {
this.dispatchEvent(new egret.Event(egret.Event.COMPLETE));
}
enableInteract() {
if (!this._tag)
this._main.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
}
async showtipsAni(texture) {
const pic = new egret.Bitmap(texture);
pic.anchorOffsetX = pic.width >> 1;
pic.anchorOffsetY = pic.height >> 1;
this._guideTop.addChild(pic);
return new Promise((r) => {
egret.Tween.get(pic).set({ x: 0, y: 710 + 130 })
.to({ x: 750 / 2 }, 200, egret.Ease.getBackOut(3)).wait(200)
.call(() => r(pic));
});
}
async showhandAni(texture) {
const pic = new egret.Bitmap(texture);
pic.anchorOffsetX = pic.width >> 1;
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))
.wait(200).call(() => r(pic));
});
}
async showguideAni(texture) {
const pic = new egret.Bitmap(texture);
pic.anchorOffsetX = pic.width >> 1;
pic.anchorOffsetY = pic.height >> 1;
this._guideTop.addChild(pic);
return new Promise((r) => {
egret.Tween.get(pic).set({ x: 750, y: 200 }).to({ x: 200 }, 200, egret.Ease.getBackOut(3))
.wait(200).call(() => r(pic));
});
}
onTouch() {
if (!this._main.checkCanDoAtion()) return;
this._main.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
this._main.boxListCtrl.updateSpeed(__boxMoveSpeed__);
this.setTag();
this._main.guideView.destroy();
egret.Tween.get(this._guideTop).to({ alpha: 0 }, 200).call(() => {
this._main.topLay.removeChild(this._guideTop);
}, this);
this._main.doAction();
this._main.addTouchEvent();
}
onMonkeyStartShaking() {
this._main.monkey.stop(Monkey.RANGE / 3)
}
private init() {
this._tag = localStorage.getItem('guide') === '1';
}
setTag() {
localStorage.setItem('guide', '1');
}
}
\ No newline at end of file
export default class Monkey extends egret.Sprite {
private h = 525;
private w = 265;
private h0 = 8;
private w0 = 118;
private h1 = 23;
private w1 = 29;
private r1;
private len;
private targetY = 70;
private targetX = 369;
static RANGE = 60;
private _shakeSpeed = .5;
constructor() {
super();
this.anchorOffsetX = 113;
this.anchorOffsetY = 8;
const a = this.w0 - this.w1;
const b = this.h - this.h0 - this.h1;
this.r1 = Math.tan(a / b) / Math.PI * 180;
this.len = Math.sqrt(a * a + b * b);
this.start();
}
private async start() {
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: 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);
}
startShaking() {
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.dispatchEvent(new egret.Event('onStartShaking'));
}
stopShaking() {
if (this.hasEventListener(egret.Event.ENTER_FRAME))
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
stop(rotation = 0) {
this.stopShaking();
this._dir = 1;
this.rotation = rotation;
}
private _dir = 1;
onEnterFrame() {
this.rotation += this._shakeSpeed * this._dir;
if (this.rotation > Monkey.RANGE)
this._dir = -1;
if (this.rotation < -Monkey.RANGE)
this._dir = 1;
this.dispatchEvent(new egret.Event('pointUpdate', false, false, this.getPoint()))
}
getPoint() {
const r = (this.r1 + this.rotation) / 180 * Math.PI;
const a = Math.sin(r) * this.len;
const b = Math.cos(r) * this.len;
const y = b;
const x = -a;
return new egret.Point(x, y);
}
async createBg() {
return new Promise(async (resolve) => {
const picData: egret.SpriteSheet = await RES.getResAsync('monkey_json');
const pic = new egret.Bitmap(picData.getTexture('monkey'));
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)
});
}
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
import SheetAnimation from "../components/SheetAnimation";
import { getResPath } from "../utils";
export default class Net extends egret.Sprite {
private _pic: SheetAnimation;
constructor() {
super();
this._pic = new SheetAnimation();
this.addChild(this._pic);
this.createBg();
this.y = 600+30;
}
doAction() {
if (!this._pic.sheet) return;
this._pic.play();
this._pic.addEventListener('frameUpdate', this.onEnterFrame, this);
}
onEnterFrame(e: egret.Event) {
if (e.data == this._pic.totalFrames) {
this._pic.removeEventListener('frameUpdate', this.onEnterFrame, this);
this._pic.stopAtFirstFrame();
}
}
createBg() {
let url = getResPath() + `resource/assets/startScene/net.json`;
RES.getResByUrl(url, (sheet: egret.SpriteSheet) => {
this._pic.sheet = sheet;
this._pic.fps = 20;
this.alpha = 0;
egret.Tween.get(this).to({ alpha: 1 }, 500);
// setInterval(() => {
// this.doAction()
// }, 5000);
this.dispatchEvent(new egret.Event(egret.Event.COMPLETE));
}, this, RES.ResourceItem.TYPE_SHEET);
}
}
\ No newline at end of file
import { GamePlayModel } from "../../libs/tw/model/game/GamePlayModel";
import Scene from "../views/Scene";
import Box from "./Box";
import BoxListCtrl from "./BoxListCtrl";
import LayerTypes from "./data/LayerTypes";
import debug from "./debug";
import Guide from "./Guide";
import GuideCtrl from "./GuideCtrl";
import Monkey from "./Monkey";
import Net from "./Net";
import BoxOpenState from "./view/BoxOpenState";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
import submitAfterDostart from "../../libs/new_tw/ctrls/submitAfterDostart";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import showAlertPanel from "../ctrls/showAlertPanel";
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;
private _guideCtrl: GuideCtrl;
static NET_RANGE = 200;
private _debug: debug;
private _keyResCounter = 0;
async start(data?) {
this.initUI();
const t1 = Date.now() - __t0__; console.log(`startScene添加到stage:${t1 / 1000}s`)
const picData: any = await this.getBg();
const pic = new egret.Bitmap(picData);
egret.Tween.get(pic).set({ alpha: 0 }).to({ alpha: 1 }, 200);
this.getLayer(LayerTypes.bg).addChild(pic);
const t2 = Date.now() - __t0__; console.log(`首屏(背景显示)时间:${t2 / 1000}s`);
this.getLayer(LayerTypes.ui).visible = true;
this._boxListCtrl = new BoxListCtrl(this.getLayer(LayerTypes.box));
await this._boxListCtrl.createFirstBox();
this._boxListCtrl.resume();
this.canInteract();
const monkey = new Monkey();
this.getLayer(LayerTypes.monkey).addChild(monkey);
monkey.addEventListener('pointUpdate', this.onPointUpdate, this)
this._monkey = monkey;
this._keyResCounter++;
monkey.addEventListener(egret.Event.COMPLETE, this.checkKeyResource, this);
this._guideView = new Guide(this.getLayer(LayerTypes.guide));
this._guideCtrl = new GuideCtrl(this);
this._keyResCounter++;
this._guideCtrl.addEventListener(egret.Event.COMPLETE, this.checkKeyResource, this);
this._guideCtrl.start();
this._guideCtrl.enableInteract();
const net = new Net();
this.getLayer(LayerTypes.net).addChild(net);
this._net = net;
this._keyResCounter++;
net.addEventListener(egret.Event.COMPLETE, this.checkKeyResource, this);
if (__debug__) {
this._debug = new debug(this.getLayer(LayerTypes.top));
}
}
canInteract() {
this.getLayer(LayerTypes.bg).touchEnabled = true;
const t = Date.now() - __t0__; console.log(`可交互时间:${t / 1000}s`);
}
checkKeyResource() {
this._keyResCounter--;
if (this._keyResCounter != 0) return;
const t = Date.now() - __t0__; console.log(`关键元素完全时间:${t / 1000}s`);
this._kids = new Kids();
this.getLayer(LayerTypes.kids).addChild(this._kids);
this.getLayer(LayerTypes.river).addChild(new River());
}
addTouchEvent() {
this.getLayer(LayerTypes.bg).addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
}
removeTouchEvent() {
this.getLayer(LayerTypes.bg).removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
}
private _catchedBox: Box;
private _cathchedBoxOpenState: BoxOpenState;
onTouch() {
if (!this.checkCanDoAtion()) return;
this.doAction();
}
_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];
if (catchedBox) { //抓住了,box没有办法再过线消失
this._boxListCtrl.pause();
//先从boxlist中移除,使之不再受到boxlistCtrl的控制
this._boxListCtrl.removeBoxFromList(catchedBox);
this._catchedBox = catchedBox;
catchedBox.doThrow();
this._isBoxFlying = true;
this.addThrowTick();
} else {//没有抓住,不需要处理,如果过网了就会自动消失。如果没有过网,下次还能抓。
this.checkmode1();
}
}
private _mode1DostartTag = true;
private checkmode1() {
if (__mode__ == 1) { //发一个空的
this._mode1DostartTag = false;
submitAfterDostart(() => {
NetManager.ins.getInfo(() => { this._mode1DostartTag = true; console.log('小孩儿休息完毕.') });
}, __award_thanks_score__);
}
}
openBox() {
submitAfterDostart(() => {
this._cathchedBoxOpenState.destroy();
this._cathchedBoxOpenState = null;
this._isBoxFlying = false;
let panel: Panel;
if (DataManager.ins.gameGetSubmitResultData.lottery) {
panel = PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL)
} else {
panel = showAlertPanel('手气不佳 \n 再试一次吧~');
}
panel.once('onDestroy', this.onPanelDestroy, this);
NetManager.ins.getInfo(() => { this._mode1DostartTag = true; console.log('小孩儿休息完毕.') });
}, this._cathchedBoxOpenState.boxData.award);
}
onPanelDestroy() {
this.boxListCtrl.resume();
this._monkey.startShaking();
}
checkCanDoAtion() {
if (!DataManager.ins.getInfoData) {
console.log('getinfo接口没有返回');
return false;
}
if (this._isBoxFlying) {
console.log('box还在飞呢');
return false;
}
if (!this._mode1DostartTag && __mode__ == 1) {
console.log('mode1,submitAfterDostart没有执行完成');
return false;
}
if (DataManager.ins.getInfoData.status.code == 2) {//积分不足
showAlertPanel('积分不足 \n 多赚点积分再来吧');
return false;
}
if (DataManager.ins.getInfoData.status.code == 3) {//参与次数用完
showAlertPanel('参与次数用完 \n 请明天再来吧');
return false;
}
return true;
}
addThrowTick() {
this.addEventListener(egret.Event.ENTER_FRAME, this.onThrowTick, this);
}
removeThrowTick() {
this.removeEventListener(egret.Event.ENTER_FRAME, this.onThrowTick, this);
}
onThrowTick() {
this._catchedBox.onThrowTick();
const disX = Math.abs(this._catchedBox.x - this._handX);
const disY = Math.abs(this._catchedBox.y - this._handY);
const dis = 100 + __monkeyHandSize__;
if (disX < dis && disY < dis) {
this.onCatchedByMonkey();
} else if (this._catchedBox.vy > 0) {
this.onNotCatchedByMonkey();
}
}
private _catchedBoxByMoneky: Box;
onCatchedByMonkey() {
this.removeThrowTick();
this._catchedBoxByMoneky = this._catchedBox;
this._catchedBox = null;
this.checkmode1();
this._isBoxFlying = false;
egret.Tween.get(this._catchedBoxByMoneky)
.to({ scaleX: 1, scaleY: 1 }, 500)
.wait(500)
.to({ alpha: 0 }, 500).call(() => {
this._catchedBoxByMoneky.destroy();
this._catchedBoxByMoneky = null;
this.boxListCtrl.resume();
}, this);
}
onNotCatchedByMonkey() {
this.removeThrowTick();
this._cathchedBoxOpenState = new BoxOpenState(this._catchedBox.type);
this._cathchedBoxOpenState.x = this._catchedBox.x;
this._cathchedBoxOpenState.y = this._catchedBox.y;
this.topLay.addChild(this._cathchedBoxOpenState);
egret.Tween.get(this._catchedBox).to({ alpha: 0 }, 500);
this._catchedBox = null;
this._cathchedBoxOpenState.start();
this.openBox();
}
private _handX: number;
private _handY: number;
onPointUpdate(e: egret.Event) {
const p = e.data as egret.Point;
this._handX = p.x + this._monkey.x;
this._handY = p.y + this._monkey.y;
if (this._catchedBoxByMoneky) {
this._catchedBoxByMoneky.x = this._handX;
this._catchedBoxByMoneky.y = this._handY;
}
if (this._debug) {
this._debug.shape.x = this._handX;
this._debug.shape.y = this._handY;
}
}
async getBg() {
let url = __bgUrl__
return new Promise((resolve) => {
RES.getResByUrl(url, (picData) => {
resolve(picData)
}, this, RES.ResourceItem.TYPE_IMAGE);
});
}
initUI() {
const uiLayer = this.getLayer(LayerTypes.ui);
uiLayer.addChild(this['ruleBtn']);
uiLayer.addChild(this['optionBtn']);
this['ruleBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
this['optionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_optionBtn, this);
uiLayer.addChild(new Tips());
uiLayer.addChild(new DeclareTextTips());
uiLayer.visible = false;
}
onTap_ruleBtn(e: egret.Event) {
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
}
onTap_optionBtn(e: egret.Event) {
PanelCtrl.instance.show(ModuleTypes.OPTIONS_PANEL);
}
protected get layerKeys() {
return [
LayerTypes.bg,
LayerTypes.river,
LayerTypes.ui,
LayerTypes.guide,
LayerTypes.kids,
LayerTypes.net,
LayerTypes.box,
LayerTypes.monkey,
LayerTypes.top,
]
}
ruleBtn: eui.Button;
optionBtn: eui.Button;
protected get skinKey() { return 'Start' }
get guideView() { return this._guideView }
get monkey() { return this._monkey }
get boxListCtrl() { return this._boxListCtrl }
get net() { return this._net }
get topLay() { return this.getLayer(LayerTypes.top) }
}
\ No newline at end of file
enum LayerTypes {
bg, kids, box, net, monkey, guide, top,ui,river
}
export default LayerTypes
\ No newline at end of file
export const getBoxKeyList = () => {
const list = [];
for (const key in __boxmap__) {
if (__boxmap__.hasOwnProperty(key)) {
list.push(key);
}
}
return list;
}
\ No newline at end of file
import Box from "./Box";
import StartScene from "./StartScene";
export default class debug {
parent;
shape: egret.Shape;
constructor(parent: egret.Sprite) {
this.parent = parent;
const top = this.parent;
this.shape = new egret.Shape();
top.addChild(this.shape);
this.shape.graphics.beginFill(0xff0000);
// const size = __monkeyHandSize__;
// this.shape.graphics.drawRect(0, 0, 2, 2);
this.shape.graphics.drawCircle(0,0,4);
this.shape.graphics.endFill();
const shape1 = new egret.Shape();
shape1.graphics.beginFill(0xff0000);
shape1.graphics.drawRect(0, 0, 999, 1);
shape1.graphics.endFill();
shape1.y = Box.MIDDLE_Y;
top.addChild(shape1);
const shape2 = new egret.Shape();
shape2.graphics.beginFill(0xff0000);
shape2.graphics.drawRect(0, 0, 999, 1);
shape2.graphics.endFill();
shape2.y = Box.MIDDLE_Y - StartScene.NET_RANGE;
top.addChild(shape2);
const shape3 = new egret.Shape();
shape3.graphics.beginFill(0xff0000);
shape3.graphics.drawRect(0, 0, 999, 1);
shape3.graphics.endFill();
shape3.y = Box.MIDDLE_Y + StartScene.NET_RANGE;
top.addChild(shape3);
}
}
\ No newline at end of file
export default class BoxOpenState extends egret.Bitmap {
_type: string;
onReady: () => void;
constructor(type) {
super();
this._type = type;
}
start(): any {
RES.getResByUrl(__boxOpenState__, (sheet: egret.SpriteSheet) => {
const texture = sheet.getTexture(`${this._type}OpenState`);
this.$setBitmapData(texture);
this.anchorOffsetX = texture.textureWidth >> 1;
this.anchorOffsetY = texture.textureHeight >> 1;
this.scaleX = this.scaleY = 1.5;
egret.Tween.get(this)
.set({ alpha: 0 })
.to({ alpha: 1 }, 200)
.call(() => {
// this.onReady();
this.shake();
})
}, this, RES.ResourceItem.TYPE_SHEET);
}
get boxData() { return __boxmap__[this._type] }
destroy() {
egret.Tween.removeTweens(this);
egret.Tween.get(this).to({alpha:0},500).call(()=>{
this.parent.removeChild(this);
});
}
shake(): any {
const x0 = this.x;
const y0 = this.y;
const offset = 10;
egret.Tween.get(this, { loop: true })
.set({ y: y0 - offset, x: x0 }).wait(30)
.set({ y: y0, x: x0 + offset }).wait(30)
.set({ y: y0 + offset, x: x0 }).wait(30)
.set({ y: y0, x: x0 - offset }).wait(30)
.set({ y: y0 - offset, x: x0 }).wait(30)
.set({ y: y0, x: x0 + offset }).wait(30)
.set({ y: y0 + offset, x: x0 }).wait(30)
.set({ y: y0, x: x0 - offset }).wait(30)
.wait(500);
}
}
\ No newline at end of file
import isIPhoneX from "../../../libs/tc/utils/isIPhoneX";
export default class DeclareTextTips extends eui.Label {
constructor() {
super();
this.width = 750;
this.textAlign = "center";
this.size = 20;
this.textColor = 0x333333;
this.text = '*兑换项与活动均与设备制造商Apple Inc.公司无关';
this.once(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
}
onAddToStage() {
this.y = this.stage.stageHeight - this.textHeight - 10;
if (isIPhoneX())
this.y -= 20;
}
}
\ 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() {
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) {
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
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
import { DataManager } from "../../../libs/tw/manager/DataManager";
export default class Tips extends eui.Label {
constructor() {
super();
this.horizontalCenter = "0";
this.width = 750;
this.textAlign = "center";
this.size = 22;
this.updateText();
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() {
if (!DataManager.ins.getInfoData) return;
this.text = DataManager.ins.getInfoData.status.text;
}
}
\ No newline at end of file
export enum ModuleTypes {
START_SCENE,
PALY_SCENE,
ALERT_PANEL,
RULE_PANEL,
MSG_PANEL
OPTIONS_PANEL,
PRIZE_PANEL
}
\ No newline at end of file
export const getResPath = () => window['resPath'] || '';
export const getSkinPath = (key)=>`resource/skins/${key}Skin.exml`
\ No newline at end of file
export const getResPath = () => resPath || '';
export const getSkinPath = (key) => `resource/skins/${key}Skin.exml`
\ No newline at end of file
......@@ -6,45 +6,17 @@ export default class Panel extends ComponentBase {
}
initEvents() {
if(this.closeBtns && this.closeBtns.length > 0){
this.closeBtns.forEach(
btn => { if(btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
btn => { if (btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
if(this.confirmBtns && this.confirmBtns.length > 0){
this.confirmBtns.forEach(
btn => { if(btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
if(this.creditsOutBtns && this.creditsOutBtns.length > 0){
this.creditsOutBtns.forEach(
btn => { if(btn) btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.creditsOut, this) }
)
}
}
removeEvents() {
if(this.closeBtns && this.closeBtns.length > 0){
this.closeBtns.forEach(
btn => { if(btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
if(this.confirmBtns && this.confirmBtns.length > 0){
this.confirmBtns.forEach(
btn => { if(btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
btn => { if (btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this) }
)
}
if(this.creditsOutBtns && this.creditsOutBtns.length > 0){
this.creditsOutBtns.forEach(
btn => { if(btn) btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.creditsOut, this) }
)
}
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
protected get confirmBtns(): eui.Button[] { return [this['confirmBtn']]}
protected get creditsOutBtns(): eui.Button[] { return [this['creditsOutBtn']] }
onTouchTap(): any {
this.hidePanel();
......@@ -55,9 +27,4 @@ export default class Panel extends ComponentBase {
this.dispatchEvent(new egret.Event('onDestroy'));
}
creditsOut(){
this.destroy();
this.dispatchEvent(new egret.Event('onCreditsOut'));
}
}
\ No newline at end of file
import ComponentBase from "../components/ComponentBase";
export default class Scene extends ComponentBase {
protected onSkinComplete() {
super.onSkinComplete();
this.createLayers();
}
private _map: { [key: string]: egret.Sprite }
createLayers() {
this._map = {};
for (const key of this.layerKeys) {
const layer = new egret.Sprite();
this.addChild(layer);
this._map[key] = layer;
}
}
getLayer(key) {
return this._map[key]
}
protected get layerKeys() {
return []
}
}
\ No newline at end of file
class Layers extends eui.UILayer {
private _topLayer: egret.Sprite;
private _popupLayer: egret.Sprite;
......
......@@ -14,6 +14,7 @@
"include": [
"src",
"libs"
],
"exclude": [
"node_modules"
......
{
"success": true,
"code": null,
"desc": null,
"data": {
"success": true,
"message": "请求成功",
"tip": "2元宝/次",
"option": null,
"useDpm": "{\"dpm\":\"1.19.1.0\",\"consumerId\":1,\"domain\":\"//embedlog.duiba.com.cn\",\"appId\":1,\"dcm\":\"\"}",
"againDpm": "{\"dpm\":\"1.19.3.0\",\"consumerId\":1,\"domain\":\"//embedlog.duiba.com.cn\",\"appId\":1}",
"flag": false
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
"code": 0,
"btnText": "开始游戏",
"btnDisable": 0,
"text": "1分/次",
"text": "3分/次",
"btnEventType": null,
"btnEvent": null
}
......
[
{
"autoOpen": false,
"description": "我是一个实物大奖",
"description": "实物大奖实物大奖实物大奖实物大奖物大奖实物大奖实大奖实",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/object.png",
"name": "实物大奖",
"scope": "1"
......@@ -14,17 +14,17 @@
"scope": "2-4"
},
{
"autoOpen": true,
"description": "我是一个优惠券",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/coupon.png",
"name": "优惠券",
"autoOpen": false,
"description": "我是一个话费",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png",
"name": "话费",
"scope": "2-4"
},
{
"autoOpen": true,
"description": "我是一个优惠券",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/coupon.png",
"name": "优惠券",
"autoOpen": false,
"description": "我是一个话费",
"logo": "//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png",
"name": "话费",
"scope": "2-4"
},
{
......
"测试排行榜图片<font color=\"0xff0000\">展示测</font> 试排行榜图片展示测试排行榜图片展示测试排行榜图片展示测试排行榜图片展示测试排行榜图片展示<br>测试排行榜图片展示<br>测试排行榜图片展示<br>测试排行榜图片展示<br>测试排行榜图片展示<br>测试排行榜图片展示<br><br><ul><li>使得发达省份</li><li>fdsgdfgdfg</li><li>阿斯达斯的</li><li>阿斯达斯的</li></ul>阿斯达斯的<br>阿萨德阿萨德<br><ul><li>131232132132</li></ul><ol><li>都市风格豆腐干豆腐干</li><li>的风格豆腐干豆腐干</li><li>豆腐干dfgdfgdfgg豆腐干豆腐干</li><li>但是法国豆腐干豆腐干豆腐干</li></ol><h4><ol><li>但是复苏的发达省份第三方<a href=\"http://baidu.com/\" data-tag=\"is-link\" title=\"Link: http://baidu.com\">http://baidu.com/</a></li></ol></h4>"
\ No newline at end of file
"1.玩家通过控制按压屏幕时长来控制猫咪跨出去的步伐的大小,步伐越大分数越高 \n2. 避开道路上的线条和陷阱,踩中则游戏结束 \n3.每局游戏都有一次积分复活的机会,当用户积分不足的情况下则不会出现提醒"
\ 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