Commit e45a04b2 authored by wildfirecode's avatar wildfirecode

1

parent 233d0e69
......@@ -33,34 +33,10 @@
<script src="libs/modules/eui/eui.js"></script>
<script src="libs/modules/assetsmanager/assetsmanager.js"></script>
<script src="libs/modules/tween/tween.js"></script>
<script src="libs/modules/game/game.min.js"></script>
<script src="libs/modules/promise/promise.js"></script>
<script src="libs/zepto.min.js"></script>
<script src="libs/security.js"></script>
<script src="libs/physics.min.js"></script>
<!-- <script src="default.thm.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: {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;G>t;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[ee]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return w(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return ie.error=e,ie}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?w(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===re?S(t,e._result):e._state===oe?j(t,e._result):E(e,void 0,function(e){return w(t,e)},function(e){return j(t,e)})}function g(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===ie?j(t,ie.error):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function w(e,n){e===n?j(e,v()):t(n)?g(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),P(t)}function S(t,e){t._state===ne&&(t._result=e,t._state=re,0!==t._subscribers.length&&J(P,t))}function j(t,e){t._state===ne&&(t._state=oe,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+re]=n,o[i+oe]=r,0===i&&t._state&&J(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?x(n,r,o,i):o(i);t._subscribers.length=0}}function T(){this.error=null}function M(t,e){try{return t(e)}catch(n){return se.error=n,se}}function x(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=M(r,o),s===se?(a=!0,u=s.error,s=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==ne||(i&&c?w(n,s):a?j(n,u):t===re?S(n,s):t===oe&&j(n,s))}function C(t,e){try{e(function(e){w(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function O(){return ue++}function k(t){t[ee]=ue++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Y(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[ee]||k(this.promise),B(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&S(this.promise,this._result))):j(this.promise,q())}function q(){return new Error("Array Methods must be provided an Array")}function F(t){return new Y(this,t).promise}function D(t){var e=this;return new e(B(t)?function(n,r){for(var o=t.length,i=0;o>i;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[ee]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if("undefined"!=typeof egret_native&&egret_native.capability&&!egret_native.capability("Promise")&&(n=void 0),n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):te())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),te=void 0;te=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var ee=Math.random().toString(36).substring(16),ne=void 0,re=1,oe=2,ie=new T,se=new T,ue=0;return Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===ne&&t>n;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==ne)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);g(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===ne&&(this._remaining--,t===oe?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(re,e,t)},function(t){return n._settledAt(oe,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U}),ES6Promise.polyfill();
\ No newline at end of file
/**
* 判断操作系统
* @returns {Array|{index: number, input: string}}
*/
const getIsIOS = () => {
return navigator.userAgent.match(/iphone|ipod|ipad/gi) != null;
}
export default getIsIOS
\ No newline at end of file
/**
* Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property
* @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style
* @version Egret 2.4
* @platform Web,Native
* @includeExample egret/text/HtmlTextParser.ts
* @language en_US
*/
/**
* 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象
* @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合
* @version Egret 2.4
* @platform Web,Native
* @includeExample egret/text/HtmlTextParser.ts
* @language zh_CN
*/
export class HtmlTextParser {
/**
* @version Egret 2.4
* @platform Web,Native
*/
constructor() {
this.initReplaceArr();
this.initPreReplaceArr();
}
private replaceArr: any[] = [];
private initReplaceArr(): void {
const arr = this.replaceArr = [];
arr.push([/&lt;/g, "<"]);
arr.push([/&gt;/g, ">"]);
arr.push([/&amp;/g, "&"]);
arr.push([/&quot;/g, "\""]);
arr.push([/&apos;/g, "\'"]);
}
private preReplaceArr: any[] = [];
private initPreReplaceArr() {
const arr = this.preReplaceArr = [];
arr.push([/\\\"/g, "\""]);
arr.push([/<br>/g, "\n"]);
}
/**
* @private
*
* @param value
* @returns
*/
private replaceSpecial(value: string): string {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < this.replaceArr.length; i++) {
const k = this.replaceArr[i][0];
const v = this.replaceArr[i][1];
value = value.replace(k, v);
}
return value;
}
/**
* @private
*/
private resutlArr: Array<egret.ITextElement> = [];
/**
* Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property
* @param htmltext {string} Text in html
* @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow Object that can be assigned to the egret.TextField#textFlow property
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象
* @param htmltext {string} html文本
* @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow 属性的对象
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
public parse(htmltext: string): egret.ITextElement[] {
this.preReplaceArr.forEach(p => {
htmltext = htmltext.replace(p[0], p[1]);
});
this.stackArray = [];
this.resutlArr = [];
let firstIdx = 0;//文本段开始位置
const length: number = htmltext.length;
while (firstIdx < length) {
const starIdx: number = htmltext.indexOf("<", firstIdx);
if (starIdx < 0) {
this.addToResultArr(htmltext.substring(firstIdx));
firstIdx = length;
}
else {
this.addToResultArr(htmltext.substring(firstIdx, starIdx));
let fontEnd = htmltext.indexOf(">", starIdx);
if (fontEnd == -1) {
egret.$error(1038);
fontEnd = starIdx;
}
else if (htmltext.charAt(starIdx + 1) == "\/") {//关闭
this.stackArray.pop();
}
else {
this.addToArray(htmltext.substring(starIdx + 1, fontEnd));
}
firstIdx = fontEnd + 1;
}
}
return this.resutlArr;
}
public parser(htmltext: string): Array<egret.ITextElement> {
return this.parse(htmltext);
}
/**
* @private
*
* @param value
*/
private addToResultArr(value: string): void {
if (value == "") {
return;
}
value = this.replaceSpecial(value);
if (this.stackArray.length > 0) {
this.resutlArr.push({ text: value, style: this.stackArray[this.stackArray.length - 1] })
}
else {
this.resutlArr.push(<egret.ITextElement>{ text: value });
}
}
//将字符数据转成Json数据
private changeStringToObject(str: string): egret.ITextStyle {
str = this.replaceSpecial(str.trim());
const info: any = {};
let header = [];
if (str.charAt(0) == "i" || str.charAt(0) == "b" || str.charAt(0) == "u") {
this.addProperty(info, str, "true");
}
// tslint:disable-next-line:no-conditional-assignment
else if (header = str.match(/^(font|a)\s/)) {
str = str.substring(header[0].length).trim();
let next = 0;
let titles;
// tslint:disable-next-line:no-conditional-assignment
while (titles = str.match(this.getHeadReg())) {
const title = titles[0];
let value = "";
str = str.substring(title.length).trim();
if (str.charAt(0) == "\"") {
next = str.indexOf("\"", 1);
value = str.substring(1, next);
next += 1;
}
else if (str.charAt(0) == "\'") {
next = str.indexOf("\'", 1);
value = str.substring(1, next);
next += 1;
}
else {
value = str.match(/(\S)+/)[0];
next = value.length;
}
this.addProperty(info, title.substring(0, title.length - 1).trim(), value.trim());
str = str.substring(next).trim();
}
}
return info;
}
/**
* @private
*
* @returns
*/
private getHeadReg(): RegExp {
return /^(color|textcolor|strokecolor|stroke|b|bold|i|italic|u|size|fontfamily|href|target)(\s)*=/;
}
/**
* @private
*
* @param info
* @param head
* @param value
*/
private addProperty(info: egret.ITextStyle, head: string, value: string): void {
switch (head.toLowerCase()) {
case "color":
case "textcolor":
value = value.replace(/#/, "0x");
info.textColor = parseInt(value);
break;
case "strokecolor":
value = value.replace(/#/, "0x");
info.strokeColor = parseInt(value);
break;
case "stroke":
info.stroke = parseInt(value);
break;
case "b":
case "bold":
info.bold = value == "true";
break;
case "u":
info.underline = value == "true";
break;
case "i":
case "italic":
info.italic = value == "true";
break;
case "size":
info.size = parseInt(value);
break;
case "fontfamily":
info.fontFamily = value;
break;
case "href":
info.href = this.replaceSpecial(value);
break;
case "target":
info.target = this.replaceSpecial(value);
break;
}
}
/**
* @private
*/
private stackArray: Array<egret.ITextStyle>;
/**
* @private
*
* @param infoStr
*/
private addToArray(infoStr: string): void {
const info: egret.ITextStyle = this.changeStringToObject(infoStr);
if (this.stackArray.length == 0) {
this.stackArray.push(info);
}
else {
const lastInfo: Object = this.stackArray[this.stackArray.length - 1];
for (const key in lastInfo) {
if (info[key] == null) {
info[key] = lastInfo[key];
}
}
this.stackArray.push(info);
}
}
}
const parser = new HtmlTextParser();
export const parseHtmlText = (content) => {
return parser.parse(content);
}
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 { getResPath } from "../new_tc/utils";
import { check_webp_feature } from "../tc/util/GFun";
import { DataManager } from "../tw/manager/DataManager";
import AssetAdapter from "./adapter/AssetAdapter";
import ThemeAdapter from "./adapter/ThemeAdapter";
import layers from "./views/layers";
import Loading from "./components/Loading";
import PanelCtrl from "./ctrls/panelCtrl";
import SceneCtrl from "./ctrls/sceneCtrl";
export default class MainBase extends eui.UILayer {
constructor() {
......
import { getSkinPath } from "../utils";
import { getSkinPath } from "../../new_tc/utils";
export default class ComponentBase extends eui.Component {
protected data: any;
......
import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import Panel from "../views/Panel";
export default class HTMLRulePanel extends Panel {
public labContent: eui.Label;
public scroller: eui.Scroller;
start() {
if (!DataManager.ins.getRuleData)
NetManager.ins.getRule(() => {
this.addRule();
});
else
this.addRule();
}
group: eui.Group;
protected config = {
x: 15.5,
y: "50%",
width: 70,
marginTop: -18,
height: 56,
lineHeight: 7,
fontSize: 3.5,
color: "#ffffff"
}
private htmlNode;
private clearTime;
private addRule() {
// alert()
const text = DataManager.ins.getRuleData.ruleText;
console.log(DataManager.ins.getRuleData.ruleText)
this.htmlNode = document.createElement("DIV")
this.htmlNode.setAttribute("style", `position: fixed;overflow-x: hidden;margin-top:${this.config.marginTop}vw ;overflow-y: auto;top: ${this.config.y}; left: ${this.config.x}vw;width: ${this.config.width}vw;height: ${this.config.height}vw;line-height: ${this.config.lineHeight}vw;font-size: ${this.config.fontSize}vw;color: ${this.config.color}`)
this.htmlNode.setAttribute("id", `htmlNode`)
this.htmlNode.innerHTML = text
clearTimeout(this.clearTime)
this.clearTime = setTimeout(() => {
document.body.appendChild(this.htmlNode)
}, 500)
}
hidePanel() {
super.hidePanel()
console.log(document.body)
if (document.getElementById("htmlNode")) {
document.body.removeChild(this.htmlNode)
}
}
protected get skinKey() { return 'Rule' }
}
\ No newline at end of file
import ComponentBase from "../components/ComponentBase";
import ComponentBase from "./ComponentBase";
export default class Loading extends ComponentBase {
private static _parent: egret.Sprite;
......
import { IGameOptionData } from "../../libs/tw/data/game/getOptions/IGameOptionData";
import { getSkinPath } from "../utils";
import { getSkinPath } from "../../new_tc/utils";
export default class ItemRenderder extends eui.ItemRenderer {
constructor() {
super();
......
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';
import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import ItemRenderder from "./OptionsItemRenderder";
import { IGameOptionData } from "../../tw/data/game/getOptions/IGameOptionData";
export default class OptionsPanel extends Panel {
start() {
if (!DataManager.ins.getOptionsData)
......
import showLog from "../../new_tw/ctrls/showLog";
import { LotteryType } from "../../tw/enum/LotteryType";
import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
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;
}
this.img.width = this.picBigWidth;
this.img.height = this.picBigWidth / this.bigPicRatio;
showLog(lottery);
}
get picWidth() { return 240 };
get picBigWidth() { return 510 };
get bigPicRatio() { return 640 / 300 }
......
import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import { HtmlTextParser } from "../HtmlTextParser";
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 {
public labContent: eui.Label;
public scroller: eui.Scroller;
......@@ -13,30 +15,10 @@ export default class RulePanel extends Panel {
this.addRule();
}
group:eui.Group;
group: eui.Group;
private addRule() {
let text: string = DataManager.ins.getRuleData.ruleText;
text = text.replace('/<div>/g', '');
text = text.replace('/</div>/g', '');
text = text.replace('/<br>/g', '<br> ');
const textlist = text.split('<br>');
console.log(text);
// this.labContent.textFlow = (new egret.HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
for (const textItem of textlist) {
// }
// for (let i = 0; i < textlist.length; i++) {
const l = new eui.Label();
l.textColor=this.labContent.textColor;
l.size=this.labContent.size;
l.width=this.labContent.width;
l.minHeight=20;
l.textFlow = (new egret.HtmlTextParser).parser(textItem+'');
this.group.addChild(l)
}
const text = DataManager.ins.getRuleData.ruleText;
this.labContent.textFlow = (new HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
}
protected get skinKey() { return 'Rule' }
......
......@@ -18,5 +18,5 @@ class Layers extends eui.UILayer {
}
const instance = new Layers();
export default instance
\ No newline at end of file
const layers = new Layers();
export default layers
\ No newline at end of file
......@@ -8,8 +8,8 @@ import { DataManager } from "../../../libs/tw/manager/DataManager";
* @param credits
* @param customizedType
*/
const doStart = (callback: Function, isAgain = false, credits?: number, customizedType?: number) => {
if (window['requirelogin'] && window['config_notrequirelogin'] === undefined) {
const doStart = (callback?: Function, isAgain = false, credits?: number, customizedType?: number) => {
if (window['requirelogin']) {
window['requirelogin']();
return;
}
......
import { DataManager } from "../../tw/manager/DataManager";
/**
* 剩余次数
* 为了按钮字体的美观,不展示开始游戏之外的文案,非常规状态由业务文案代替展示。
*/
const getCountTxt = () => {
let txt: string;
if (DataManager.ins.getInfoData.status.code != 0) {
txt = DataManager.ins.getInfoData.status.btnText;
} else {
txt = DataManager.ins.getInfoData.status.text;
}
return txt;
}
export default getCountTxt;
\ No newline at end of file
import { DataManager } from "../../tw/manager/DataManager";
/**
* 开始游戏按钮状态
*/
const getStartBtnEnable = () => {
let enable: boolean;
if (DataManager.ins.getInfoData.status.btnDisable || DataManager.ins.getInfoData.status.code == 6) {
enable = false;
} else {
enable = true;
}
return enable;
}
export default getStartBtnEnable;
\ No newline at end of file
{"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
......@@ -5,11 +5,7 @@
"name": "rule"
},
{
"keys": "guide_tips_png,guide_hand_png,guide_dialog_png",
"name": "guide"
},
{
"keys": "ruleBtn_png,optionBtn_png",
"keys": "ruleBtn_png,optionBtn_png,bg1_jpg,recordbtn_png",
"name": "startscene"
},
{
......@@ -25,8 +21,8 @@
"name": "prize"
},
{
"keys": "river4_png,river3_png,river2_png,river1_png,river5_png,river6_png,river7_png",
"name": "river"
"name": "preload",
"keys": "bg2_jpg,guide1_png,guide2_png,发弹雾气_png,大炮板子_png,大炮的头_png,火_png,火箭_png,轮子1_png,音乐关闭_png,音乐开启_png"
}
],
"resources": [
......@@ -40,63 +36,6 @@
"type": "image",
"name": "ruleBg_png"
},
{
"url": "assets/startScene/bg.jpg",
"type": "image",
"name": "bg_jpg"
},
{
"url": "assets/startScene/gift2.png",
"type": "image",
"name": "gift2_png"
},
{
"url": "assets/startScene/coin.png",
"type": "image",
"name": "coin_png"
},
{
"url": "assets/startScene/gift.png",
"type": "image",
"name": "gift_png"
},
{
"url": "assets/startScene/goldenbox.png",
"type": "image",
"name": "goldenbox_png"
},
{
"url": "assets/startScene/silverbox.png",
"type": "image",
"name": "silverbox_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/startScene/net.json",
"type": "sheet",
"name": "net_json",
"subkeys": "00,01,02,03,04,05,06,07,08,09,10"
},
{
"url": "assets/startScene/guide/guide_tips.png",
"type": "image",
"name": "guide_tips_png"
},
{
"url": "assets/startScene/guide/guide_hand.png",
"type": "image",
"name": "guide_hand_png"
},
{
"url": "assets/startScene/guide/guide_dialog.png",
"type": "image",
"name": "guide_dialog_png"
},
{
"url": "assets/startScene/optionBtn.png",
"type": "image",
......@@ -148,57 +87,79 @@
"name": "prizePanelUseBtn_png"
},
{
"url": "assets/startScene/monkey.json",
"type": "sheet",
"name": "monkey_json",
"subkeys": "eyeleft,eyeright,monkey"
"url": "assets/startScene/bg1.jpg",
"type": "image",
"name": "bg1_jpg"
},
{
"url": "assets/startScene/start_btn_gray.png",
"type": "image",
"name": "start_btn_gray_png"
},
{
"url": "assets/startScene/kids.json",
"type": "sheet",
"name": "kids_json",
"subkeys": "boy_eye,boyhand,girl_eye,girlhand,kids,kidschair"
"url": "assets/startScene/start_btn.png",
"type": "image",
"name": "start_btn_png"
},
{
"url": "assets/startScene/river.json",
"type": "sheet",
"name": "river_json",
"subkeys": "river1,river2,river3,river4"
"url": "assets/startScene/recordbtn.png",
"type": "image",
"name": "recordbtn_png"
},
{
"name": "bg2_jpg",
"type": "image",
"url": "assets/playscene/bg2.jpg"
},
{
"name": "guide1_png",
"type": "image",
"url": "assets/playscene/guide1.png"
},
{
"name": "guide2_png",
"type": "image",
"url": "assets/playscene/guide2.png"
},
{
"name": "发弹雾气_png",
"type": "image",
"url": "assets/playscene/发弹雾气.png"
},
{
"url": "assets/startScene/river/river4.png",
"name": "大炮板子_png",
"type": "image",
"name": "river4_png"
"url": "assets/playscene/大炮板子.png"
},
{
"url": "assets/startScene/river/river3.png",
"name": "大炮的头_png",
"type": "image",
"name": "river3_png"
"url": "assets/playscene/大炮的头.png"
},
{
"url": "assets/startScene/river/river2.png",
"name": "火_png",
"type": "image",
"name": "river2_png"
"url": "assets/playscene/火.png"
},
{
"url": "assets/startScene/river/river1.png",
"name": "火箭_png",
"type": "image",
"name": "river1_png"
"url": "assets/playscene/火箭.png"
},
{
"url": "assets/startScene/river/river5.png",
"name": "轮子1_png",
"type": "image",
"name": "river5_png"
"url": "assets/playscene/轮子1.png"
},
{
"url": "assets/startScene/river/river7.png",
"name": "音乐关闭_png",
"type": "image",
"name": "river7_png"
"url": "assets/playscene/音乐关闭.png"
},
{
"url": "assets/startScene/river/river6.png",
"name": "音乐开启_png",
"type": "image",
"name": "river6_png"
"url": "assets/playscene/音乐开启.png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PlaySkin" width="750" height="1663" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image horizontalCenter="0" source="bg2_jpg" top="0"/>
<e:Group x="0" top="20" width="100%">
<e:Group y="0" right="20">
<e:Button id="musicon" label="" x="0" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="音乐开启_png" source.down="音乐开启_png" source.disabled="音乐开启_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="musicoff" label="">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="音乐关闭_png" source.down="音乐关闭_png" source.disabled="音乐关闭_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
<e:Group x="201" y="0">
<e:Image source="火_png" x="0" y="0"/>
<e:Label text="20%" x="41" y="0" verticalAlign="middle" textAlign="center" width="96" height="100%" fontFamily="Helvetica"/>
</e:Group>
<e:Group x="22" top="0">
<e:Image source="火箭_png" left="0" top="0"/>
<e:Label text="10" x="41" verticalCenter="0" height="100%" verticalAlign="middle" textAlign="center" width="96" fontFamily="Helvetica"/>
</e:Group>
<e:Label id="score" text="123456789" y="63" verticalAlign="middle" textAlign="center" width="100%" size="65" bold="true" fontFamily="Helvetica"/>
</e:Group>
<e:Group id="car" x="329" width="93" verticalCenter="418">
<e:Image source="大炮板子_png" y="125" anchorOffsetX="46.5" x="46.5"/>
<e:Image source="大炮的头_png" y="51" anchorOffsetX="35" width="70" horizontalCenter="0"/>
<e:Image id="lunzi1" source="轮子1_png" anchorOffsetX="22.5" anchorOffsetY="22.5" x="10" y="142.5"/>
<e:Image id="lunzi2" source="轮子1_png" anchorOffsetX="22.5" anchorOffsetY="22.5" x="82" y="142.5"/>
<e:Image id="fireEffect" source="发弹雾气_png" y="29" horizontalCenter="0"/>
</e:Group>
</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:Skin class="StartSkin" width="750" height="1594" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="bg1_jpg" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0"/>
<e:Button id="startBtn" label="" scaleX="1" scaleY="1" y="780" horizontalCenter="0">
<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:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_png" source.down="start_btn_png" source.disabled="start_btn_gray_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="optionBtn" label="" x="632.57" y="42">
<e:skinName>
<e:Label id="countTxt" text="Label" width="100%" verticalAlign="middle" textAlign="center" y="901" horizontalCenter="0"/>
<e:Label id="exemptionTxt" text="*兑换项与活动均与设备制造商Apple Inc.公司无关*" width="100%" horizontalCenter="0" bottom="5" verticalAlign="middle" textAlign="center" textColor="0x333333" size="18"/>
<e:Group x="0" y="17">
<e:Button id="recordBtn" label="" x="611" y="0">
<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:Image width="100%" height="100%" source="recordbtn_png" source.down="recordbtn_png" source.disabled="recordbtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:skinName>
</e:Button>
<e:Button id="ruleBtn" label="" x="10" y="0">
<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="329" y="0">
<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:Group>
</e:Skin>
\ No newline at end of file
import MainBase from "../libs/tl/MainBase";
import Alert from "../libs/new_tl/components/Alert";
import OptionsPanel from "../libs/new_tl/components/OptionsPanel";
import PrizePanel from "../libs/new_tl/components/PrizePanel";
import RulePanel from "../libs/new_tl/components/RulePanel";
import PanelCtrl from "../libs/new_tl/ctrls/panelCtrl";
import SceneCtrl from "../libs/new_tl/ctrls/sceneCtrl";
import showAlertPanel from "../libs/new_tl/ctrls/showAlertPanel";
import MainBase from "../libs/new_tl/MainBase";
import { ModuleTypes } from "../libs/new_tl/types/sceneTypes";
import { NetManager } from "../libs/tw/manager/NetManager";
import Alert from "./alert/Alert";
import PanelCtrl from "./ctrls/panelCtrl";
import SceneCtrl from "./ctrls/sceneCtrl";
import OptionsPanel from "./optionsPanel/OptionsPanel";
import RulePanel from "./rulePanel/RulePanel";
import StartScene from "./startScene/StartScene";
import { ModuleTypes } from "./types/sceneTypes";
import PrizePanel from "./prizePanel/PrizePanel";
import showAlertPanel from "./ctrls/showAlertPanel";
import PlayScene from "./playScene/PlayScene";
class Main extends MainBase {
protected registerModules() {
......@@ -18,7 +19,8 @@ class Main extends MainBase {
PanelCtrl.instance.registerPanelClass(ModuleTypes.PRIZE_PANEL, PrizePanel);
SceneCtrl.instance.registerSceneClass(ModuleTypes.START_SCENE, StartScene);
NetManager.ins.onNotSuccess=(msg)=>{
SceneCtrl.instance.registerSceneClass(ModuleTypes.PALY_SCENE, PlayScene);
NetManager.ins.onNotSuccess = (msg) => {
showAlertPanel(msg)
}
}
......@@ -32,11 +34,9 @@ class Main extends MainBase {
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
}
window['Main'] = Main;
egret.runEgret({
renderMode: "webgl", audioType: 0, calculateCanvasScaleFactor: (context:any)=> {
renderMode: "webgl", audioType: 0, calculateCanvasScaleFactor: (context: any) => {
const backingStore = context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
......
// ∏import { DataManager, NetManager } from "duiba-tw";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import Loading from "../../loading/Loading";
export default
() => new Promise((resolve) => {
const _callback = (data) => {
Loading.instace.hide();
resolve(data);
}
Loading.instace.show();
if (DataManager.ins.getRuleData) {
_callback(true);
} else {
NetManager.ins.getRule(_callback);
}
})
// import { NetManager } from "../../../libs/tw/manager/NetManager";
import Loading from "../../loading/Loading";
import { NetManager } from "../../../libs/tw/manager/NetManager";
/**
* 实时排行榜
* @param {number} type 0总排行榜 1今日排行榜 2 多游戏总排行榜 3 昨日排行榜
* @param {number} count 返回榜单长度 最大50
*/
export default (callback, type, count) => {
const _callback = (data) => {
Loading.instace.hide();
callback(data);
}
Loading.instace.show();
NetManager.ins.realtimerank(_callback, type, count);
}
\ No newline at end of file
import Scene from "../../libs/new_tl/views/Scene";
export default class PlayScene extends Scene {
async start(data?) {
}
initEvents() {
}
protected get skinKey() { return 'Play' }
}
\ 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 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() {
const 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() {
const 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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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