Commit 2ede38a1 authored by XieChuanJin's avatar XieChuanJin

最终

parent 41e172cd
......@@ -14,4 +14,5 @@ if (cmd === 'build' && process.argv[3] === 'prod') {
if (process.argv[4] === 'exml')
cmd = 'buildProdEXML';
}
build[cmd]('egret');
\ No newline at end of file
build[cmd]('egret');
// build["notinypng"]("egret");
\ No newline at end of file
{
"1665d3d3ec0": {
"guideLines": [
{
"type": "h",
"pos": 715
}
]
},
"global": {
"globalAutoLayerMarkEnable": false,
"gridColor": 13878468,
"gridEnabled": false,
"gridSize": "10"
},
"16c22d7b1ce": {
"guideLines": [
{
"type": "v",
"pos": -151.515
}
]
},
"16cdb3e85df": {
"guideLines": [
{
"type": "v",
"pos": -31
}
],
"guideLinesEnabled": false,
"backgroundX": 0,
"backgroundY": 0,
"backgroundWidth": -1,
"backgroundHeight": -1,
"useBgImage": true,
"useBgColor": true,
"backgroundAlpha": 100
},
"16cdc9054fe": {
"path": "..\\resource\\skins\\item\\Test.ts",
"class": "Test",
"parentPath": ""
},
"16cf4f6bb31": {
"path": "..\\resource\\skins\\component\\MyButton.ts",
"class": "MyButton",
"parentPath": ""
},
"16cf500b40a": {
"path": "components\\MyButton.ts",
"class": "MyButton",
"parentPath": ""
},
"16cf5389308": {
"path": "components\\T2.ts",
"class": "T2",
"parentPath": ""
},
"16db35986e0": {
"path": "..\\resource\\skins\\TestCom.ts",
"class": "TestCom",
"parentPath": ""
}
"1665d3d3ec0": {
"guideLines": [
{
"type": "h",
"pos": 715
}
]
},
"global": {
"globalAutoLayerMarkEnable": false,
"gridColor": 13878468,
"gridEnabled": false,
"gridSize": "10"
},
"16c22d7b1ce": {
"guideLines": [
{
"type": "v",
"pos": -151.515
}
]
},
"16cdb3e85df": {
"guideLines": [
{
"type": "v",
"pos": -31
}
],
"guideLinesEnabled": false,
"backgroundX": 0,
"backgroundY": 0,
"backgroundWidth": -1,
"backgroundHeight": -1,
"useBgImage": true,
"useBgColor": true,
"backgroundAlpha": 100
},
"16cdc9054fe": {
"path": "..\\resource\\skins\\item\\Test.ts",
"class": "Test",
"parentPath": ""
},
"16cf4f6bb31": {
"path": "..\\resource\\skins\\component\\MyButton.ts",
"class": "MyButton",
"parentPath": ""
},
"16cf500b40a": {
"path": "components\\MyButton.ts",
"class": "MyButton",
"parentPath": ""
},
"16cf5389308": {
"path": "components\\T2.ts",
"class": "T2",
"parentPath": ""
},
"16db35986e0": {
"path": "..\\resource\\skins\\TestCom.ts",
"class": "TestCom",
"parentPath": ""
}
}
\ No newline at end of file
......@@ -22,6 +22,59 @@
margin: 0;
height: 100%;
}
/* 易盾css*/
.captcha {
display: none;
position: fixed;
z-index: 10000;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.6);
}
.captcha .neCaptcha-dialog {
background-color: #fff;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
position: absolute;
left: 50%;
top: 45%;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width: 270px;
height: 134px;
}
.captcha .neCaptcha-dialog::after {
position: absolute;
content: '单次游戏结束,请拖动滑块提交分数';
width: 100%;
height: 30px;
top: -40px;
left: 0;
text-align: center;
line-height: 30px;
font-size: 16px;
color: #ffff00;
}
.captcha .neCaptcha-dialog::before {
background-color: #fff;
content: '';
display: block;
width: 280px;
height: 144px;
position: absolute;
top: -5px;
left: -5px;
z-index: -1;
}
</style>
</head>
......@@ -32,7 +85,13 @@
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div>
<img id="shareImg" />
<div id="sCloseBtn"></div>
<script>
var appId = "67372";
var mconfig = {
//兑换记录页Url
rewardRecordUrl: "http://activity.m.duibatest.com.cn/projectx/p98a3fa4c/f09ba186f.html"
}
</script>
<script src="libs/modules/egret/egret.js"></script>
<script src="libs/modules/egret/egret.web.js"></script>
<script src="libs/modules/eui/eui.js"></script>
......@@ -47,141 +106,67 @@
<script src="output.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="libs/svga.egret.min.js"></script>
<script>
var svgaUrlPrefix = "resource/assets/svga/";
var maxRemainTime = 15;
var dress = {
0: {
tryTime: 1,
score: 5
},
1: {
tryTime: 2,
score: 5
},
2: {
tryTime: 3,
score: 10
},
3: {
tryTime: 5,
score: 10
},
4: {
tryTime: 6,
score: 20
},
5: {
tryTime: 6,
score: 20
},
6: {
tryTime: 8,
score: 30
}
}
</script>
<script>
var development = true;
var CFG = {
actId: '1',
oaId: '1',
unitName: '积分',
btnUnitName: '积分',
doJoin: '/hdtool/recon/doJoin?dpm=1.3.1.0&activityId=1',
quireOrder: '/hdtool/getOrderStatus',
styleConfig: '/hdtool/getHdtoolConfig',
getElement: '/hdtool/ajaxElement',
getPrizeDetail: '/hdtool/prizeDetail',
ajaxThroughInfo: '/hdtool/ajaxThroughInfo',
throughSubmit: '/hdtool/throughSubmit',
gameGetOrder: '/hdtool/getOrderInfo',//游戏获取订单信息接口
gameSubmit: '/hdtool/gameSubmit',//游戏结果提交接口
doSubmit: '/hdtool/submit',
adslotId: '',
consumerId: '100005285',
isNotLoginUser: false,
uid: 'duiba-preview-user',
hdType: 'duiba',
hdToolId: '35696',
appType: 'credits',
subType: 'custom',
directSendCoupon: 'false',
ajaxAction: '',
recommendQueue: '/recommend/getRecommend',
recommendSkin: '/recommend/getRecommendSkin',
isShowDetail: true,
preview: true,
from: 'login',
login: '//activity.m.duibatest.com.cn/hdtool/login?dpm=1.3.3.0',
flowRedirectUrl: '',
flowRedirectTuiaUrl: '',
isOpenRecommend: true,
getCreditsLink: 'http://www.baidu.com?uid=duiba-preview-user&dbnewopen',
appId: '1',
recordUrl: '//activity.m.duibatest.com.cn/crecord/record?dbnewopen&dpm=1.3.2.0',
shareDesc: '分享分享3',
entranceDesc: '可到我的奖品里领奖了!',
isSHowMeat: true,
needCouponModal: true, // 给前端用,判断是否需要使用配置的优惠券弹窗
needRecommendModal: true, // 给前端用,判断是否需要公用推荐位弹窗
asyncFiles: [], // 给前端用,异步加载的文件
shareAndroidLinkActivity: 'http://www.baidu.com',
shareIosLinkActivity: 'http://www.baidu.com'
};
</script>
<!-- 易盾js -->
<script type="text/javascript" src="//cstaticdun.126.net/load.min.js"></script>
<script src="output.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="libs/svga.egret.min.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<!-- 分享 -->
<script src="https://cdn.sdb.com.cn/aladdin/1.0.20/aladdin.ibank.min.js"></script>
<script src="https://b.pingan.com.cn/app_com/zhida/1.0.0/zhida-creditcard.js"></script>
<script>
var shareData = {
title: "我的前世农生",//标题
desc: "秋分时节,测一测你的前世是什么",//描述
link: "http://10.10.35.181:8080/egret/index.html",//链接
imgUrl: 'http://duiba.oss-cn-hangzhou.aliyuncs.com/db_games/activity/zhonghe_answer/share.jpg',//图片
//分享方法调用
window.share = function () {
paBankShare({
title: '每周送好礼,全民打星球',
content: '100000份金币奖励等你来拿',
url: 'http://www.baidu.com' || '分享链接地址',
img: 'img' || '分享图标'
})
}
wx.config({
debug: $wxdebug,
appId: '$wxappid',
timestamp: '$wxtimestamp',
nonceStr: '$wxnonceStr',
signature: '$wxsignature',
jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage']
});
function invokeWX(shareData) {
wx.onMenuShareTimeline({
title: shareData.title, //标题
desc: shareData.desc, //描述
link: shareData.link, //链接
imgUrl: shareData.imgUrl, //图片
success: function () { },
cancel: function () { }
});
wx.onMenuShareAppMessage({
title: shareData.title, //标题
desc: shareData.desc, //描述
link: shareData.link, //链接
imgUrl: shareData.imgUrl, //图片
success: function (e) { },
cancel: function () { }
});
}
//分享方法定义
const ShareTypes = {
wxchat: 'wechat_session', // 微信好友
wxcircle: 'wechat_timeline', // 微信朋友圈
sina: 'sina' // 新浪微博
};
wx.ready(function () {
invokeWX(shareData);
});
function paBankShare(data, callback) {
if (window.aladdin) {
const {
shareType = ['wxchat', 'wxcircle', 'sina'],
title, content, url, img
} = data || {};
const channels = [];
shareType.forEach((item) => {
ShareTypes[item] && channels.push(ShareTypes[item]);
});
window.aladdin.share.msg({
channels,
title,
shareText: content,
shareUrl: url,
imgUrl: img
}, (err, data) => {
if (data && typeof callback === 'function') {
callback();
}
});
} else {
clearTimeout(paBankShare.timer);
paBankShare.timer = setTimeout(() => {
paBankShare(data, callback);
}, 300);
}
}
</script>
<script>
// window['resPath'] = 'https://yun.duiba.com.cn/db_games/activity/fishaqy/1535713239/'
/**
* {
* "renderMode":, //Engine rendering mode, "canvas" or "webgl"
* "audioType": 0 //Use the audio type, 0: default, 2: web audio, 3: audio
* "antialias": //Whether the anti-aliasing is enabled in WebGL mode, true: on, false: off, defaults to false
* "calculateCanvasScaleFactor": //a function return canvas scale factor
* }
**/
egret.runEgret({
renderMode: "webgl",
audioType: 0,
......
import { DataManager } from './../manager/DataManager';
import { IExposureData } from '../data/common/IExposureData';
import { NetManager } from '../manager/NetManager';
// import { IExposureData } from '..';
export class Buried {
private static appId: number;
private static consumerId: number;
private static oaId: number;
private static appId: number | string;
private static oaId: number | string;
/**
* 初始化
*/
public static init(): void {
if(DataManager.ins.gameCfgData) {
this.appId = DataManager.ins.gameCfgData.appInfo.appId;
this.consumerId = DataManager.ins.getInfoData.consumerId;
this.oaId = DataManager.ins.gameCfgData.gameInfo.oaId;
} else if(DataManager.ins.customCfgData){
this.appId = DataManager.ins.customCfgData.appId;
this.consumerId = DataManager.ins.customCfgData.consumerId;
this.oaId = DataManager.ins.customCfgData.oaId ;
} else if(DataManager.ins.petIndexData && DataManager.ins.petIndexData.appId && DataManager.ins.petIndexData.activityId){
this.appId = DataManager.ins.petIndexData.appId;
this.consumerId = DataManager.ins.petIndexData.consumerId;
this.oaId = DataManager.ins.petIndexData.activityId ;
} else if(DataManager.ins.petsIndexData && DataManager.ins.petsIndexData.appId && DataManager.ins.petsIndexData.activityId){
this.appId = DataManager.ins.petsIndexData.appId;
this.consumerId = DataManager.ins.petsIndexData.consumerId;
this.oaId = DataManager.ins.petsIndexData.activityId ;
}
public static init(appId: number, oaId: number | string): void {
Buried.appId = appId;
Buried.oaId = oaId;
}
/**
* 创建dpm埋点数据
* @param {string} dpm 点击埋点
* @param {string} dcm 曝光埋点
* @param {string} embedDomain 埋点域名
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/
public static createExposure(dpm: string, dcm: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData {
const exposure: IExposureData = {
dpm: dpm,
dcm: dcm,
consumerId: Buried.consumerId,
appId: Buried.appId,
public static createExposure(appIdParam: string | number, embedDomain = '//embedlog.duiba.com.cn') {
return {
dpm: Buried.appId.toString() + `.110.${appIdParam}.1`,
dcm: `202.${Buried.oaId}.0.0`,
appId: Buried.appId.toString(),
domain: embedDomain
};
return exposure;
}
/**
......@@ -89,4 +68,18 @@ export class Buried {
return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;
}
private static doBuried(appIdParam: string | number, netManager: NetManager, callback: string) {
let data = Buried.createExposure(appIdParam);
netManager[callback](data);
console.log("exposure", data);
}
public static doClickBuried(appIdParam: string | number) {
Buried.doBuried(appIdParam, NetManager.ins, "clickLog");
}
public static doShowBuried(appIdParam: string | number) {
Buried.doBuried(appIdParam, NetManager.ins, "showLog");
}
}
{
"type": "activity",
"name": "save_sheik_2019"
"name": "shoot_planet_pingan_2019"
}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"car","version":5,"files":["..\\assets\\car\\car_wheel.png","..\\assets\\car\\car_gun.png","..\\assets\\car\\car_part_0.png","..\\assets\\car\\car_particle.png","..\\assets\\car\\car_shadow.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"font","version":5,"files":["..\\assets\\font\\nums_res.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"game","version":5,"files":["..\\assets\\game\\ball_0.png","..\\assets\\game\\ball_1.png","..\\assets\\game\\ball_2.png","..\\assets\\game\\ball_3.png","..\\assets\\game\\ball_4.png","..\\assets\\game\\ball_5.png","..\\assets\\game\\bullet.png","..\\assets\\game\\drop_bullet_0.png","..\\assets\\game\\drop_bullet_1.png","..\\assets\\game\\drop_power_0.png","..\\assets\\game\\drop_power_1.png","..\\assets\\game\\drop_power_2.png","..\\assets\\game\\star.png","..\\assets\\game\\ring.png","..\\assets\\game\\guide_mask_0.png","..\\assets\\game\\guide_mask_1.png","..\\assets\\game\\guide_arrow.png","..\\assets\\font\\nums_res.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"loading","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":"main_scene","version":5,"files":["..\\assets\\main_scene\\main_power.png","..\\assets\\main_scene\\main_bullet.png","..\\assets\\main_scene\\main_time_bg.png","..\\assets\\start_scene\\start_btn_music.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"my_props_panel","version":5,"files":["..\\assets\\my_props_panel\\my_props_bg.png","..\\assets\\my_props_panel\\my_props_content_bg.png","..\\assets\\common\\btn_close.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"not_winning_panel","version":5,"files":["..\\assets\\not_winning_panel\\not_winning_bg.png","..\\assets\\not_winning_panel\\not_winning_btn.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"props","version":5,"files":["..\\assets\\props\\disabled_revive_card.png","..\\assets\\props\\props_corner_mark_0.png","..\\assets\\props\\props_corner_mark_1.png","..\\assets\\props\\props_corner_mark_2.png","..\\assets\\props\\props_disabled_corner_mark.png","..\\assets\\props\\revive_card.png","..\\assets\\props\\score_card_100.png","..\\assets\\props\\score_card_500.png","..\\assets\\main_scene\\main_time_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rank_list_panel","version":5,"files":["..\\assets\\rank_list_panel\\rank_content_bg.png","..\\assets\\rank_list_panel\\rank_other_rank_bg.png","..\\assets\\rank_list_panel\\rank_separator.png","..\\assets\\rank_list_panel\\rank_toggle_off.png","..\\assets\\rank_list_panel\\rank_toggle_on.png","..\\assets\\rank_list_panel\\rank1.png","..\\assets\\rank_list_panel\\rank2.png","..\\assets\\rank_list_panel\\rank3.png","..\\assets\\rank_list_panel\\rank_bg.png","..\\assets\\common\\btn_close.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_panel","version":5,"files":["..\\assets\\common\\btn_close.png","..\\assets\\rule_panel\\rule_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"select_props_panel","version":5,"files":["..\\assets\\select_props_panel\\select_props_btn_use.png","..\\assets\\select_props_panel\\select_props_score_bg.png","..\\assets\\select_props_panel\\select_props_selector.png","..\\assets\\select_props_panel\\select_props_bg.png","..\\assets\\select_props_panel\\select_btn_submit.png","..\\assets\\select_props_panel\\select_line.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sign_in_panel","version":5,"files":["..\\assets\\sign_in_panel\\sign_btn_sign_in_normal.png","..\\assets\\sign_in_panel\\sign_coin.png","..\\assets\\sign_in_panel\\sign_item_bg.png","..\\assets\\sign_in_panel\\sign_revive_card.png","..\\assets\\sign_in_panel\\sign_score_card_bg.png","..\\assets\\sign_in_panel\\sign_signed.png","..\\assets\\sign_in_panel\\sign_btn_sign_in_disabled.png","..\\assets\\sign_in_panel\\sign_bg.png","..\\assets\\common\\btn_close.png","..\\assets\\sign_in_panel\\signed_mask.png","..\\assets\\common\\panel_light.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sign_success_panel","version":5,"files":["..\\assets\\sign_success_panel\\sign_success_btn_ok.png","..\\assets\\sign_success_panel\\sign_success_bg.png","..\\assets\\common\\panel_light.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sp_user_panel","version":5,"files":["..\\assets\\sp_user_panel\\sp_user_bg.png","..\\assets\\sp_user_panel\\sp_user_btn.png","..\\assets\\common\\btn_close.png","..\\assets\\common\\panel_light.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start_scene","version":5,"files":["..\\assets\\start_scene\\start_btn_music.png","..\\assets\\start_scene\\start_btn_music_disabled.png","..\\assets\\start_scene\\start_btn_my_props.png","..\\assets\\start_scene\\start_btn_my_reward.png","..\\assets\\start_scene\\start_btn_rank_list.png","..\\assets\\start_scene\\start_btn_rule.png","..\\assets\\start_scene\\start_btn_sign_in.png","..\\assets\\start_scene\\start_btn_task.png","..\\assets\\start_scene\\start_btn_share.png","..\\assets\\start_scene\\start_btn_start.png","..\\assets\\start_scene\\start_title.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"task_panel","version":5,"files":["..\\assets\\task_panel\\task_bg.png","..\\assets\\task_panel\\task_btn_bg.png","..\\assets\\task_panel\\task_btn_bg_disabled.png","..\\assets\\task_panel\\task_num_bg.png","..\\assets\\common\\btn_close.png","..\\assets\\select_props_panel\\select_line.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"toast_panel","version":5,"files":["..\\assets\\common\\toast_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"winning_panel","version":5,"files":["..\\assets\\winning_panel\\winning_bg.png","..\\assets\\winning_panel\\winning_img.png","..\\assets\\winning_panel\\winning_score_bg.png","..\\assets\\common\\btn_close.png"]}
\ No newline at end of file
{"file":"nums_res.png","frames":{
".":{"x":3,"y":215,"w":16,"h":17,"offX":7,"offY":49,"sourceW":29,"sourceH":66},
"k":{"x":155,"y":3,"w":42,"h":65,"offX":6,"offY":0,"sourceW":48,"sourceH":66},
"0":{"x":3,"y":144,"w":44,"h":65,"offX":2,"offY":1,"sourceW":48,"sourceH":66},
"1":{"x":145,"y":74,"w":27,"h":65,"offX":7,"offY":0,"sourceW":48,"sourceH":66},
"2":{"x":53,"y":74,"w":41,"h":64,"offX":3,"offY":1,"sourceW":48,"sourceH":66},
"3":{"x":100,"y":74,"w":39,"h":65,"offX":5,"offY":1,"sourceW":48,"sourceH":66},
"4":{"x":3,"y":3,"w":48,"h":64,"offX":0,"offY":1,"sourceW":48,"sourceH":66},
"5":{"x":53,"y":144,"w":39,"h":65,"offX":5,"offY":1,"sourceW":48,"sourceH":66},
"6":{"x":106,"y":3,"w":43,"h":65,"offX":3,"offY":1,"sourceW":48,"sourceH":66},
"7":{"x":203,"y":3,"w":42,"h":64,"offX":3,"offY":1,"sourceW":48,"sourceH":66},
"8":{"x":3,"y":73,"w":44,"h":65,"offX":2,"offY":1,"sourceW":48,"sourceH":66},
"9":{"x":57,"y":3,"w":43,"h":65,"offX":2,"offY":1,"sourceW":48,"sourceH":66}}}
\ No newline at end of file
......@@ -5,11 +5,11 @@
"name":"loading"
},
{
"keys":"main_bg_jpg,main_example_jpg,main_power_png,main_bullet_png,main_time_bg_png,start_btn_music_png",
"keys":"main_power_png,main_bullet_png,main_time_bg_png,start_btn_music_png,main_bg_jpg",
"name":"main_scene"
},
{
"keys":"btn_close_png,rule_bg_png,rule_example_jpg",
"keys":"btn_close_png,rule_bg_png",
"name":"rule_panel"
},
{
......@@ -17,27 +17,23 @@
"name":"toast_panel"
},
{
"keys":"car_wheel_png,example_png,car_gun_png,car_part_0_png,car_particle_png,car_shadow_png",
"keys":"car_wheel_png,car_gun_png,car_part_0_png,car_particle_png,car_shadow_png",
"name":"car"
},
{
"keys":"ball_0_png,ball_1_png,ball_2_png,ball_3_png,ball_4_png,ball_5_png,bullet_png,drop_bullet_0_png,drop_bullet_1_png,drop_power_0_png,drop_power_1_png,drop_power_2_png,star_png,ring_png",
"keys":"ball_0_png,ball_1_png,ball_2_png,ball_3_png,ball_4_png,ball_5_png,bullet_png,drop_bullet_0_png,drop_bullet_1_png,drop_power_0_png,drop_power_1_png,drop_power_2_png,star_png,ring_png,guide_mask_0_png,guide_mask_1_png,guide_arrow_png,nums_fnt,nums_res_png",
"name":"game"
},
{
"keys":"start_btn_my_props_png,start_btn_my_reward_png,start_btn_rank_list_png,start_btn_rule_png,start_btn_share_png,start_btn_sign_in_png,start_btn_start_png,start_btn_task_png,start_example_jpg,start_title_png,start_bg_jpg,start_btn_music_png",
"name":"start_scene"
},
{
"keys":"sign_btn_sign_in_normal_png,sign_coin_png,sign_example_jpg,sign_item_bg_png,sign_revive_card_png,sign_score_card_bg_png,sign_signed_png,sign_btn_sign_in_disabled_png,sign_bg_png,btn_close_png,signed_mask_png,panel_light_png",
"keys":"sign_btn_sign_in_normal_png,sign_coin_png,sign_item_bg_png,sign_revive_card_png,sign_score_card_bg_png,sign_signed_png,sign_btn_sign_in_disabled_png,sign_bg_png,btn_close_png,signed_mask_png,panel_light_png",
"name":"sign_in_panel"
},
{
"keys":"sign_success_btn_ok_png,sign_success_example_jpg,sign_success_bg_png,panel_light_png",
"keys":"sign_success_btn_ok_png,sign_success_bg_png,panel_light_png",
"name":"sign_success_panel"
},
{
"keys":"select_props_btn_use_png,select_props_example_jpg,select_props_score_bg_png,select_props_selector_png,select_props_bg_png,select_btn_submit_png,select_line_png",
"keys":"select_props_btn_use_png,select_props_score_bg_png,select_props_selector_png,select_props_bg_png,select_btn_submit_png,select_line_png",
"name":"select_props_panel"
},
{
......@@ -45,11 +41,11 @@
"name":"props"
},
{
"keys":"winning_bg_png,winning_example_jpg,winning_img_png,winning_score_bg_png,btn_close_png",
"keys":"winning_bg_png,winning_img_png,winning_score_bg_png,btn_close_png",
"name":"winning_panel"
},
{
"keys":"not_winning_bg_png,not_winning_btn_png,not_winning_example_jpg",
"keys":"not_winning_bg_png,not_winning_btn_png",
"name":"not_winning_panel"
},
{
......@@ -61,16 +57,24 @@
"name":"animation"
},
{
"keys":"rank_content_bg_png,rank_example_jpg,rank_other_rank_bg_png,rank_separator_png,rank_toggle_off_png,rank_toggle_on_png,rank1_png,rank2_png,rank3_png,rank_bg_png,btn_close_png",
"keys":"rank_content_bg_png,rank_other_rank_bg_png,rank_separator_png,rank_toggle_off_png,rank_toggle_on_png,rank1_png,rank2_png,rank3_png,rank_bg_png,btn_close_png",
"name":"rank_list_panel"
},
{
"keys":"task_bg_png,task_btn_bg_png,task_btn_bg_disabled_png,task_example_jpg,task_num_bg_png,btn_close_png,select_line_png",
"keys":"task_bg_png,task_btn_bg_png,task_btn_bg_disabled_png,task_num_bg_png,btn_close_png,select_line_png",
"name":"task_panel"
},
{
"keys":"my_props_bg_png,my_props_content_bg_png,my_props_example_jpg,btn_close_png",
"keys":"my_props_bg_png,my_props_content_bg_png,btn_close_png",
"name":"my_props_panel"
},
{
"keys":"sp_user_bg_png,sp_user_btn_png,btn_close_png,panel_light_png",
"name":"sp_user_panel"
},
{
"keys":"start_btn_music_png,start_btn_music_disabled_png,start_btn_my_props_png,start_btn_my_reward_png,start_btn_rank_list_png,start_btn_rule_png,start_btn_sign_in_png,start_btn_task_png,start_bg_jpg,start_btn_share_png,start_btn_start_png,start_title_png",
"name":"start_scene"
}
],
"resources":[
......@@ -99,11 +103,6 @@
"type":"image",
"url":"assets/car/car_wheel.png"
},
{
"name":"example_png",
"type":"image",
"url":"assets/car/example.png"
},
{
"name":"car_gun_png",
"type":"image",
......@@ -159,16 +158,6 @@
"type":"image",
"url":"assets/game/bullet.png"
},
{
"name":"main_bg_jpg",
"type":"image",
"url":"assets/main_scene/main_bg.jpg"
},
{
"name":"main_example_jpg",
"type":"image",
"url":"assets/main_scene/main_example.jpg"
},
{
"name":"drop_bullet_0_png",
"type":"image",
......@@ -224,46 +213,26 @@
"type":"image",
"url":"assets/start_scene/start_btn_rule.png"
},
{
"name":"start_btn_share_png",
"type":"image",
"url":"assets/start_scene/start_btn_share.png"
},
{
"name":"start_btn_sign_in_png",
"type":"image",
"url":"assets/start_scene/start_btn_sign_in.png"
},
{
"name":"start_btn_start_png",
"type":"image",
"url":"assets/start_scene/start_btn_start.png"
},
{
"name":"start_btn_task_png",
"type":"image",
"url":"assets/start_scene/start_btn_task.png"
},
{
"name":"start_example_jpg",
"type":"image",
"url":"assets/start_scene/start_example.jpg"
},
{
"name":"start_title_png",
"name":"start_btn_music_png",
"type":"image",
"url":"assets/start_scene/start_title.png"
"url":"assets/start_scene/start_btn_music.png"
},
{
"name":"start_bg_jpg",
"type":"image",
"url":"assets/start_scene/start_bg.jpg"
},
{
"name":"start_btn_music_png",
"type":"image",
"url":"assets/start_scene/start_btn_music.png"
},
{
"name":"sign_btn_sign_in_normal_png",
"type":"image",
......@@ -274,11 +243,6 @@
"type":"image",
"url":"assets/sign_in_panel/sign_coin.png"
},
{
"name":"sign_example_jpg",
"type":"image",
"url":"assets/sign_in_panel/sign_example.jpg"
},
{
"name":"sign_item_bg_png",
"type":"image",
......@@ -319,11 +283,6 @@
"type":"image",
"url":"assets/sign_success_panel/sign_success_btn_ok.png"
},
{
"name":"sign_success_example_jpg",
"type":"image",
"url":"assets/sign_success_panel/sign_success_example.jpg"
},
{
"name":"sign_success_bg_png",
"type":"image",
......@@ -344,11 +303,6 @@
"type":"image",
"url":"assets/select_props_panel/select_props_btn_use.png"
},
{
"name":"select_props_example_jpg",
"type":"image",
"url":"assets/select_props_panel/select_props_example.jpg"
},
{
"name":"select_props_score_bg_png",
"type":"image",
......@@ -409,11 +363,6 @@
"type":"image",
"url":"assets/winning_panel/winning_bg.png"
},
{
"name":"winning_example_jpg",
"type":"image",
"url":"assets/winning_panel/winning_example.jpg"
},
{
"name":"winning_img_png",
"type":"image",
......@@ -434,11 +383,6 @@
"type":"image",
"url":"assets/not_winning_panel/not_winning_btn.png"
},
{
"name":"not_winning_example_jpg",
"type":"image",
"url":"assets/not_winning_panel/not_winning_example.jpg"
},
{
"name":"bgm_mp3",
"type":"sound",
......@@ -489,11 +433,6 @@
"type":"image",
"url":"assets/rank_list_panel/rank_content_bg.png"
},
{
"name":"rank_example_jpg",
"type":"image",
"url":"assets/rank_list_panel/rank_example.jpg"
},
{
"name":"rank_other_rank_bg_png",
"type":"image",
......@@ -559,11 +498,6 @@
"type":"image",
"url":"assets/task_panel/task_btn_bg_disabled.png"
},
{
"name":"task_example_jpg",
"type":"image",
"url":"assets/task_panel/task_example.jpg"
},
{
"name":"task_num_bg_png",
"type":"image",
......@@ -574,11 +508,6 @@
"type":"image",
"url":"assets/rule_panel/rule_bg.png"
},
{
"name":"rule_example_jpg",
"type":"image",
"url":"assets/rule_panel/rule_example.jpg"
},
{
"name":"my_props_bg_png",
"type":"image",
......@@ -590,9 +519,64 @@
"url":"assets/my_props_panel/my_props_content_bg.png"
},
{
"name":"my_props_example_jpg",
"name":"guide_mask_0_png",
"type":"image",
"url":"assets/game/guide_mask_0.png"
},
{
"name":"guide_mask_1_png",
"type":"image",
"url":"assets/game/guide_mask_1.png"
},
{
"name":"sp_user_bg_png",
"type":"image",
"url":"assets/sp_user_panel/sp_user_bg.png"
},
{
"name":"sp_user_btn_png",
"type":"image",
"url":"assets/sp_user_panel/sp_user_btn.png"
},
{
"name":"start_btn_music_disabled_png",
"type":"image",
"url":"assets/start_scene/start_btn_music_disabled.png"
},
{
"name":"guide_arrow_png",
"type":"image",
"url":"assets/game/guide_arrow.png"
},
{
"name":"start_btn_share_png",
"type":"image",
"url":"assets/start_scene/start_btn_share.png"
},
{
"name":"start_btn_start_png",
"type":"image",
"url":"assets/start_scene/start_btn_start.png"
},
{
"name":"start_title_png",
"type":"image",
"url":"assets/start_scene/start_title.png"
},
{
"name":"main_bg_jpg",
"type":"image",
"url":"assets/main_scene/main_bg.jpg"
},
{
"name":"nums_fnt",
"type":"font",
"url":"assets/font/nums.fnt"
},
{
"name":"nums_res_png",
"type":"image",
"url":"assets/my_props_panel/my_props_example.jpg"
"url":"assets/font/nums_res.png"
}
]
}
\ No newline at end of file
{
"skins": {
"TestCom": "resource/eui_skins/TestCom.exml"
},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/LoadingSkin.exml",
"resource/skins/ToastPanelSkin.exml",
"resource/skins/SignInItem.exml",
"resource/skins/SelectPropsItem.exml",
"resource/skins/RankListItem.exml",
"resource/skins/RankListPanelRewardItem.exml",
"resource/skins/TaskItem.exml",
"resource/skins/PropsItem.exml"
],
"path": "resource/default.thm.json"
"skins": {
"TestCom": "resource/eui_skins/TestCom.exml"
},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/Car.exml",
"resource/skins/LoadingSkin.exml",
"resource/skins/MainSceneSkin.exml",
"resource/skins/MyPropsPanelSkin.exml",
"resource/skins/NotWinningPanelSkin.exml",
"resource/skins/ProgressBar.exml",
"resource/skins/PropsItem.exml",
"resource/skins/RankListItem.exml",
"resource/skins/RankListPanelRewardItem.exml",
"resource/skins/RankListPanelSkin.exml",
"resource/skins/RulePanelSkin.exml",
"resource/skins/SelectPropsItem.exml",
"resource/skins/SelectPropsPanelSkin.exml",
"resource/skins/SignInItem.exml",
"resource/skins/SignInPanelSkin.exml",
"resource/skins/SignSuccessPanelSkin.exml",
"resource/skins/SpUserPanelSkin.exml",
"resource/skins/StartSceneSkin.exml",
"resource/skins/TaskItem.exml",
"resource/skins/TaskPanelSkin.exml",
"resource/skins/ToastPanelSkin.exml",
"resource/skins/WinningPanelSkin.exml"
],
"path": "resource/default.thm.json"
}
\ No newline at end of file
......@@ -5,6 +5,5 @@
<e:Image source="car_gun_png" x="33.5" y="19.5"/>
<e:Image source="car_wheel_png" x="0" y="97.5"/>
<e:Image source="car_particle_png" x="15.98" y="1.33"/>
<e:Image source="example_png" alpha="0.5" locked="true" visible="false"/>
<e:Group width="63" height="121" anchorOffsetX="0" anchorOffsetY="0" x="29" y="20"/>
</e:Skin>
\ No newline at end of file
......@@ -7,18 +7,17 @@
<e:Label id="labelBulletScore" text="0" x="91" y="40" size="30" width="86" />
<e:Image source="main_power_png" x="186" y="29" />
<e:Label id="labelPowerScore" text="100%" x="260" y="42" size="30" />
<e:Label id="labelScore" text="0" y="122" size="80" bold="true" horizontalCenter="0" />
<e:Image source="main_time_bg_png" x="642" y="109"/>
<ns1:MButton id="btnMusic" label="" x="681" y="28" scaleX="1" scaleY="1">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_music_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<e:Label id="labelTime" text="" textColor="0x4c38a7" size="22" bold="true" horizontalCenter="315" verticalCenter="-639" textAlign="center"/>
<e:Image source="main_time_bg_png" x="642" y="109" />
<e:ToggleButton id="btnMusic" label="" x="681" y="28">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_music_disabled_png" source.down="start_btn_music_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</e:skinName>
</e:ToggleButton>
<e:Label id="labelTime" text="" textColor="0x4c38a7" size="22" bold="true" horizontalCenter="315"
verticalCenter="-639" textAlign="center" />
</e:Group>
</e:Group>
<e:Image source="main_example_jpg" alpha="0.5" locked="true" visible="false" />
</e:Skin>
\ No newline at end of file
......@@ -18,6 +18,6 @@
<e:TileLayout horizontalGap="27" verticalGap="10" />
</e:layout>
</e:DataGroup>
<e:Label id="labelNothing" text="完成每日签到可获得道具奖励哦!" x="67" y="339" size="28" visible="false"/>
</e:Group>
<e:Image source="my_props_example_jpg" alpha="0.5" locked="true" visible="false" />
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="WinningPanelSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Skin class="WinningPanelSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Group width="527" height="693" x="112" y="252">
<e:Image scaleX="1" scaleY="1" source="not_winning_bg_png"/>
<e:Image source="winning_score_bg_png" y="208" horizontalCenter="0.5"/>
<e:Label text="本局成绩" x="100" y="232" textColor="0xd1ceff" size="24"/>
<e:Label text="最佳成绩" x="319" y="232" textColor="0xD1CEFF" size="24"/>
<e:Label id="labelScore" text="" y="291" textColor="0xfde750" size="51.68" horizontalCenter="-105.5" bold="true"/>
<e:Label id="labelHighestScore" text="" y="291" size="51.68" bold="true" horizontalCenter="116.5"/>
<e:Label text="差一点就中奖啦\n再接再厉哦~" x="164" y="435" size="30" textAlign="center" lineSpacing="16"/>
<e:Image scaleX="1" scaleY="1" source="not_winning_bg_png" />
<e:Image source="winning_score_bg_png" y="208" horizontalCenter="0.5" />
<e:Label text="本局成绩" x="100" y="232" textColor="0xd1ceff" size="24" />
<e:Label text="最佳成绩" x="319" y="232" textColor="0xD1CEFF" size="24" />
<ns1:MLabel limit="7" id="labelScore" text="" y="291" textColor="0xfde750" size="42" horizontalCenter="-105.5"
bold="true" />
<ns1:MLabel limit="7" id="labelHighestScore" text="" y="291" size="42" bold="true" horizontalCenter="116.5" />
<e:Label text="差一点就中奖啦\n再接再厉哦~" x="164" y="435" size="30" textAlign="center" lineSpacing="16" />
<ns1:MButton id="btnClose" label="" x="483" y="-81" scaleX="1" scaleY="1">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_close_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_close_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRestart" label="" x="90" y="565">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="not_winning_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
<e:Image width="100%" height="100%" source="not_winning_btn_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
</e:Group>
<e:Image alpha="0.5" source="not_winning_example_jpg" locked="true" visible="false"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PropsItem" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Group width="187" height="101" anchorOffsetY="0" anchorOffsetX="0">
<e:Image id="img" x="8.33" y="10" source=""/>
<e:Image id="img" x="8.33" y="10" source="" />
<e:Group x="156" y="2" width="30" height="30">
<e:Image id="cornerMark" source=""/>
<e:Label id="labelNum" text="" size="19.52" horizontalCenter="0" verticalCenter="0" textColor="0xffffff"/>
<e:Image id="cornerMark" source="" />
<e:Label id="labelNum" text="" size="18" horizontalCenter="0" verticalCenter="1" textColor="0xffffff" />
</e:Group>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -2,8 +2,8 @@
<e:Skin class="RankListItem" xmlns:e="http://ns.egret.com/eui" xmlns:ns1="*">
<e:Group width="493.5" height="48.5" anchorOffsetY="0" anchorOffsetX="0">
<e:Image source="rank_separator_png" bottom="0" horizontalCenter="0" />
<e:Group x="32" y="10.5">
<e:Image id="imgRankBg" source="rank_other_rank_bg_png" />
<e:Group x="32" y="10.5" width="28" height="28">
<e:Image id="imgRankBg" source=""/>
<ns1:MLabel id="labelRank" limit="3" text="" size="16.33" textColor="0xb7b3fe" horizontalCenter="0"
verticalCenter="0" />
</e:Group>
......
......@@ -26,7 +26,7 @@
horizontalCenter="-146.5"/>
<ns1:MLabel id="labelMyRank" limit="8" text="" y="304" size="20" textColor="0xD1CEFF" textAlign="left"
horizontalCenter="-7.5"/>
<ns1:MLabel id="labelTopScore" limit="13" text="历史最高:5000" y="304" size="20" textColor="0xD1CEFF"
<ns1:MLabel id="labelTopScore" limit="16" text="" y="304" size="20" textColor="0xD1CEFF"
textAlign="left" left="337" />
<e:Label id="labelLotteryDate" text="" y="624" size="26" horizontalCenter="0" />
<e:Label id="labelWinning" text="" scaleX="1" scaleY="1" textAlign="center" size="30" lineSpacing="15"
......@@ -48,8 +48,9 @@
</e:layout>
</e:List>
</e:Scroller>
<e:Label id="labelSpTIP" text="" y="459" textColor="0xd1ceff" size="20" horizontalCenter="0" visible="false"/>
<e:Scroller x="39" y="680">
<e:DataGroup id="dataGroupReward" width="453.5" height="119" anchorOffsetY="0" anchorOffsetX="0"
<e:DataGroup id="dataGroupReward" width="470" height="119" anchorOffsetY="0" anchorOffsetX="0"
itemRendererSkinName="RankListPanelRewardItem">
<e:layout>
<e:HorizontalLayout gap="44" />
......@@ -57,5 +58,4 @@
</e:DataGroup>
</e:Scroller>
</e:Group>
<e:Image source="rank_example_jpg" alpha="0.5" locked="true" visible="false" />
</e:Skin>
\ No newline at end of file
......@@ -23,6 +23,6 @@
</e:Group>
<e:Image source="rule_example_jpg" x="0" y="0" alpha="0.5" locked="true" visible="false"/>
</e:Skin>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<e:Image id="bgMask" source="select_props_bg_png" scale9Grid="65,133,397,821" height="1018" visible="false" />
<e:Image source="select_props_score_bg_png" y="186" x="22" />
<e:Label text="当前成绩" x="121" y="211" size="36" textColor="0xd1ceff" />
<e:Label id="labelScore" text="" y="206" size="48" bold="true" left="277" />
<ns1:MLabel id="labelScore" limit="7" text="" y="206" size="48" bold="true" left="277" />
<e:Label text="使用道具刷新我的成绩" x="75" y="337" textColor="0xfde750" size="24" />
<e:Image source="main_time_bg_png" x="332" y="294" scaleX="0.86" scaleY="0.86" cacheAsBitmap="true" />
<e:Label id="labelCountDown" text="" textColor="0x4c38a7" size="28" bold="true" horizontalCenter="108.5"
......@@ -31,5 +31,4 @@
<e:Label text="只能使用一种道具,同种道具数量可累加使用!" x="108" y="966" size="16" textColor="0xd6d4f8" />
</e:Group>
</e:Group>
<e:Image source="select_props_example_jpg" alpha="0.5" locked="true" visible="false"/>
</e:Skin>
\ No newline at end of file
......@@ -8,11 +8,11 @@
<e:Image id="imgRevive" source="sign_revive_card_png" x="12.97" y="82.37" visible="false"/>
<e:Group id="scoreCard100" width="93" height="37" x="12.97" y="82.37" visible="false">
<e:Image source="sign_score_card_bg_png" />
<e:Label text="100加分卡" x="12.98" y="11.69" textColor="0xf68d2f" size="15.14" />
<e:Label text="1万加分卡" y="11.69" textColor="0xf68d2f" size="15.14" horizontalCenter="1"/>
</e:Group>
<e:Group id="scoreCard500" width="93" height="37" x="12.97" y="82.37" visible="false">
<e:Image source="sign_score_card_bg_png" />
<e:Label text="500加分卡" x="12.98" y="11.69" textColor="0xF68D2F" size="15.14" />
<e:Label text="5万加分卡" y="11.69" textColor="0xF68D2F" size="15.14" horizontalCenter="1"/>
</e:Group>
</e:Group>
<e:Group id="groupCoin" width="119" height="127" visible="false">
......
......@@ -28,5 +28,4 @@
</e:layout>
</e:DataGroup>
</e:Group>
<e:Image source="sign_example_jpg" alpha="0.5" locked="true" visible="false" />
</e:Skin>
\ No newline at end of file
......@@ -23,5 +23,4 @@
</ns1:skinName>
</ns1:MButton>
</e:Group>
<e:Image source="sign_success_example_jpg" alpha="0.5" visible="false" />
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="SpUserPanelSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Group width="527" height="701" x="113" y="251">
<e:Image id="light" source="panel_light_png" x="277" y="301" anchorOffsetX="393" anchorOffsetY="398"/>
<e:Image source="sp_user_bg_png"/>
<ns1:MButton id="btn" label="" y="577" x="89">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="sp_user_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnClose" label="" x="481" y="-127" scaleX="1" scaleY="1">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_close_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="StartScene" width="750" height="1624" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Group width="750" height="1624">
<e:Image source="start_bg_jpg" />
<e:Button id="btnShare" label="" y="54" x="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_share_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btnReward" label="" y="138" left="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_my_reward_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btnProps" label="" y="114" right="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_my_props_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</e:skinName>
</e:Button>
<ns1:MButton id="btnMusic" label="" x="681" y="28">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_music_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<e:Image source="start_title_png" x="141" y="225" locked="true" />
<ns1:MButton id="btnStart" label="" y="618" x="154">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_start_png" />
<e:Label id="labelStartShadow" text="开始游戏" size="54" horizontalCenter="-4" verticalCenter="3"
textColor="0xf25e3e" alpha="0.5" bold="true" />
<e:Label id="labelStart" text="开始游戏" size="54" horizontalCenter="0" verticalCenter="0" bold="true" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnSignIn" label="" x="153" y="744">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_sign_in_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRule" label="" x="84" y="984">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_rule_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnTask" label="" x="309" y="984">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_task_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRankList" label="" x="534" y="983">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_rank_list_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
</e:Group>
<e:Image source="start_example_jpg" alpha="0.5" locked="true" visible="false"/>
<e:Group width="750" height="1624" locked="true">
<e:Image source="start_bg_jpg"/>
<e:Button id="btnShare" label="" y="54" x="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_share_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btnReward" label="" y="138" left="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_my_reward_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="btnProps" label="" y="114" right="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_my_props_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:ToggleButton id="btnMusic" label="" x="681" y="28">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_music_disabled_png" source.down="start_btn_music_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:ToggleButton>
<e:Image source="start_title_png" x="141" y="225" locked="true"/>
<ns1:MButton id="btnStart" label="" y="618" x="154">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_start_png"/>
<e:Label id="labelStartShadow" text="开始游戏" size="54" horizontalCenter="-4" verticalCenter="3" textColor="0xf25e3e" alpha="0.5" bold="true"/>
<e:Label id="labelStart" text="开始游戏" size="54" horizontalCenter="0" verticalCenter="0" bold="true"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnSignIn" label="" x="153" y="744">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_sign_in_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRule" label="" x="84" y="984">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_rule_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnTask" label="" x="309" y="984">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_task_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
<ns1:MButton id="btnRankList" label="" x="534" y="983">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="start_btn_rank_list_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</ns1:skinName>
</ns1:MButton>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -23,5 +23,4 @@
</ns1:skinName>
</ns1:MButton>
</e:Group>
<e:Image source="task_example_jpg" alpha="0.5" visible="false"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="WinningPanelSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Skin class="WinningPanelSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<e:Group width="591" height="800" x="79" y="251">
<e:Image source="winning_bg_png" scaleX="1" scaleY="1"/>
<e:Image source="winning_score_bg_png" y="208" horizontalCenter="0.5"/>
<e:Label text="本局成绩" x="132" y="232" textColor="0xd1ceff" size="24"/>
<e:Label text="最佳成绩" x="352" y="232" textColor="0xD1CEFF" size="24"/>
<e:Label id="labelScore" text="" y="291" textColor="0xfde750" size="51.68" horizontalCenter="-105" bold="true"/>
<e:Label id="labelHighestScore" text="" y="291" size="51.68" bold="true" horizontalCenter="116.5"/>
<e:Image id="imgReward" y="407" x="171" width="250" height="240" source=""/>
<e:Label id="labelCoinNum" text="" y="681" size="30" horizontalCenter="0"/>
<e:Label text="请在您的账户中查看哦~" x="137" y="725" size="30"/>
<e:Image source="winning_bg_png" scaleX="1" scaleY="1" />
<e:Image source="winning_score_bg_png" y="208" horizontalCenter="0.5" />
<e:Label text="本局成绩" x="132" y="232" textColor="0xd1ceff" size="24" />
<e:Label text="最佳成绩" x="352" y="232" textColor="0xD1CEFF" size="24" />
<ns1:MLabel id="labelScore" limit="7" text="" y="291" textColor="0xfde750" size="42" horizontalCenter="-107"
bold="true" />
<ns1:MLabel id="labelHighestScore" limit="7" text="" y="291" size="42" bold="true" horizontalCenter="115" />
<e:Image id="imgReward" y="407" x="171" width="250" height="240" source="" />
<e:Label id="labelCoinNum" text="" y="681" size="30" horizontalCenter="0" />
<e:Label text="请在您的账户中查看哦~" x="137" y="725" size="30" />
<ns1:MButton id="btnClose" label="" x="510" y="-84" scaleX="1" scaleY="1">
<ns1:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_close_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="btn_close_png" />
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" />
</e:Skin>
</ns1:skinName>
</ns1:MButton>
</e:Group>
<e:Image source="winning_example_jpg" alpha="0.5" locked="true" visible="false"/>
</e:Skin>
\ No newline at end of file
......@@ -17,7 +17,9 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
'main_star_an.png',
"ant_die.png",
"eat_gold_coin.png",
"leg_trample.png"
"leg_trample.png",
"duang.png",
"nums_res.png"
];
if (excludes.indexOf(file.basename) != -1) {
return file;
......
......@@ -12,9 +12,9 @@ declare interface Math {
}
declare namespace egret {
namespace Timer {
/* namespace Timer {
const deltaTime: number;
}
} */
interface EventDispatcher {
onTap(target: any, callback: () => void): void;
......
import ComponentBase from "../Components/ComponentBase";
import SpTimer from "../Game/SpTimer";
function setPropertyDecorator(target: ComponentBase, name: string, callback: (context: ComponentBase) => void) {
if (!target["decoratorCallback"]) {
......@@ -39,7 +40,7 @@ export namespace Decorator {
this["onUpdate"] = this["onUpdate"] || (() => { });
this["onLoad"] = this["onLoad"] || (() => { });
let onUpdateCallback = () => this["onUpdate"](egret.Timer.deltaTime);
let onUpdateCallback = () => this["onUpdate"](SpTimer.deltaTime);
this["addEventListener"](egret.Event.ENTER_FRAME, onUpdateCallback, this);
this["addEventListener"](egret.Event.ADDED_TO_STAGE, this["onLoad"], this);
this["addEventListener"](egret.Event.REMOVED_FROM_STAGE, () => {
......@@ -78,7 +79,7 @@ export namespace Decorator {
constructor(...arg: any[]) {
super(...arg);
this["onUpdate"] = this["onUpdate"] || (() => { });
let onUpdateCallback = () => this["onUpdate"](egret.Timer.deltaTime);
let onUpdateCallback = () => this["onUpdate"](SpTimer.deltaTime);
this["addEventListener"](egret.Event.ENTER_FRAME, onUpdateCallback, this);
this["addEventListener"](egret.Event.REMOVED_FROM_STAGE, () => {
......
......@@ -2,7 +2,7 @@ import { PoolElement } from "../Components/Pool";
import MoveObjcet from "./MoveObject";
import { MConst } from "../Global/MConst";
import GameObject from "./GameObject";
import Collider, { CircleCollider, ColliderGroup } from "./Collider";
import Collider, { CircleCollider, ColliderGroup, PointCollider } from "./Collider";
import ParticleMgr from "../Mgr/ParticleMgr";
import MainScene from "../Scene/MainScene";
......@@ -14,9 +14,9 @@ export default class Bullet extends MoveObjcet implements PoolElement {
this.addChild(new egret.Bitmap(RES.getRes("bullet_png")));
this.anchorY = 0;
let collider = this.addComponent(CircleCollider) as CircleCollider;
let collider = this.addComponent(PointCollider) as PointCollider;
collider.group = ColliderGroup.Bullet;
collider.setData(6, 9, 5);
collider.setData(2, 0);
this.physics.velocity.y = -MConst.BulletSpeedValue;
}
......@@ -35,7 +35,7 @@ export default class Bullet extends MoveObjcet implements PoolElement {
}
onCollisionEnter(other: Collider) {
if (other.group == ColliderGroup.Ball) {
if (other.group == ColliderGroup.Ball || other.group == ColliderGroup.Top) {
this.context.bulletPool.destroy(this);
}
}
......
......@@ -12,6 +12,7 @@ import Bullet from "./Bullet";
import MTweenMgr from "../components/MTween";
import GameMgr from "../Mgr/GameMgr";
import SoundMgr from "../Mgr/SoundMgr";
import SpTimer from "./SpTimer";
@Decorator.OnDestroy
export default class Car extends GameObject implements Decorator.IDefaultCallback {
......@@ -19,23 +20,26 @@ export default class Car extends GameObject implements Decorator.IDefaultCallbac
private imgParticel: egret.Bitmap = null;
private fireTimer: number = null;
private fireBulletNumConfigIndex: 0 | 1 = 0;
public touchWall: 1 | -1 | 0 = 0;
private invincibleDuration = 0;
constructor(context: MainScene) {
super(context);
this.x = 124;
this.y = 145;
this.createPart("car_shadow_png", 4.96, 136.69);
this.createPart("car_shadow_png", 4.96, 138.69);
this.createPart("car_part_0_png", 12.5, 102.5);
this.imgGun = this.createPart("car_gun_png", 33.5, 120);
this.createPart("car_wheel_png", 0, 97.5);
this.imgParticel = this.createPart("car_particle_png", 15.98, 1.33);
this.imgParticel.alpha = 0;
// this.imgParticel.alpha = 0;
this.imgGun.anchorOffsetY = 100;
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
let collider = this.addComponent<RectCollider>(RectCollider);
collider.setData(29, 20, 63, 121);
collider.setData(29, 20, 63, 150);
collider.group = ColliderGroup.Car;
}
......@@ -48,29 +52,91 @@ export default class Car extends GameObject implements Decorator.IDefaultCallbac
}
private fire() {
this.playFireEffect();
SoundMgr.instance.playEffect("shoot_mp3");
let column = this.context.fireBulletNumConfig[this.fireBulletNumConfigIndex];
this.fireBulletNumConfigIndex = this.fireBulletNumConfigIndex == 0 ? 1 : 0; //0/1交替
// let column = this.context.fireBulletNumConfig[this.fireBulletNumConfigIndex];
// this.fireBulletNumConfigIndex = this.fireBulletNumConfigIndex == 0 ? 1 : 0; //0/1交替
const column = this.context.fireBulletNumConfig;
const numb = MConst.BulletDisperseFrameNum;
let bullets: Bullet[] = [];
for (let i = 0; i < column; i++) {
const power = Math.floor(this.context.powerScore / 100);
const bullet = this.context.bulletPool.create(this.context).init(power);
const bullet = this.context.bulletPool.create(this.context).init(Math.floor(this.context.powerScore / 100));
bullet.posY = this.posY - this.height + 26;
bullet.posX = this.posX;
let offsetX = (i - (column - 1) / 2) * MConst.BulletWidth;
bullet.physics.velocity.x = offsetX / MConst.BulletDisperseFrameNum;
MTweenMgr.instance.get(bullet).wait(MConst.BulletDisperseFrameNum, true).call(() => {
bullet.physics.velocity.x = offsetX / numb;
/* MTweenMgr.instance.get(bullet).wait(MConst.BulletDisperseFrameNum, true).call(() => {
bullet.physics.velocity.x = 0;
});
}); */
bullets.push(bullet);
}
SpTimer.set(numb, () => {
for (let i of bullets) {
i.physics.velocity.x = 0;
}
});
}
onCollisionEnter(other: Collider) {
if (other.group == ColliderGroup.Ball) {
this.die();
if (this.invincibleDuration <= 0) {
this.die();
}
}
if (other.group == ColliderGroup.Wall) {
this.touchWall = other.owner.x < 0 ? 1 : -1;
}
}
onCollisionStay(other: Collider) {
if (other.group == ColliderGroup.Ball) {
if (this.invincibleDuration <= 0) {
this.die();
}
}
if (other.group == ColliderGroup.Wall) {
this.touchWall = other.owner.x < 0 ? 1 : -1;
}
}
private onceBlink() {
MTweenMgr.instance.get(this)
.to({ alpha: 0 }, 1, true)
.wait(2)
.to({ alpha: 1 }, 1, true)
.wait(2)
.call(() => { this.onceBlink(); });
}
revive() {
this.invincibleDuration = MConst.ReviveInvincibleDuration * 1000;
MTweenMgr.instance.removeTweens(this);
this.onceBlink();
SpTimer.set(MConst.ReviveInvincibleDuration * 60, () => {
//无敌结束
this.alpha = 1;
MTweenMgr.instance.removeTweens(this);
});
}
move(deltaX: number) {
if (this.touchWall == 1 && deltaX <= 0) {
return;
} else if (this.touchWall == -1 && deltaX >= 0) {
return;
}
this.x += deltaX;
}
onCollisionExit(other: Collider) {
if (other.group == ColliderGroup.Wall) {
this.touchWall = 0;
}
}
......@@ -78,27 +144,34 @@ export default class Car extends GameObject implements Decorator.IDefaultCallbac
this.context.gameOver();
}
private playFireEffect() {
this.imgParticel.alpha = 1;
this.imgGun.scaleY = 0.8;
egret.Tween.removeTweens(this.imgParticel);
egret.Tween.removeTweens(this.imgGun);
egret.Tween.get(this.imgParticel).to({ alpha: 0 }, 100);
egret.Tween.get(this.imgGun).to({ scaleY: 1 }, 100);
}
private frameTimer = 0;
private fired = false;
private onEnterFrame() {
if (GameMgr.instance.pause) return;
this.fireTimer += egret.Timer.deltaTime;
if (this.invincibleDuration > 0) {
this.invincibleDuration -= SpTimer.deltaTime;
}
if (this.fireTimer >= 1000 / this.context.fireSpeed) {
this.fireTimer += 1;
if (this.fireTimer >= 60 / this.context.fireSpeed) {
if (!this.fired) {
this.fired = true;
}
this.fire();
this.fireTimer = 0;
}
if (this.frameTimer % 3 == 0) {
this.imgParticel.visible = !this.imgParticel.visible;
}
this.frameTimer++;
}
onDestroy() {
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
MTweenMgr.instance.removeTweens(this);
}
}
\ No newline at end of file
......@@ -5,15 +5,29 @@ import Physics from "./Physics";
export default abstract class Collider extends GameComponent {
public physics: Physics = null;
public group: ColliderGroup = ColliderGroup.None;
private _group: ColliderGroup = null;
set group(group: ColliderGroup) {
if (this._group == null) {
this._group = group;
PhycicsSystem.instance.addCollider(this);
} else {
this._group = group;
}
}
get group() {
return this._group;
}
public type: ColliderType = null;
setData(...ags: any[]): void {
this.physics && this.physics.onColliderResize(this);
}
onEnabled() {
PhycicsSystem.instance.addCollider(this);
//自动设置物理组件
if (this.group)
PhycicsSystem.instance.addCollider(this);
let physics = this.owner.getComponent<Physics>(Physics);
if (physics) {
this.physics = physics;
......@@ -21,17 +35,21 @@ export default abstract class Collider extends GameComponent {
}
}
protected worldPos: egret.Point = new egret.Point();
abstract getWorldPosition(out: number[]): void;
onDisabled() {
PhycicsSystem.instance.removeCollider(this);
}
/**获取碰撞器的中心的节点坐标 */
abstract getCenter(): egret.Point;
abstract getCenter(): number[];
}
export class CircleCollider extends Collider {
public radius: number = 0
public center: egret.Point = new egret.Point();
public center: number[] = []
constructor(owner: GameObject) {
super(owner);
this.type = ColliderType.Circle;
......@@ -39,14 +57,23 @@ export class CircleCollider extends Collider {
setData(x: number, y: number, radius: number) {
this.radius = radius;
this.center.x = x;
this.center.y = y;
this.center[0] = x;
this.center[1] = y;
super.setData();
}
getCenter() {
return this.center;
}
private t = {
x: 0,
y: 0
};
getWorldPosition(out: number[]) {
out[0] = this.owner.x - this.owner.anchorOffsetX + this.center[0];
out[1] = this.owner.y - this.owner.anchorOffsetY + this.center[1];
}
}
export class RectCollider extends Collider {
......@@ -66,21 +93,51 @@ export class RectCollider extends Collider {
}
getCenter() {
return new egret.Point(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
return [this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2];
}
getWorldPosition(out: number[]) {
out[0] = this.owner.x - this.owner.anchorOffsetX + this.rect.topLeft.x;
out[1] = this.owner.y - this.owner.anchorOffsetY + this.rect.topLeft.y;
}
}
export class PointCollider extends Collider {
public center: number[] = [];
constructor(owner: GameObject) {
super(owner);
this.type = ColliderType.Point;
}
setData(x: number, y: number) {
this.center[0] = x;
this.center[1] = y;
super.setData();
}
getCenter() {
return this.center;
}
getWorldPosition(out: number[]) {
let owner = this.owner;
out[0] = this.owner.x + this.center[0];
out[1] = this.owner.y + this.center[1];
}
}
export enum ColliderGroup {
None,
Ball,
Bullet,
Wall,
Ground,
Drop,
Car
None = 0,
Ball = 1,
Bullet = 2,
Wall = 3,
Ground = 4,
Drop = 5,
Car = 6,
Top = 7
}
export enum ColliderType {
Circle,
Rect
}
\ No newline at end of file
Rect,
Point
}
import MoveObjcet from "./MoveObject";
import { MConfigs } from "../Global/MConfigs";
import MainScene from "../Scene/MainScene";
import Collider, { CircleCollider, ColliderGroup } from "./Collider";
import Collider, { CircleCollider, ColliderGroup, PointCollider } from "./Collider";
import { PoolElement } from "../Components/Pool";
import MTweenMgr from "../components/MTween";
import SoundMgr from "../Mgr/SoundMgr";
import DropBlinkMgr from "../Mgr/DropMgr";
export default class Drop extends MoveObjcet implements PoolElement {
export default class Drop extends MoveObjcet {
private type: string = null;
private label: eui.Label = null;
public bitmap: egret.Bitmap = null;
private scoreValue: number = null;
private collider: CircleCollider = null;
private collider: PointCollider = null;
private isGround: boolean = false;
private stayGroundCount = 0;
......@@ -27,10 +28,8 @@ export default class Drop extends MoveObjcet implements PoolElement {
label.size = 24;
this.addChild(label);
this.label = label;
this.collider = this.addComponent<CircleCollider>(CircleCollider);
this.collider = this.addComponent<PointCollider>(PointCollider);
this.collider.group = ColliderGroup.Drop;
this.cacheAsBitmap = true;
}
init(id: number) {
......@@ -57,26 +56,18 @@ export default class Drop extends MoveObjcet implements PoolElement {
label.x = texture.textureWidth + 2;
label.y = texture.textureHeight / 2 - label.height / 2;
this.collider.setData(texture.textureWidth / 2, texture.textureHeight / 2, texture.textureWidth / 2);
let onceBlink = () => {
MTweenMgr.instance.get(this).to({ alpha: 0 }, 2, true).to({ alpha: 1 }, 2, true).call(onceBlink);
};
MTweenMgr.instance.get(this).wait(3000, false).call(onceBlink);
MTweenMgr.instance.get(this).wait(5000, false).call(() => {
MTweenMgr.instance.removeTweens(this);
this.context.dropPool.destroy(this)
});
this.collider.setData(texture.textureWidth / 2, texture.textureHeight / 2);
return this;
}
private eated() {
SoundMgr.instance.playEffect("collect_mp3");
this.physics.rotateVelocity = 0;
DropBlinkMgr.instance.remove(this);
this.visible = true;
this.rotation = 0;
this.physics.enabled = false;
this.getComponent(CircleCollider).enabled = false;
this.getComponent(PointCollider).enabled = false;
this.label.visible = true;
if (this.type == "bullet") {
this.context.bulletScore += this.scoreValue;
......@@ -99,7 +90,7 @@ export default class Drop extends MoveObjcet implements PoolElement {
if (other.group == ColliderGroup.Ground && !this.isGround) {
this.stayGroundCount = 0;
this.physics.velocity.y = -(this.physics.velocity.y * 0.5);
this.physics.velocity.y = -(this.physics.velocity.y * 0.4);
}
if (other.group == ColliderGroup.Wall) {
......@@ -118,9 +109,9 @@ export default class Drop extends MoveObjcet implements PoolElement {
this.physics.velocity.y = 0;
this.physics.acceleration.y = 0;
this.physics.velocity.x *= 0.5;
DropBlinkMgr.instance.add(this);
let radius = (this.physics.collider as CircleCollider).radius;
this.physics.rotateVelocity = this.physics.velocity.x * (180 / (Math.PI * radius));
this.physics.rotateVelocity = this.physics.velocity.x * (180 / (Math.PI * 13));
}
}
}
......@@ -131,7 +122,12 @@ export default class Drop extends MoveObjcet implements PoolElement {
}
}
onElementInit() {
/* destroy() {
DropBlinkMgr.instance.remove(this);
super.destroy();
} */
/* onElementInit() {
this.alpha = 1;
this.visible = true;
this.stayGroundCount = 0;
......@@ -142,5 +138,5 @@ export default class Drop extends MoveObjcet implements PoolElement {
onElementRecycle() {
this.visible = false;
this.disableAllComponents();
}
} */
}
\ No newline at end of file
......@@ -54,7 +54,12 @@ export default class GameObject extends egret.DisplayObjectContainer {
this.touchEnabled = false;
this.touchChildren = false;
this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.disableAllComponents, this);
// this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.disableAllComponents, this);
}
public destroy() {
this.disableAllComponents();
super.destroy();
}
/**锚点X轴 */
......
This diff is collapsed.
......@@ -27,14 +27,15 @@ export default class Physics extends GameComponent {
}
public _collider: Collider = null;
public onMoved = new MEvent<(owner: GameObject, remove: () => void) => void>();
public onMoved: (owner: GameObject) => void;
public onFixedUpdate() {
this.velocity.x += this.acceleration.x;
this.velocity.y += this.acceleration.y;
if (this.velocity.length > 0) {
this.moveTo(this.owner.position.add(this.velocity));
}
this.owner.x += this.velocity.x;
this.owner.y += this.velocity.y;
this.onMoved && this.onMoved(this.owner);
//旋转
if (this.rotateVelocity != 0) {
......@@ -55,7 +56,7 @@ export default class Physics extends GameComponent {
this.owner.y = x.y;
}
this.onMoved.call(this.owner);
this.onMoved && this.onMoved(this.owner);
}
protected onDisabled() {
......@@ -67,7 +68,7 @@ export default class Physics extends GameComponent {
public onColliderResize(collider: Collider) {
let center = collider.getCenter();
this.owner.anchorOffsetX = center.x;
this.owner.anchorOffsetY = center.y;
this.owner.anchorOffsetX = center[0];
this.owner.anchorOffsetY = center[1];
}
}
\ No newline at end of file
export default class MTimer {
export default class SpTimer {
private static onFrameList: ((dt: number, self: Function) => void)[] = [];
private static timerList: ((self: Function) => void)[] = [];
public static deltaTime: number = 0;
public static init() {
egret.MainContext.instance.stage.addEventListener(egret.Event.ENTER_FRAME, () => {
for (let i = 0; i < MTimer.onFrameList.length; i++) {
MTimer.onFrameList[i](egret.Timer.deltaTime, MTimer.onFrameList[i]);
for (let i = 0; i < SpTimer.onFrameList.length; i++) {
SpTimer.onFrameList[i](SpTimer.deltaTime, SpTimer.onFrameList[i]);
}
for (let i = 0; i < SpTimer.timerList.length; i++) {
SpTimer.timerList[i](SpTimer.timerList[i]);
}
}, MTimer);
}, SpTimer);
}
private static onFrameList: ((dt: number, self: Function) => void)[] = [];
private static removeOnFrame(callback: Function) {
MTimer.onFrameList = MTimer.onFrameList.filter(e => e != callback);
SpTimer.onFrameList = SpTimer.onFrameList.filter(e => e != callback);
}
/* private timerObjectList: MTimerObject[] = [];
private context: egret.EventDispatcher = null; */
/* constructor(context: egret.EventDispatcher) {
context.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onDestroy, this);
this.context = context;
} */
/**
*
* @param time 每次计时间隔 单位毫秒
* @param onTimeOut 每次时间到时的回调函数
* @param repeat 重复计时次数 默认为1
* @param onRepeated 所有计时完成时的回调函数
*/
/* public static set(time: number, onTimeOut: () => void, repeat?: number, onRepeated?: () => void): MTimerObject {
let timer = new MTimerObject(time, onTimeOut, repeat, () => {
onRepeated && onRepeated();
//执行完毕,在列表中删除自身
this.timerObjectList.splice(this.timerObjectList.indexOf(timer), 1);
public static set(frame: number, onTimeOut: () => void) {
let count = 0;
SpTimer.timerList.push((self: Function) => {
count++;
if (count >= frame) {
onTimeOut();
SpTimer.timerList = SpTimer.timerList.filter(e => e != self);
}
});
this.timerObjectList.push(timer);
return timer;
} */
}
public static onFrame(callback: (deltaTime: number, remove?: () => void) => void, frameCount?: number) {
if (typeof frameCount != "undefined") {
let count = 0;
MTimer.onFrameList.push((deltaTime: number, self: Function) => {
SpTimer.onFrameList.push((deltaTime: number, self: Function) => {
callback(deltaTime);
count++;
if (count >= frameCount) {
MTimer.removeOnFrame(self);
SpTimer.removeOnFrame(self);
}
});
} else {
MTimer.onFrameList.push((deltaTime: number, self: Function) => {
SpTimer.onFrameList.push((deltaTime: number, self: Function) => {
callback(deltaTime, () => {
MTimer.removeOnFrame(self);
SpTimer.removeOnFrame(self);
});
});
}
}
/* public static delay(time: number): Promise<void> {
return new Promise<void>(resolve => {
this.set(time, () => {
resolve();
});
});
} */
/* private onDestroy() {
this.timerObjectList.forEach(e => e.destroy());
this.timerObjectList = null;
} */
}
......
This diff is collapsed.
import { MUtils } from "./MUtils";
import { MConfigs } from "./MConfigs";
export const getResPath = () => window['resPath'] || '';
export const getSkinPath = (key: any) => `resource/skins/${key}Skin.exml`
......@@ -30,8 +31,8 @@ export function clearShareImg() {
export function getBallScore(bulletScore: number, powerScore: number, colorIndex: number): any {
let getScoreFromRange = ([a, b]) => {
a = Math.ceil(a * 0.5);
b = Math.ceil(b) * 0.5;
a = Math.ceil(a * MConfigs.difficultyFactor);
b = Math.ceil(b * MConfigs.difficultyFactor);
let n = Math.abs(b - a) + 1;
n = Math.floor(n / 6);
const m = [];
......@@ -113,3 +114,13 @@ export function getProp(items: any[], props: number[], n = 1) {
}
return result;
}
export function arrayRemove(array: any[], target: any): any[] {
let newArray = [];
for (let i = 0; i < array.length; i++) {
if (array[i] !== target) {
newArray.push(array[i]);
}
}
return newArray;
}
\ No newline at end of file
// export const MConfigs: any = window;
export namespace MConfigs {
export function updateConfig() {
let mconfig = window["mconfig"];
if (typeof mconfig != "object") return;
Object.keys(mconfig).forEach(e => {
MConfigs[e] = mconfig[e];
});
}
export const size = [0.3125, 0.5357, 0.7321, 1];
export const drop = {
0: {
......@@ -80,7 +89,7 @@ export namespace MConfigs {
"sp_1": {
index: 0,
id: "sp_1",
name: "100分加分卡",
name: "1分加分卡",
img: "score_card_100_png",
disabledImg: null,
color: 0xf9b74b
......@@ -88,12 +97,12 @@ export namespace MConfigs {
"sp_2": {
index: 1,
id: "sp_2",
name: "500分加分卡",
name: "5分加分卡",
img: "score_card_500_png",
disabledImg: null,
color: 0xfe93df
},
"sp_11": {
"sp_3": {
index: 2,
id: "sp_11",
name: "复活卡",
......@@ -120,23 +129,77 @@ export namespace MConfigs {
[key: string]: {
taskCode: string,
content: string,
btnText: string
url: string
}
} = {
"aaa": {
taskCode: "aaa",
content: "去签到领金币\n获得一次游戏机会",
btnText: "去签到"
"1": {
taskCode: "1",
content: "去完成签到领金币\n获得1次游戏机会",
url: "https://b.pingan.com.cn/mkt/koudai/koudaijin/index.html?Source=dxqrw&outersource=yqs_201908&channel_source=1"
},
"2":
{
taskCode: "2",
content: "去做任务攒爱心\n获得1次游戏机会",
url: "https://b.pingan.com.cn/mkt/koudai/kdgongyi/index.html?campaignid=201906006149&innerid=QMDXQ&channel_source=50"
},
"bbb": {
taskCode: "bbb",
content: "去下载x应用\n获得一次游戏机会",
btnText: "去下载"
"3": {
taskCode: "3",
content: "去浏览会员任务首页\n获得1次游戏机会",
url: "https://b.pingan.com.cn/platform/member-system/index.html?innerid=daxingqiu"
},
"ccc": {
taskCode: "ccc",
content: "去健康运动完成打卡\n获得一次游戏机会",
btnText: "去下载"
"4":
{
taskCode: "4",
content: "去邀请新用户参与活动\n获得1次游戏机会",
url: "https://b.pingan.com.cn/mkt/youhui/1909/domgmyqh/index.shtml?campaignid=201909007503&innerid=KDAPP-GD-YX"
},
"5": {
taskCode: "5",
content: "去参与28会员日活动\n获得1次游戏机会",
url: "https://b.pingan.com.cn/kuaizhan/page/brop/opt/20191021/h11456.html?campaignid=201910007967&source=daxingqiu"
}
}
export const guide: {
[key: number]: {
mask: string,
text: {
str: string,
offsetToMask: {
x: number,
y: number
}
},
arrow: boolean
}
} = {
0: {
mask: "guide_mask_0_png",
text: {
str: "左右移动炮车进行设计和躲避",
offsetToMask: {
x: -34,
y: 270
}
},
arrow: true
},
1: {
mask: "guide_mask_1_png",
text: {
str: "拾取金币可获得更多的炮弹输出和得分加成",
offsetToMask: {
x: -55,
y: 394
}
},
arrow: false
},
}
export const difficultyFactor = 0.5;
export const rewardRecordUrl = "http://activity.m.duibatest.com.cn/projectx/p98a3fa4c/f09ba186f.html";
export const rule = "";
}
\ No newline at end of file
......@@ -11,9 +11,9 @@ export namespace MConst {
min: 10,
max: 20
}
export const Gravity = 0.15;
export const Gravity = 0.2;
export const BallVelocityX = 2;
export const BallVelocityY = 12;
export const BallVelocityY = 13;
export const BallSplitVelocityY = 6.8;
export const DropVelocityX = {
x: 2,
......@@ -22,15 +22,26 @@ export namespace MConst {
export const BallRotateSpeed = 0.7;
export const BulletWidth = 14;
export const BulletDisperseFrameNum = 4;
export const BallInitPosY = 1206 * 0.25;
export const BallInitPosY = 1206 * 0.35;
export const CreateBallInterval = 1000;
export const ReviveCardId = "sp_11";
export const ReviveCardId = "sp_3";
export const ConstantSubmitScoreNum = 100;
export const ConstantSubmitScoreNum = 30000;
export const DefaultBallWidth = 224;
export const DefaultRingWidth = 672 * 0.744;
export const DefaultStarSize = {
width: 76 * 0.744,
height: 72 * 0.744
};
}
\ No newline at end of file
export const captchaId = "a869bfdfb9bd4cdf88e1ff2f8667a114";
export const BallVelocityXRandomFactor = 0.1;
export const BallVelocityYRandomFactor = 0.08;
export const DropRandomFactor = 0.07;
export const Md5ConstStr = "dui88";
/**
* 单位:秒
*/
export const ReviveInvincibleDuration = 3;
}
......@@ -5,16 +5,38 @@ import Loading from "../Loading/Loading";
import SceneCtrl from "../Ctrls/SceneCtrl";
import StartScene from "../Scene/StartScene";
import PanelCtrl from "../Ctrls/PanelCtrl";
import { NetUtils } from "./NetUtils";
const projectId = NetUtils.getProjectId();
export default class Net {
public static cache: object = {};
/**
*
* @param uri URL
* @param param 参数
* @param onSuccess 返回成功时的回调
* @param onFail 返回失败是的回调 | 是否使用默认失败回调函数
* @param pollingCheck 每次轮询回调
* @param pollingCount 轮询最大次数
*/
public static sendGet(uri: string, param: any, onSuccess: (res: any) => void, onFail?: ((res: any) => any) | boolean, pollingCheck?: (res: any) => boolean, pollingCount?: number) {
this.mSend("get", uri, param, onSuccess, onFail, pollingCheck, pollingCount);
}
/**
*
* @param uri URL
* @param param 参数
* @param onSuccess 返回成功时的回调
* @param onFail 返回失败是的回调 | 是否使用默认失败回调函数
* @param pollingCheck 每次轮询回调
* @param pollingCount 轮询最大次数
*/
public static sendPost(uri: string, param: any, onSuccess: (res: any) => void, onFail?: ((res: any) => any) | boolean, pollingCheck?: (res: any) => boolean, pollingCount?: number) {
this.mSend("post", uri, param, onSuccess, onFail, pollingCheck, pollingCount);
}
private static mSend(type: string, uri: string, param: any, onSuccess: (res: any) => void, onFail?: ((res: any) => any) | boolean, pollingCheck?: (res: any) => boolean, pollingCount?: number) {
if (pollingCheck) {
Loading.instace.show();
......@@ -22,7 +44,7 @@ export default class Net {
NetManager.ins.send({
name: uri,
uri: Net.urlReplace(uri),
uri: uri,
type: type,
dataType: 'json',
param: param,
......@@ -71,23 +93,22 @@ export default class Net {
console.log("requset", uri, param);
}
private static defaultOnFail: (res: any) => void = () => {
public static defaultOnFail: (res: any) => void = () => {
SceneCtrl.instance.change(StartScene);
PanelCtrl.instance.closeAll();
Loading.instace.hide();
}
private static urlReplace(url: string) {
Object.keys(Net.urlReplaceConfig).forEach(key => {
url = url.replace(new RegExp(key, "g"), Net.urlReplaceConfig[key]);
});
return url;
public static urlReplace() {
for (let i of Object.keys(Net.Url)) {
for (let j of Object.keys(Net.urlReplaceConfig)) {
Net.Url[i] = Net.Url[i].replace(new RegExp(j, "g"), Net.urlReplaceConfig[j]);
}
}
}
private static urlReplaceConfig = {
"{projectId}": function () {
return "projectId"; //TODO
}
"{projectId}": projectId
}
public static readonly Url = {
......@@ -99,7 +120,7 @@ export default class Net {
revive: "/projectx/{projectId}/scoring_1/revive.do",
constantSubmit: "/projectx/{projectId}/scoring_1/push.do",
rankList: "/projectx/{projectId}/join_3/data.do",
queryRankListData: "/{projectId}/getRanking.query",
queryRankListData: "/projectx/{projectId}/getRanking.query",
queryNickname: "/projectx/{projectId}/join_3/userInfoList.do",
visit: "/projectx/{projectId}/scoring_1/visit.do",
taskData: "/projectx/{projectId}/join_2/data.do",
......
......@@ -40,25 +40,8 @@ export namespace NetUtils {
}, onSuccess, onFail);
}
function doBuried(appIdParam: string, netManager: NetManager, callback: string) {
//初始化埋点数据
Buried.init();
var appId = NetUtils.getCFG()["appId"];
var oaId = NetUtils.getCFG()["appId"];
let data = Buried.createExposure(appId + `.110.${appIdParam}.1`, `202.${oaId}.0.0`);
netManager[callback](data);
console.log("exposure", data);
}
export function doClickBuried(appIdParam: string) {
doBuried(appIdParam, NetManager.ins, "clickLog");
}
export function doShowBuried(appIdParam: string) {
doBuried(appIdParam, NetManager.ins, "showLog");
}
export function encryptSeq(seq: number) {
return 5 * seq - MUtils.random(0, 4);
return Math.round(5 * seq - MUtils.random(0, 4));
}
export function md5(str: string) {
......@@ -71,4 +54,17 @@ export namespace NetUtils {
export function getCFG(): object {
return window['CFG'];
}
const projectxString = "projectx/";
export function getProjectId(): string {
let windowUrl = window.location.href;
let splitArr = windowUrl.split(projectxString);
if (splitArr.length != 2) {
return "projectId"
}
let start = windowUrl.indexOf(projectxString) + projectxString.length;
let end = splitArr[1].indexOf("/");
return windowUrl.substr(start, end);
}
}
\ No newline at end of file
......@@ -5,10 +5,22 @@ class MLabel extends eui.Label implements eui.UIComponent {
v = v.toString();
if (typeof v == "undefined") return;
let postfixPos = v.indexOf("/e");
let postfix = "";
if (postfixPos != -1) {
const split = v.split("/e");
v = split[0];
postfix = split[1];
}
if (typeof this.limit == "number" && typeof v == "string" && this.getRealLength(v) > this.limit) {
v = this.cutString(v, this.limit) + "...";
v = this.cutString(v, this.limit - 2) + "...";
}
super.$setText(v);
super.$setText(v + postfix);
}
public setPostfix(str: string) {
super.$setText(super.$getText() + str);
}
private getRealLength(str: string) {
......
......@@ -14,12 +14,16 @@ import MButton from "./MUI/MButton";
import Net from "./Global/Net";
import MainScene from "./Scene/MainScene";
import StartScene from "./Scene/StartScene";
import MTimer from "./components/MTimer";
import MTweenMgr from "./components/MTween";
import PhycicsSystem from "./Game/PhycicsSystem";
import Ball from "./Global/Ball";
import { NetUtils } from "./Global/NetUtils";
import MLabel from "./MUI/MLabel";
import { MConfigs } from "./Global/MConfigs";
import { Buried } from "../libs/tw/util/Buried";
import DropBlinkMgr from "./Mgr/DropMgr";
import SpTimer from "./Game/SpTimer";
import SoundMgr from "./Mgr/SoundMgr";
@Decorator.OnUpdate
class Main extends eui.UILayer {
......@@ -31,16 +35,20 @@ class Main extends eui.UILayer {
protected createChildren() {
super.createChildren();
MTimer.init();
SpTimer.init();
MTweenMgr.instance.init();
PhycicsSystem.init();
Net.urlReplace();
MConfigs.updateConfig();
DropBlinkMgr.init();
Buried.init(window["appId"], NetUtils.getProjectId());
//注入自定义的素材解析器
let assetAdapter = new AssetAdapter();
egret.registerImplementation("eui.IAssetAdapter", assetAdapter);
egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter());
egret.ImageLoader.crossOrigin = "anonymous";
// egret.ImageLoader.crossOrigin = "anonymous";
layers.init(this);
Loading.init(layers.topLayer);
......@@ -55,6 +63,15 @@ class Main extends eui.UILayer {
this.runGame().catch(e => {
console.log(e);
});
document.addEventListener("visibilitychange", function () {
if (document.visibilityState == "visible") {
SoundMgr.instance.onResume();
}
if (document.visibilityState == "hidden") {
SoundMgr.instance.onPause();
}
});
}
private async runGame() {
......@@ -68,7 +85,7 @@ class Main extends eui.UILayer {
await this.loadTheme();
await RES.loadGroup("loading");
await RES.loadGroup("toast_panel");
await RES.loadGroup("sound");
await RES.loadGroup("main_scene");
}
catch (e) {
console.error(e);
......
import Drop from "../Game/Drop";
import { arrayRemove } from "../Global/GUtils";
export default class DropBlinkMgr {
private static _instance: DropBlinkMgr = null;
public static get instance(): DropBlinkMgr {
if (!this._instance) {
this._instance = new DropBlinkMgr();
}
return this._instance;
}
private list: {
drop: Drop,
count: number
}[] = [];
public add(drop: Drop) {
this.list.push({
drop: drop,
count: 0
});
}
public remove(drop: Drop) {
this.list = this.list.filter(e => e.drop !== drop);
}
public static init() {
egret.MainContext.instance.stage.addEventListener(egret.Event.ENTER_FRAME, DropBlinkMgr.instance.onUpdate, DropBlinkMgr.instance);
}
private frameTimer: number = 0;
public onUpdate() {
if (this.frameTimer % BlinkDuration == 0) {
let temp: {
drop: Drop,
count: number
} = null;
for (let i in this.list) {
temp = this.list[i];
temp.drop.visible = !temp.drop.visible;
temp.count++;
}
this.list = this.list.filter(e => {
if (e.count < 60 / BlinkDuration * 2) {
return true;
} else {
e.drop.destroy();
return false;
}
});
}
this.frameTimer++;
}
}
const BlinkDuration = 3;
\ No newline at end of file
import PoolMgr from "./PoolMgr";
import Ball from "../Global/Ball";
import PhycicsSystem from "../Game/PhycicsSystem";
import MTweenMgr from "../components/MTween";
import SoundMgr from "./SoundMgr";
import GuideMask from "../Panel/GuideMask";
import SceneCtrl from "../Ctrls/SceneCtrl";
import MainScene from "../Scene/MainScene";
export default class GameMgr {
private static _instance: GameMgr = null;
......@@ -14,6 +15,8 @@ export default class GameMgr {
return this._instance;
}
public hasSetMusic: boolean = false;
private _pause: boolean = false;
public set pause(v: boolean) {
this._pause = v;
......@@ -24,16 +27,38 @@ export default class GameMgr {
return this._pause;
}
public reviveSeq: number = 1;
public start() {
this.reviveSeq = 1;
private mainScene: MainScene = null;
init(mainScene: MainScene) {
this.mainScene = mainScene;
this.pause = false;
}
public hasClicked = false;
public switchSound() {
SoundMgr.instance.musicEnabled = !SoundMgr.instance.musicEnabled;
SoundMgr.instance.effectEnabled = !SoundMgr.instance.effectEnabled;
}
public minEnableCaptchaScore: number = null;
public get guideFlag(): boolean {
return localStorage.getItem("guide") != "false";
}
public set guideFlag(v: boolean) {
localStorage.setItem("guide", v ? "true" : "false");
}
private currentGuideMask: GuideMask = null;
public runGuide(index: number, x: number, y: number, end: boolean = false) {
this.currentGuideMask && this.currentGuideMask.destroy(); // 销毁之前的实例
this.currentGuideMask = new GuideMask(index, x, y);
this.currentGuideMask.onClick = () => {
this.currentGuideMask && this.currentGuideMask.destroy();
this.mainScene.resume();
if (end) {
this.guideFlag = false;
}
};
SceneCtrl.instance.parent.addChild(this.currentGuideMask);
this.mainScene.pause();
}
}
\ No newline at end of file
......@@ -4,26 +4,28 @@ import { MConst } from "../Global/MConst";
import PoolMgr from "./PoolMgr";
import MainScene from "../Scene/MainScene";
export default class ParticleMgr extends PoolMgr<Bullet> {
constructor(layer: egret.DisplayObjectContainer) {
super(layer);
this.containRect = new egret.Rectangle(- 100, - 100, MConst.DesignResolution.x + 100, MConst.DesignResolution.y + 100);
}
export default class ParticleMgr {
private data: Bullet[] = [];
createElement([context]: [MainScene]) {
let b = new Bullet(context);
b.physics.onMoved.add(() => {
if (!this.containRect.contains(b.x, b.y)) {
this.destroy(b);
}
});
this.layer.addChild(b);
return b;
private layer: egret.DisplayObjectContainer = null;
constructor(layer: egret.DisplayObjectContainer) {
this.layer = layer;
}
create(context: MainScene) {
return super.create(context);
if (this.data.length > 0) {
let e = this.data.pop();
e.onElementInit();
return e;
} else {
let b = new Bullet(context);
this.layer.addChild(b);
return b;
}
}
private containRect: egret.Rectangle = null;
destroy(bullet: Bullet) {
bullet.onElementRecycle();
this.data.push(bullet);
}
}
\ No newline at end of file
import DebugMgr from "./DebugMgr";
import MTimer from "../components/MTimer";
import SpTimer from "../Game/SpTimer";
export default class SoundMgr {
private static _instance: SoundMgr = null;
......@@ -12,6 +12,16 @@ export default class SoundMgr {
}
public effectEnabled = false;
private _enabled: boolean = false;
public set enabled(v: boolean) {
this.musicEnabled = v;
this.effectEnabled = v;
this._enabled = v;
}
public get enabled() {
return this._enabled;
}
private _musicEnabled: boolean = false;
public get musicEnabled() {
return this._musicEnabled;
......@@ -33,13 +43,23 @@ export default class SoundMgr {
public setMusic(url: string) {
this.music = RES.getRes(url);
if (this.musicChannel) {
/* if (this.musicChannel) {
this.playMusic();
} */
}
public onPause() {
this.stopMusic();
}
public onResume() {
if (this.musicEnabled) {
this.playMusic();
}
}
constructor() {
MTimer.onFrame(() => {
SpTimer.onFrame(() => {
DebugMgr.instance.setLog(this.t.toString());
});
}
......@@ -49,8 +69,13 @@ export default class SoundMgr {
console.warn("music do not set");
return;
}
this.musicChannel && this.musicChannel.stop();
this.musicChannel = this.music.play(0, 0);
if (this.musicEnabled) {
let pos = this.musicChannel.position;
this.musicChannel.stop();
this.musicChannel = this.music.play(pos, 0);
} else {
this.musicChannel = this.music.play(0, 0);
}
}
public stopMusic() {
......
import { MConfigs } from "../Global/MConfigs";
export default class GuideMask extends egret.DisplayObjectContainer {
private tweenList: egret.DisplayObject[] = [];
constructor(index: number, x: number, y: number) {
super();
const config = MConfigs.guide[index];
let bg = new egret.Shape();
bg.graphics.beginFill(0x000000);
bg.graphics.drawRect(0, 0, 750, 1624);
bg.graphics.endFill();
bg.alpha = 0.7;
let texture = RES.getRes(config.mask);
let bitmap = new egret.Bitmap(texture);
bitmap.x = x - texture.textureWidth / 2;
bitmap.y = y - texture.textureHeight / 2;
let container: egret.DisplayObjectContainer = new egret.DisplayObjectContainer();
container.addChild(bg);
container.addChild(bitmap);
bitmap.blendMode = egret.BlendMode.ERASE;
let renderTexture: egret.RenderTexture = new egret.RenderTexture();
renderTexture.drawToTexture(container);
let blendBitmap = new egret.Bitmap(renderTexture);
this.addChild(blendBitmap);
let offsetToMask = config.text.offsetToMask;
let label = new eui.Label(config.text.str);
label.size = 24;
label.x = offsetToMask.x + bitmap.x;
label.y = offsetToMask.y + bitmap.y;
this.textBlink(label);
this.addChild(label);
this.tweenList.push(label);
label.validateSize();
if (label.x < 0) {
label.x = 0;
} else if (label.x + label.width > 750) {
label.x = 750 - label.width;
}
if (config.arrow) {
let leftArrow = new eui.Image("guide_arrow_png");
leftArrow.x = 157, leftArrow.y = 908;
this.arrowTween(leftArrow, -1, 157);
this.addChild(leftArrow);
this.tweenList.push(leftArrow);
let rightArrow = new eui.Image("guide_arrow_png");
rightArrow.scaleX = -1;
rightArrow.x = 590, rightArrow.y = 908;
this.arrowTween(rightArrow, 1, 590);
this.addChild(rightArrow);
this.tweenList.push(rightArrow);
}
this.touchEnabled = true;
this.onTap(this, () => {
this.onClick && this.onClick();
});
}
private textBlink(label: eui.Label) {
egret.Tween.get(label).to({ alpha: 0 }, 400).to({ alpha: 1 }, 200).call(() => { this.textBlink(label) });
}
private arrowTween(arrow: eui.Image, dir: 1 | -1, startPos: number) {
egret.Tween.get(arrow).to({ x: startPos + dir * 100 }, 700).set({ x: startPos }).call(() => { this.arrowTween(arrow, dir, startPos) });
}
onClick: () => void;
destroy() {
this.tweenList.forEach(e => {
egret.Tween.removeTweens(e);
})
super.destroy();
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import MButton from "../MUI/MButton";
export default class MyPropsPanel extends Panel {
public dataGroup: eui.DataGroup;
public btnClose: MButton;
public labelNothing: eui.Label;
async preLoadRes() {
await super.preLoadRes();
......@@ -17,17 +18,24 @@ export default class MyPropsPanel extends Panel {
onSkinComplete() {
super.onSkinComplete();
this.btnClose.onTap(this, () => this.hidePanel());
this.dataGroup.itemRenderer = PropsItem;
Net.sendGet(Net.Url.queryProps, undefined, res => {
let map = res.data.spMap;
let arr = [];
Object.keys(map).forEach(id => {
arr.push({
id: id,
num: map[id],
});
if (map[id] > 0) {
arr.push({
id: id,
num: map[id],
});
}
});
if (arr.length <= 0) {
this.labelNothing.visible = true;
this.dataGroup.visible = false;
return;
}
this.dataGroup.dataProvider = new eui.ArrayCollection(arr);
this.dataGroup.itemRenderer = PropsItem;
});
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -16,11 +16,13 @@ import { NetUtils } from "../Global/NetUtils";
import MainScene from "../Scene/MainScene";
import PropsItem from "./PropsItem";
import Loading from "../Loading/Loading";
import { Buried } from "../../libs/tw/util/Buried";
import MLabel from "../MUI/MLabel";
@Decorator.OnUpdate
export default class SelectPropsPanel extends Panel implements Decorator.IDefaultCallback {
get skinKey() { return "SelectPropsPanel" }
public labelScore: eui.Label;
public labelScore: MLabel;
public labelCountDown: eui.Label;
public dataGroup: eui.DataGroup;
private timer = MConfigs.selectPropsCountDown * 1000;
......@@ -38,6 +40,11 @@ export default class SelectPropsPanel extends Panel implements Decorator.IDefaul
return RES.loadGroup("props");
}
constructor(data: any) {
super(data);
this.visible = false;
}
onUpdate(dt: number) {
if (this.timing) {
if (this.timer > 0) {
......@@ -56,9 +63,12 @@ export default class SelectPropsPanel extends Panel implements Decorator.IDefaul
onSkinComplete() {
super.onSkinComplete();
this.visible = false;
this.timing = true;
this.labelScore.text = this.data.context.score.toString();
Buried.doShowBuried(11);
this.btnSubmit.onOnceTap(this, () => {
Buried.doClickBuried(11);
Loading.instace.show();
this.hidePanel();
this.data.context.finalSubmit();
......@@ -69,12 +79,13 @@ export default class SelectPropsPanel extends Panel implements Decorator.IDefaul
}, (res) => {
let map = res.data.spMap;
let arr = [];
Object.keys(map).forEach(id => {
for (let id of Object.keys(map)) {
if (map[id] && map[id] > 0) {
let limit: number = Infinity;
if (id == MConst.ReviveCardId) { //是复活卡
if (res.data.leftReviveTimes <= 0) { //没有复活次数
return;
if (res.data.leftReviveTimes <= 0 || this.data.context.timer <= 0) { //没有复活次数了或没有游戏时间
continue;
}
} else { //是加分卡
limit = res.data.maxUseSpCnt;
......@@ -84,10 +95,20 @@ export default class SelectPropsPanel extends Panel implements Decorator.IDefaul
id: id,
num: map[id],
context: this,
limit: limit
limit: limit,
mainScene: this.data.context
});
}
});
}
if (arr.length <= 0) { //没有可用道具直接提交
this.hidePanel();
this.data.context.finalSubmit();
return;
} else {
this.visible = true;
}
this.dataGroup.dataProvider = new eui.ArrayCollection(arr);
this.dataGroup.itemRenderer = SelectPropsItem;
this.bgMask.height -= (102 + 45) * (3 - arr.length);
......@@ -110,7 +131,7 @@ class SelectPropsItem extends MItem {
return this._selectNum;
}
private set selectNum(v: number) {
v = Math.clamp(v, 0, Math.min(this.data.limit, this.data.num) || 0);
v = Math.clamp(v, 1, Math.min(this.data.limit, this.data.num) || 0);
this._selectNum = v;
this.labelSelectorNum.text = this._selectNum.toString();
......@@ -125,7 +146,8 @@ class SelectPropsItem extends MItem {
id: string,
num: number,
limit: number,
context: SelectPropsPanel
context: SelectPropsPanel,
mainScene: MainScene
}
createChildren() {
......@@ -146,29 +168,31 @@ class SelectPropsItem extends MItem {
//隐藏复活卡的选择器
this.selector.visible = false;
//复活按钮点击事件
this.btnUse.onOnceTap(this, (resume) => {
this.btnUse.onOnceTap(this, () => {
Buried.doClickBuried(12);
Loading.instace.show();
this.data.context.hidePanel();
//获取复活接口所需参数
const startId = this.data.context.data.context.startId;
const seq = NetUtils.encryptSeq(GameMgr.instance.reviveSeq);
const startId = this.data.mainScene.startId;
const seq = NetUtils.encryptSeq(this.data.mainScene.reviveSeq);
//请求复活接口
Net.sendPost(Net.Url.revive, {
startId: startId,
seq: seq,
token: NetUtils.md5(startId + seq + "dui88")
token: NetUtils.md5(startId.toString() + seq.toString() + MConst.Md5ConstStr)
}, () => { //成功
//游戏继续
//TODO
this.data.context.data.context.resume();
this.data.mainScene.revive();
Loading.instace.hide();
}, true);
});
} else { //是加分卡
//加分卡点击事件
this.btnUse.onOnceTap(this, () => {
Buried.doClickBuried(12);
Loading.instace.show();
this.data.context.hidePanel();
this.data.context.data.context.finalSubmit(this.data.id, this.selectNum);
this.data.mainScene.finalSubmit(this.data.id, this.selectNum);
});
}
......@@ -180,5 +204,6 @@ class SelectPropsItem extends MItem {
this.selectNum = 1;
this.btnAdd.onTap(this, () => this.selectNum++);
this.btnReduce.onTap(this, () => this.selectNum--);
Buried.doShowBuried(12);
}
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ export default class SignInItem extends MItem {
case "sp_2":
this.scoreCard500.visible = true;
break;
case "sp_11":
case "sp_3":
this.imgRevive.visible = true;
break;
......
......@@ -7,6 +7,8 @@ import PanelCtrl from "../Ctrls/PanelCtrl";
import { MConfigs } from "../Global/MConfigs";
import { ThroughSubmitData } from "../../libs/tw/data/custom/throughSubmit/ThroughSubmitData";
import { NetUtils } from "../Global/NetUtils";
import { MConst } from "../Global/MConst";
import { Buried } from "../../libs/tw/util/Buried";
export default class SignInPanel extends Panel {
get skinKey() { return "SignInPanel" }
......@@ -20,18 +22,21 @@ export default class SignInPanel extends Panel {
onSkinComplete() {
super.onSkinComplete();
this.btnClose.onTap(this, () => this.hidePanel());
this.btnSignIn.onTap(this, () => {
Buried.doShowBuried(6);
this.btnSignIn.onOnceTap(this, (resume) => {
let timestamp = NetUtils.getTimestamp();
Net.sendPost(Net.Url.signIn, {
timestamp: timestamp,
token: NetUtils.md5(timestamp + "dui88")
token: NetUtils.md5(timestamp.toString() + MConst.Md5ConstStr)
}, (res) => {
PanelCtrl.instance.show(SignSuccessPanel, {
coin: res.data.rewardCoins,
cardId: res.data.rewardSpId
});
this.refresh();
});
}, () => { resume() });
Buried.doClickBuried(6);
});
this.refresh();
......@@ -63,8 +68,10 @@ export default class SignInPanel extends Panel {
if (res.data.todaySignFlag) {
this.imgSignInDiabled.visible = true;
this.btnSignIn.visible = false;
} else {
this.btnSignIn.visible = true;
this.imgSignInDiabled.visible = false;
}
});
}
......@@ -92,7 +99,7 @@ class SignSuccessPanel extends Panel {
str += this.data.coin + "金币";
}
if (this.data.cardId) {
str += MConfigs.props[this.data.cardId].name;
str += "+" + MConfigs.props[this.data.cardId].name;
}
this.labelReward.text = str;
}
......
import Panel from "../views/Panel";
import { Decorator } from "../Decorator/Decorator";
import MButton from "../MUI/MButton";
import { Buried } from "../../libs/tw/util/Buried";
@Decorator.ClassName("SpUserPanel")
export default class SpUserPanel extends Panel {
public btn: MButton;
public btnClose: MButton;
@Decorator.LightRotate(7000)
public light: eui.Image;
onSkinComplete() {
super.onSkinComplete();
this.btnClose.onTap(this, () => {
this.onClose();
});
Buried.doShowBuried(13);
this.btn.onTap(this, () => {
Buried.doClickBuried(13);
this.onClose();
});
}
onClose() {
this.hidePanel()
}
}
\ No newline at end of file
......@@ -5,11 +5,13 @@ import MButton from "../MUI/MButton";
import Net from "../Global/Net";
import { MConfigs } from "../Global/MConfigs";
import { NetUtils } from "../Global/NetUtils";
import { MConst } from "../Global/MConst";
import { Buried } from "../../libs/tw/util/Buried";
interface ItemData {
index: number,
content: string,
btnText: string,
url: string,
finishFlag: boolean,
taskCode: string,
context: TaskPanel
......@@ -20,37 +22,42 @@ export default class TaskPanel extends Panel {
public dataGroup: eui.DataGroup;
public btnClose: MButton;
onCompleteTask: () => void;
onSkinComplete() {
super.onSkinComplete();
this.btnClose.onTap(this, () => this.hidePanel());
this.dataGroup.itemRenderer = class extends MItem {
this.dataGroup.itemRenderer = class extends MItem { //Item
public labelNum: eui.Label;
public labelContent: eui.Label;
public btnDo: MButton;
data: ItemData;
onSkinComplete() {
Buried.doShowBuried(6 + this.data.index);
this.btnDo.onOnceTap(this, (resume) => {
const timestamp = NetUtils.getTimestamp();
Net.sendPost(Net.Url.taskComplete, {
taskCode: this.data.taskCode,
timestamp: timestamp,
token: NetUtils.md5(this.data.taskCode + timestamp + "dui88")
}, () => {
this.data.context.refresh();
}, () => { resume() });
if (this.data.finishFlag == false) {
const timestamp = NetUtils.getTimestamp();
Net.sendPost(Net.Url.taskComplete, {
taskCode: this.data.taskCode,
timestamp: timestamp,
token: NetUtils.md5(this.data.taskCode + timestamp.toString() + MConst.Md5ConstStr)
}, () => {
this.data.context.refresh();
gotoUrl(this.data.url);
}, () => { resume() });
} else {
gotoUrl(this.data.url);
}
Buried.doClickBuried(6 + this.data.index);
});
}
dataChanged() {
this.labelNum.text = "任务" + this.data.index;
this.labelContent.text = this.data.content;
this.btnDo.label = this.data.btnText;
if (this.data.finishFlag == true) {
this.btnDo.enabled = false;
this.btnDo.labelDisplay.textColor = 0xbeafad;
}
this.btnDo.label = this.data.finishFlag == false ? "0/1" : "1/1";
}
}
......@@ -73,11 +80,22 @@ export default class TaskPanel extends Panel {
content: config.content,
taskCode: config.taskCode,
finishFlag: taskList[i].finishFlag,
btnText: config.btnText,
context: this
context: this,
url: config.url
});
}
this.dataGroup.dataProvider = new eui.ArrayCollection(arr);
}, () => { this.hidePanel() });
this.onCompleteTask && this.onCompleteTask();
}
}
function gotoUrl(url: string) {
let options = {
url: url
};
if (url.indexOf("https") === 0) {
options["tpl"] = "webview";
}
window["aladdin"].navigator.forward(options);
}
\ No newline at end of file
......@@ -3,11 +3,12 @@ import { Decorator } from "../Decorator/Decorator";
import MButton from "../MUI/MButton";
import SceneCtrl from "../Ctrls/SceneCtrl";
import StartScene from "../Scene/StartScene";
import MLabel from "../MUI/MLabel";
@Decorator.ClassName("WinningPanel")
export default class WinningPanel extends Panel {
public labelScore: eui.Label;
public labelHighestScore: eui.Label;
public labelScore: MLabel;
public labelHighestScore: MLabel;
public imgReward: eui.Image;
public labelCoinNum: eui.Label;
public btnClose: MButton;
......@@ -24,8 +25,9 @@ export default class WinningPanel extends Panel {
this.hidePanel();
SceneCtrl.instance.change(StartScene);
});
this.labelScore.text = this.data.score.toString() + "分";
this.labelHighestScore.text = this.data.highestScore.toString() + "分";
this.labelScore.text = this.data.score.toString() + "/e分";
let text = typeof this.data.highestScore == "number" ? this.data.highestScore.toString() + "/e分" : "-";
this.labelHighestScore.text = text;
this.imgReward.source = this.data.rewardImgUrl;
this.labelCoinNum.text = this.data.rewardName + "已入账";
}
......
This diff is collapsed.
......@@ -5,7 +5,6 @@ import MainScene from "./MainScene";
import PanelCtrl from "../Ctrls/PanelCtrl";
import SignInPanel from "../Panel/SignInPanel";
import SelectPropsPanel from "../Panel/SelectPropsPanel";
import MTimer from "../components/MTimer";
import Net from "../Global/Net";
import { Decorator } from "../Decorator/Decorator";
import SoundMgr from "../Mgr/SoundMgr";
......@@ -17,6 +16,9 @@ import Loading from "../Loading/Loading";
import TaskPanel from "../Panel/TaskPanel";
import RulePanel from "../Panel/RulePanel";
import MyPropsPanel from "../Panel/MyPropsPanel";
import { MConfigs } from "../Global/MConfigs";
import SpUserPanel from "../Panel/SpUserPanel";
import { Buried } from "../../libs/tw/util/Buried";
interface StartButton extends MButton {
labelStartShadow: eui.Label;
......@@ -32,79 +34,125 @@ export default class StartScene extends Scene {
public btnShare: eui.Button;
public btnReward: eui.Button;
public btnProps: eui.Button;
public btnMusic: MButton;
public btnMusic: eui.ToggleButton;
public btnStart: StartButton;
public btnSignIn: MButton;
public btnRule: MButton;
public btnTask: MButton;
public btnRankList: MButton;
private leftTimes: number = 0;
private leftTimes: number = null;
private allPeriodEnd: boolean = false;
async preLoadRes() {
await super.preLoadRes();
return new Promise(async resolve => {
await RES.getResAsync("bgm_mp3");
resolve();
});
}
onSkinComplete() {
super.onSkinComplete();
SoundMgr.instance.setMusic("bgm_mp3");
if (GameMgr.instance.hasClicked)
SoundMgr.instance.playMusic();
if (!GameMgr.instance.hasSetMusic) {
SoundMgr.instance.enabled = true;
}
this.btnReward.onTap(this, () => {
location.href = MConfigs.rewardRecordUrl;
});
Buried.doShowBuried(2);
this.btnStart.onOnceTap(this, (resume) => {
this.checkFirstClick();
if (!GameMgr.instance.hasSetMusic) {
SoundMgr.instance.enabled = true;
GameMgr.instance.hasSetMusic = true;
}
if (this.leftTimes <= 0) {
if (this.leftTimes == null) {
resume();
} else if (this.leftTimes <= 0) {
ToastPanel.show("今日游戏次数已用完");
resume();
return;
} else if (this.allPeriodEnd) {
ToastPanel.show("该活动已结束!");
resume();
} else {
Net.sendPost(Net.Url.start, undefined, (res) => {
SceneCtrl.instance.change(MainScene, { startId: res.data.startId });
}, () => { resume() });
}
Net.sendPost(Net.Url.start, undefined, (res) => {
SceneCtrl.instance.change(MainScene, { startId: res.data.startId });
}, () => { resume() });
Buried.doClickBuried(2);
});
Buried.doShowBuried(3);
this.btnSignIn.onTap(this, () => {
this.checkFirstClick();
if (this.allPeriodEnd) {
ToastPanel.show("该活动已结束!");
return;
}
PanelCtrl.instance.show(SignInPanel);
});
this.btnMusic.onTap(this, () => {
GameMgr.instance.switchSound();
if (!GameMgr.instance.hasClicked)
GameMgr.instance.hasClicked = true;
Buried.doClickBuried(3);
});
this.btnMusic.selected = SoundMgr.instance.enabled;
this.btnMusic.addEventListener(eui.UIEvent.CHANGE, (evt: eui.UIEvent) => {
GameMgr.instance.hasSetMusic = true;
SoundMgr.instance.enabled = (evt.target as eui.ToggleButton).selected;
}, this);
Buried.doShowBuried(5);
this.btnRankList.onTap(this, () => {
PanelCtrl.instance.show(RankListPanel, { defaultToggle: 1 });
Buried.doClickBuried(5);
});
Buried.doShowBuried(4);
this.btnTask.onTap(this, () => {
PanelCtrl.instance.show(TaskPanel);
PanelCtrl.instance.show<TaskPanel>(TaskPanel).onCompleteTask = () => {
this.refresh();
};
Buried.doClickBuried(4);
});
this.btnRule.onTap(this, () => {
PanelCtrl.instance.show(RulePanel);
PanelCtrl.instance.show(RulePanel, { msg: MConfigs.rule });
});
this.btnProps.onTap(this, () => {
PanelCtrl.instance.show(MyPropsPanel);
});
Buried.doShowBuried(1);
this.btnShare.onTap(this, () => {
//端内分享
window["share"]();
Buried.doClickBuried(1);
});
this.refresh();
}
private refresh() {
Net.sendGet(Net.Url.visit, undefined, (res) => {
GameMgr.instance.minEnableCaptchaScore = res.data.minEnableCaptchaScore;
this.leftTimes = res.data.leftTimes;
const text = "开始游戏×" + this.leftTimes;
this.btnStart.labelStart.text = text;
this.btnStart.labelStartShadow.text = text;
this.allPeriodEnd = res.data.allPeriodEnd;
if (typeof res.data.rewardSpId == "string") {
PanelCtrl.instance.show(SpUserPanel);
}
if (res.data.prevPrizePopUp) {
PanelCtrl.instance.show(RankListPanel, { defaultToggle: 2 });
}
}, () => { Loading.instace.show() });
}
private checkFirstClick() {
if (!GameMgr.instance.hasClicked) {
GameMgr.instance.switchSound();
GameMgr.instance.hasClicked = true;
}
}
}
\ No newline at end of file
import MSVGAClip from "./MSVGAClip";
import SpTimer from "../Game/SpTimer";
let lastTime = 0;
let curTime = 0;
function updateDeltaTime() {
lastTime = curTime;
curTime = egret.getTimer();
SpTimer.deltaTime = curTime - lastTime;
}
// let deltaTimeBeforPause: number;
export function customClassPrototype() {
......@@ -28,31 +37,5 @@ export function customClassPrototype() {
return target;
}
egret.Timer["_deltaTime"] = 0;
egret.Timer["_lastTime"] = 0;
egret.Timer["_curTime"] = 0;
egret.Timer["_updateDeltaTime"] = function () {
egret.Timer["_lastTime"] = egret.Timer["_curTime"];
egret.Timer["_curTime"] = egret.getTimer();
egret.Timer["_deltaTime"] = egret.Timer["_curTime"] - egret.Timer["_lastTime"];
}
Object.defineProperty(egret.Timer, "deltaTime", {
get: function () {
return this["_deltaTime"];
}
});
egret.MainContext.instance.stage.addEventListener(egret.Event.ENTER_FRAME, function () {
egret.Timer["_updateDeltaTime"]();
}, null);
egret.lifecycle.onPause = () => {
// deltaTimeBeforPause = egret.getTimer() - egret.Timer["_curTime"];
}
egret.lifecycle.onResume = () => {
egret.Timer["_curTime"] = egret.getTimer(); /* - deltaTimeBeforPause || 0; */
}
Array.prototype.remove = function (element: any) {
return this.filter((e: any) => e != element);
}
egret.MainContext.instance.stage.addEventListener(egret.Event.ENTER_FRAME, updateDeltaTime, null);
}
\ No newline at end of file
/**
* @note 极验 - 第三方插件
* @author 张晨辰
* @email zcc@duiba.com.cn
* @create 2017-04-19 12:01:45
* @update 2017-06-28 10:06:00
* @des https://www.163yun.com/help/documents/294963579379175424
* @dependencies <script type="text/javascript" src="//c.dun.163yun.com/js/c.js"></script>
* 2.0 <script src="//cstaticdun.126.net/load.min.js"></script>
*/
let captchaIns: any;
export function initNECaptcha(options: any) {
if (!options.captchaId) {
return false;
}
window["$"]('body').append('<div class="captcha"><div id="check_wrapper" class="neCaptcha-dialog"></div></div>');
var opts = {
element: '#check_wrapper', // 可以是验证码容器id,也可以是HTMLElement
captchaId: options.captchaId, // 这里填入申请到的验证码id
width: options.width || 270, // 验证码组件显示宽度
mode: options.mode || 'embed',
onVerify: function (err: any, data: any) {
if (!err) {
window["$"](".captcha").unbind("click");
window["$"]('.captcha').remove();
// data.validate = base64.encode(data.validate);
options.callback && options.callback(data);
}
}
}
window["initNECaptcha"] && window["initNECaptcha"](opts, function (instance:any) {
captchaIns = instance
window["$"](".captcha").click(function (e:any) {
if (e.target.className == "captcha") {
if (captchaIns) captchaIns.refresh()
}
});
}, function (err: any) {
console.log(err, 55655665)
//初始化失败,点击黑色区域重新初始
window["$"](".captcha").click(function (e:any) {
window["$"](".captcha").unbind("click");
window["$"]('.captcha').remove();
initNECaptcha(options)
});
});
window["loading"] && window["loading"].close();
window["$"]('.captcha').show();
};
......@@ -153,6 +153,7 @@ export default class MTweenMgr {
private isTraversing = false;
public init() {
// egret.startTick(this.update, this);
egret.MainContext.instance.stage.addEventListener(egret.Event.ENTER_FRAME, this.update, this);
}
......@@ -192,5 +193,7 @@ export default class MTweenMgr {
});
this.removeQueue = [];
return false;
}
}
\ 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.
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