模板化提交,增加关卡json读取,GameAppStart关键累,管理所有公共资源以及初始化
|
@ -1,12 +1,5 @@
|
||||||
// 主游戏控制类
|
// 主游戏控制类
|
||||||
const {ccclass, property} = cc._decorator;
|
const {ccclass, property} = cc._decorator;
|
||||||
|
|
||||||
import GameData from './module/Config/GameData';
|
|
||||||
import HttpUtil from './module/Crypto/HttpUtil';
|
|
||||||
import AudioManager from './module/Music/AudioManager';
|
|
||||||
import { Notifications } from './module/Notification/Notification';
|
|
||||||
import { GameTool } from './module/Tool/GameTool';
|
|
||||||
|
|
||||||
@ccclass
|
@ccclass
|
||||||
export default class GameManager extends cc.Component {
|
export default class GameManager extends cc.Component {
|
||||||
@property(cc.Node)
|
@property(cc.Node)
|
||||||
|
@ -76,10 +69,10 @@ export default class GameManager extends cc.Component {
|
||||||
this.round = 0;
|
this.round = 0;
|
||||||
this.level = 2;
|
this.level = 2;
|
||||||
this.countTime = 60;
|
this.countTime = 60;
|
||||||
if(GameData._instance.GM_INFO.custom != 0){
|
if(cc.fx.GameConfig.GM_INFO.custom != 0){
|
||||||
this.level = GameData._instance.GM_INFO.custom;
|
this.level = cc.fx.GameConfig.GM_INFO.custom;
|
||||||
// this.levelLabel.string = this.level + "";
|
// this.levelLabel.string = this.level + "";
|
||||||
GameData._instance.GM_INFO.custom += 1;
|
cc.fx.GameConfig.GM_INFO.custom += 1;
|
||||||
this.countTime = 12000000;
|
this.countTime = 12000000;
|
||||||
}
|
}
|
||||||
// this.levelLabel.string = this.level + "";
|
// this.levelLabel.string = this.level + "";
|
||||||
|
@ -96,13 +89,13 @@ export default class GameManager extends cc.Component {
|
||||||
this.Pos_Array = [];
|
this.Pos_Array = [];
|
||||||
this.time_Array = [];
|
this.time_Array = [];
|
||||||
this.color_Array = [];
|
this.color_Array = [];
|
||||||
GameData._instance.GAME_DATA = [];
|
cc.fx.GameConfig.GAME_DATA = [];
|
||||||
GameData._instance.GM_INFO.success = false;
|
cc.fx.GameConfig.GM_INFO.success = false;
|
||||||
this.startTime = 0;
|
this.startTime = 0;
|
||||||
this.overTime = 0;
|
this.overTime = 0;
|
||||||
this.winTime = 0;
|
this.winTime = 0;
|
||||||
GameData._instance.GM_INFO.total = 0;
|
cc.fx.GameConfig.GM_INFO.total = 0;
|
||||||
GameData._instance.GM_INFO.mean_Time = 0;
|
cc.fx.GameConfig.GM_INFO.mean_Time = 0;
|
||||||
this.schedule(this.updateCountDownTime,1);
|
this.schedule(this.updateCountDownTime,1);
|
||||||
this.startGame();
|
this.startGame();
|
||||||
}
|
}
|
||||||
|
@ -138,7 +131,7 @@ export default class GameManager extends cc.Component {
|
||||||
}
|
}
|
||||||
//下一关,或者重新开始,或者返回上一关,根据level决定
|
//下一关,或者重新开始,或者返回上一关,根据level决定
|
||||||
reStart(type){
|
reStart(type){
|
||||||
// if(GameData._instance.GM_INFO.custom != 0){
|
// if(cc.fx.GameConfig.GM_INFO.custom != 0){
|
||||||
// cc.director.loadScene("LoadScene");
|
// cc.director.loadScene("LoadScene");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
@ -239,11 +232,11 @@ export default class GameManager extends cc.Component {
|
||||||
clickSun(data){
|
clickSun(data){
|
||||||
if(this.begin == true){
|
if(this.begin == true){
|
||||||
this.clickCount += 1;
|
this.clickCount += 1;
|
||||||
let clickTime = GameTool.getTime();
|
let clickTime = cc.fx.GameTool.getTime();
|
||||||
this.time_Array.push((clickTime - this.timeStart))
|
this.time_Array.push((clickTime - this.timeStart))
|
||||||
this.timeStart = GameTool.getTime();
|
this.timeStart = cc.fx.GameTool.getTime();
|
||||||
if(data == this.clickNow){
|
if(data == this.clickNow){
|
||||||
AudioManager._instance.playAudioButton();
|
cc.fx.AudioManager.Instance.playAudioButton();
|
||||||
if(this.clickNow > 0){
|
if(this.clickNow > 0){
|
||||||
this.createLine(cc.v2(this.ball_Array[this.clickNow-1].x,this.ball_Array[this.clickNow-1].y),
|
this.createLine(cc.v2(this.ball_Array[this.clickNow-1].x,this.ball_Array[this.clickNow-1].y),
|
||||||
cc.v2(this.ball_Array[this.clickNow].x,this.ball_Array[this.clickNow].y),
|
cc.v2(this.ball_Array[this.clickNow].x,this.ball_Array[this.clickNow].y),
|
||||||
|
@ -254,10 +247,10 @@ export default class GameManager extends cc.Component {
|
||||||
this.ball_Array[this.clickNow-1].getChildByName("guang").active = false;
|
this.ball_Array[this.clickNow-1].getChildByName("guang").active = false;
|
||||||
if(this.clickNow == this.now_Array.length){
|
if(this.clickNow == this.now_Array.length){
|
||||||
this.pause = true;
|
this.pause = true;
|
||||||
GameData._instance.GM_INFO.total += this.clickNow;
|
cc.fx.GameConfig.GM_INFO.total += this.clickNow;
|
||||||
this.overTime = GameTool.getTime();
|
this.overTime = cc.fx.GameTool.getTime();
|
||||||
if(this.startTime > 0 && this.overTime > 0){
|
if(this.startTime > 0 && this.overTime > 0){
|
||||||
GameData._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
cc.fx.GameConfig.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||||
}
|
}
|
||||||
let finish_time = parseInt((this.overTime - this.startTime)/100+"");
|
let finish_time = parseInt((this.overTime - this.startTime)/100+"");
|
||||||
this.startTime = 0; this.overTime = 0;
|
this.startTime = 0; this.overTime = 0;
|
||||||
|
@ -266,7 +259,7 @@ export default class GameManager extends cc.Component {
|
||||||
else if(this.level >= 4) color = "yrb";
|
else if(this.level >= 4) color = "yrb";
|
||||||
let win = this.node.getChildByName("Win");
|
let win = this.node.getChildByName("Win");
|
||||||
win.active = true; win.setScale(0);
|
win.active = true; win.setScale(0);
|
||||||
AudioManager._instance.playWin();
|
cc.fx.AudioManager.Instance.playWin();
|
||||||
this.round += 1;
|
this.round += 1;
|
||||||
let sunArray = [];
|
let sunArray = [];
|
||||||
if(this.moveArray.length > 0){
|
if(this.moveArray.length > 0){
|
||||||
|
@ -286,15 +279,15 @@ export default class GameManager extends cc.Component {
|
||||||
sunArray.push(0);
|
sunArray.push(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameData._instance.CLICK_DATA =
|
cc.fx.GameConfig.CLICK_DATA =
|
||||||
{
|
{
|
||||||
type:1,
|
type:1,
|
||||||
success:true,
|
success:true,
|
||||||
round:this.round,
|
round:this.round,
|
||||||
totalSunCount:this.now_Array.length,
|
totalSunCount:this.now_Array.length,
|
||||||
movedSunCount:GameData._instance.LEVEL_INFO[this.level-1].moveNumber,
|
movedSunCount:cc.fx.GameConfig.LEVEL_INFO[this.level-1].moveNumber,
|
||||||
sunSpeed:GameData._instance.LEVEL_INFO[this.level-1].moveSpeed,
|
sunSpeed:cc.fx.GameConfig.LEVEL_INFO[this.level-1].moveSpeed,
|
||||||
overlapSunCount:GameData._instance.LEVEL_INFO[this.level-1].repeat,
|
overlapSunCount:cc.fx.GameConfig.LEVEL_INFO[this.level-1].repeat,
|
||||||
colorList:this.color_Array,
|
colorList:this.color_Array,
|
||||||
duration:finish_time/10,
|
duration:finish_time/10,
|
||||||
difficultyLevel:this.level,
|
difficultyLevel:this.level,
|
||||||
|
@ -302,6 +295,9 @@ export default class GameManager extends cc.Component {
|
||||||
stepTimeList:this.time_Array,
|
stepTimeList:this.time_Array,
|
||||||
remainder:this.countTime
|
remainder:this.countTime
|
||||||
}
|
}
|
||||||
|
if(cc.fx.GameConfig.CLICK_DATA.duration > 50){
|
||||||
|
cc.fx.GameConfig.CLICK_DATA.duration = 50;
|
||||||
|
}
|
||||||
this.setData();
|
this.setData();
|
||||||
cc.tween(win)
|
cc.tween(win)
|
||||||
.delay(0.4)
|
.delay(0.4)
|
||||||
|
@ -313,7 +309,7 @@ export default class GameManager extends cc.Component {
|
||||||
this.destroyLine();
|
this.destroyLine();
|
||||||
if(this.over == false && this.countTime >= 0){
|
if(this.over == false && this.countTime >= 0){
|
||||||
if(this.level >= 15){
|
if(this.level >= 15){
|
||||||
GameData._instance.GM_INFO.success = true;
|
cc.fx.GameConfig.GM_INFO.success = true;
|
||||||
this.level += 0;
|
this.level += 0;
|
||||||
// this.levelLabel.string = this.level + "";
|
// this.levelLabel.string = this.level + "";
|
||||||
this.fuhuo = true;
|
this.fuhuo = true;
|
||||||
|
@ -337,13 +333,14 @@ export default class GameManager extends cc.Component {
|
||||||
}
|
}
|
||||||
//执行失败
|
//执行失败
|
||||||
setLoss(){
|
setLoss(){
|
||||||
AudioManager._instance.playWarning();
|
cc.fx.AudioManager.Instance.playWarning();
|
||||||
this.begin = false;
|
this.begin = false;
|
||||||
this.overTime = GameTool.getTime();
|
this.overTime = cc.fx.GameTool.getTime();
|
||||||
if(this.startTime > 0 && this.overTime > 0){
|
if(this.startTime > 0 && this.overTime > 0){
|
||||||
GameData._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
cc.fx.GameConfig.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||||
}
|
}
|
||||||
let finish_time = parseInt((this.overTime - this.startTime)/100+"");
|
let finish_time = parseInt((this.overTime - this.startTime)/100+"");
|
||||||
|
if(finish_time > 58) finish_time = 58;
|
||||||
this.startTime = 0; this.overTime = 0;
|
this.startTime = 0; this.overTime = 0;
|
||||||
let color = "y";
|
let color = "y";
|
||||||
if(this.level < 4 && this.level > 1)color = "yr";
|
if(this.level < 4 && this.level > 1)color = "yr";
|
||||||
|
@ -367,15 +364,15 @@ export default class GameManager extends cc.Component {
|
||||||
sunArray.push(0);
|
sunArray.push(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameData._instance.CLICK_DATA =
|
cc.fx.GameConfig.CLICK_DATA =
|
||||||
{
|
{
|
||||||
type:1,
|
type:1,
|
||||||
success:false,
|
success:false,
|
||||||
round:this.round,
|
round:this.round,
|
||||||
totalSunCount:this.now_Array.length,
|
totalSunCount:this.now_Array.length,
|
||||||
movedSunCount:GameData._instance.LEVEL_INFO[this.level-1].moveNumber,
|
movedSunCount:cc.fx.GameConfig.LEVEL_INFO[this.level-1].moveNumber,
|
||||||
sunSpeed:GameData._instance.LEVEL_INFO[this.level-1].moveSpeed,
|
sunSpeed:cc.fx.GameConfig.LEVEL_INFO[this.level-1].moveSpeed,
|
||||||
overlapSunCount:GameData._instance.LEVEL_INFO[this.level-1].repeat,
|
overlapSunCount:cc.fx.GameConfig.LEVEL_INFO[this.level-1].repeat,
|
||||||
colorList:this.color_Array,
|
colorList:this.color_Array,
|
||||||
duration:finish_time/10,
|
duration:finish_time/10,
|
||||||
difficultyLevel:this.level,
|
difficultyLevel:this.level,
|
||||||
|
@ -383,6 +380,9 @@ export default class GameManager extends cc.Component {
|
||||||
stepTimeList:this.time_Array,
|
stepTimeList:this.time_Array,
|
||||||
remainder:this.countTime
|
remainder:this.countTime
|
||||||
}
|
}
|
||||||
|
if(cc.fx.GameConfig.CLICK_DATA.duration > 50){
|
||||||
|
cc.fx.GameConfig.CLICK_DATA.duration = 50;
|
||||||
|
}
|
||||||
this.setData();
|
this.setData();
|
||||||
if(this.fuhuo == true){
|
if(this.fuhuo == true){
|
||||||
this.fuhuo = false;
|
this.fuhuo = false;
|
||||||
|
@ -448,7 +448,7 @@ export default class GameManager extends cc.Component {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.destroyLine();
|
this.destroyLine();
|
||||||
this.beginGame();
|
this.beginGame();
|
||||||
if(GameData._instance.LEVEL_INFO[this.level-1].moveNumber<1){
|
if(cc.fx.GameConfig.LEVEL_INFO[this.level-1].moveNumber<1){
|
||||||
this.pause = false;
|
this.pause = false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -466,7 +466,7 @@ export default class GameManager extends cc.Component {
|
||||||
//设置移动重叠数据
|
//设置移动重叠数据
|
||||||
createMove(){
|
createMove(){
|
||||||
if(this.over == false){
|
if(this.over == false){
|
||||||
let info = GameData._instance.LEVEL_INFO[this.level-1];
|
let info = cc.fx.GameConfig.LEVEL_INFO[this.level-1];
|
||||||
//改变移动速度
|
//改变移动速度
|
||||||
var speed = 7;
|
var speed = 7;
|
||||||
if(info.moveSpeed >= 2){
|
if(info.moveSpeed >= 2){
|
||||||
|
@ -567,7 +567,7 @@ export default class GameManager extends cc.Component {
|
||||||
moveAction(){
|
moveAction(){
|
||||||
this.updateArray();
|
this.updateArray();
|
||||||
let moveArray = this.moveArray;
|
let moveArray = this.moveArray;
|
||||||
let info = GameData._instance.LEVEL_INFO[this.level-1];
|
let info = cc.fx.GameConfig.LEVEL_INFO[this.level-1];
|
||||||
//改变移动速度
|
//改变移动速度
|
||||||
var speed = 7;
|
var speed = 7;
|
||||||
if(info.moveSpeed >= 2){
|
if(info.moveSpeed >= 2){
|
||||||
|
@ -625,15 +625,15 @@ export default class GameManager extends cc.Component {
|
||||||
//每次重新开始新一轮儿游戏
|
//每次重新开始新一轮儿游戏
|
||||||
beginGame(){
|
beginGame(){
|
||||||
this.begin = true;
|
this.begin = true;
|
||||||
this.startTime = GameTool.getTime();
|
this.startTime = cc.fx.GameTool.getTime();
|
||||||
this.timeStart = GameTool.getTime();
|
this.timeStart = cc.fx.GameTool.getTime();
|
||||||
this.pause = false;
|
this.pause = false;
|
||||||
// this.node.getChildByName("showBtn").active = true;
|
// this.node.getChildByName("showBtn").active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//创建太阳所需数据
|
//创建太阳所需数据
|
||||||
createSun(){
|
createSun(){
|
||||||
let levelData = GameData._instance.LEVEL_INFO[this.level-1];
|
let levelData = cc.fx.GameConfig.LEVEL_INFO[this.level-1];
|
||||||
let tiemOut = 0;
|
let tiemOut = 0;
|
||||||
for(let l=0; l<levelData.number;l++){
|
for(let l=0; l<levelData.number;l++){
|
||||||
tiemOut += 1;
|
tiemOut += 1;
|
||||||
|
@ -653,7 +653,7 @@ export default class GameManager extends cc.Component {
|
||||||
//创建太阳位置,颜色信息等数据
|
//创建太阳位置,颜色信息等数据
|
||||||
createPos(){
|
createPos(){
|
||||||
let data = {x:this.ball.x,y:this.ball.y,time:0,timeCount:0,color:0,speed:0,repeat:false};
|
let data = {x:this.ball.x,y:this.ball.y,time:0,timeCount:0,color:0,speed:0,repeat:false};
|
||||||
let levelData = GameData._instance.LEVEL_INFO[this.level-1];
|
let levelData = cc.fx.GameConfig.LEVEL_INFO[this.level-1];
|
||||||
//颜色区分
|
//颜色区分
|
||||||
let colorArray = [0,1];
|
let colorArray = [0,1];
|
||||||
for(let j=0; j<levelData.number-2;j++){
|
for(let j=0; j<levelData.number-2;j++){
|
||||||
|
@ -732,13 +732,14 @@ export default class GameManager extends cc.Component {
|
||||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||||
if(distance > 160){
|
if(distance > 160){
|
||||||
if(num == true){
|
if(num == true){
|
||||||
if(distance < GameData._instance.LEVEL_INFO[this.level-1].maxMove){
|
cc.fx.GameConfig
|
||||||
|
if(distance < cc.fx.GameConfig.LEVEL_INFO[this.level-1].maxMove){
|
||||||
jg = true;
|
jg = true;
|
||||||
}
|
}
|
||||||
else jg = false;
|
else jg = false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(distance < GameData._instance.LEVEL_INFO[this.level-1].maxMove){
|
if(distance < cc.fx.GameConfig.LEVEL_INFO[this.level-1].maxMove){
|
||||||
jg = true;
|
jg = true;
|
||||||
}
|
}
|
||||||
else jg = false;
|
else jg = false;
|
||||||
|
@ -832,7 +833,7 @@ export default class GameManager extends cc.Component {
|
||||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||||
if(distance > 160){
|
if(distance > 160){
|
||||||
if(num == true){
|
if(num == true){
|
||||||
if(distance < GameData._instance.LEVEL_INFO[this.level-1].maxDistance) jg = true;
|
if(distance < cc.fx.GameConfig.LEVEL_INFO[this.level-1].maxDistance) jg = true;
|
||||||
else jg = false;
|
else jg = false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -863,7 +864,7 @@ export default class GameManager extends cc.Component {
|
||||||
updateCountDownTime () {
|
updateCountDownTime () {
|
||||||
if (this.countTime > 0 && this.pause == false) {
|
if (this.countTime > 0 && this.pause == false) {
|
||||||
this.countTime -= 1;
|
this.countTime -= 1;
|
||||||
this.time.string = GameTool.getTimeMargin(this.countTime);
|
this.time.string = cc.fx.GameTool.getTimeMargin(this.countTime);
|
||||||
if(this.countTime < 5){
|
if(this.countTime < 5){
|
||||||
cc.tween(this.time.node)
|
cc.tween(this.time.node)
|
||||||
.to(0.25,{scale:1.5,color:cc.color(255,0,0)})
|
.to(0.25,{scale:1.5,color:cc.color(255,0,0)})
|
||||||
|
@ -882,9 +883,9 @@ export default class GameManager extends cc.Component {
|
||||||
this.unschedule(this.updateCountDownTime);
|
this.unschedule(this.updateCountDownTime);
|
||||||
this.setLoss();
|
this.setLoss();
|
||||||
var time = 0;
|
var time = 0;
|
||||||
if(this.clickCount > 0) time = parseInt(GameData._instance.GM_INFO.mean_Time/this.clickCount + "");
|
if(this.clickCount > 0) time = parseInt(cc.fx.GameConfig.GM_INFO.mean_Time/this.clickCount + "");
|
||||||
GameData._instance.GM_INFO.mean_Time = parseInt(time/100 + "");
|
cc.fx.GameConfig.GM_INFO.mean_Time = parseInt(time/100 + "");
|
||||||
GameData._instance.GM_INFO.mean_Time = GameData._instance.GM_INFO.mean_Time /10;
|
cc.fx.GameConfig.GM_INFO.mean_Time = cc.fx.GameConfig.GM_INFO.mean_Time /10;
|
||||||
if(time > 10000) time = (Math.random()*10+5)*100;
|
if(time > 10000) time = (Math.random()*10+5)*100;
|
||||||
this.gameOver(time);
|
this.gameOver(time);
|
||||||
}
|
}
|
||||||
|
@ -892,11 +893,11 @@ export default class GameManager extends cc.Component {
|
||||||
}
|
}
|
||||||
//上传每次操作数据
|
//上传每次操作数据
|
||||||
setData(){
|
setData(){
|
||||||
GameTool.setGameData();
|
cc.fx.GameTool.setGameData();
|
||||||
}
|
}
|
||||||
//上传排行榜数据
|
//上传排行榜数据
|
||||||
gameOver(time){
|
gameOver(time){
|
||||||
GameTool.setRank(time);
|
cc.fx.GameTool.setRank(time);
|
||||||
this.node.getChildByName("GameOver").active = true;
|
this.node.getChildByName("GameOver").active = true;
|
||||||
this.node.getChildByName("GameOver").opacity = 0;
|
this.node.getChildByName("GameOver").opacity = 0;
|
||||||
cc.tween(this.node.getChildByName("GameOver"))
|
cc.tween(this.node.getChildByName("GameOver"))
|
||||||
|
@ -917,10 +918,10 @@ export default class GameManager extends cc.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEnable () {
|
onEnable () {
|
||||||
Notifications.on("clickSun", this.clickSun, this);
|
cc.fx.Notifications.on("clickSun", this.clickSun, this);
|
||||||
}
|
}
|
||||||
onDisable () {
|
onDisable () {
|
||||||
Notifications.off("clickSun", this.clickSun);
|
cc.fx.Notifications.off("clickSun", this.clickSun);
|
||||||
}
|
}
|
||||||
update (dt) {
|
update (dt) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
|
|
||||||
import GameData from "./module/Config/GameData";
|
|
||||||
import { GameTool } from "./module/Tool/GameTool";
|
|
||||||
const {ccclass, property} = cc._decorator;
|
const {ccclass, property} = cc._decorator;
|
||||||
|
|
||||||
@ccclass
|
@ccclass
|
||||||
|
@ -25,11 +23,11 @@ export default class NewClass extends cc.Component {
|
||||||
selfData: any;
|
selfData: any;
|
||||||
// onLoad () {}
|
// onLoad () {}
|
||||||
start () {
|
start () {
|
||||||
this.count.string = GameData._instance.GM_INFO.total;
|
this.count.string = cc.fx.GameConfig.GM_INFO.total + "";
|
||||||
if(GameData._instance.GM_INFO.mean_Time > 10){
|
if(cc.fx.GameConfig.GM_INFO.mean_Time > 10){
|
||||||
GameData._instance.GM_INFO.mean_Time = (parseInt(Math.random()*10+"")+5)/10
|
cc.fx.GameConfig.GM_INFO.mean_Time = (parseInt(Math.random()*10+"")+5)/10
|
||||||
}
|
}
|
||||||
this.time.string = GameData._instance.GM_INFO.mean_Time + "s";
|
this.time.string = cc.fx.GameConfig.GM_INFO.mean_Time + "s";
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
//初始化数据
|
//初始化数据
|
||||||
|
@ -57,13 +55,13 @@ export default class NewClass extends cc.Component {
|
||||||
let dataFile = {
|
let dataFile = {
|
||||||
length:5
|
length:5
|
||||||
}
|
}
|
||||||
GameTool.getRank(dataFile,data =>this.getRankData(data));
|
cc.fx.GameTool.getRank(dataFile,data =>this.getRankData(data));
|
||||||
}
|
}
|
||||||
//设置排行信息
|
//设置排行信息
|
||||||
getRankData(data){
|
getRankData(data){
|
||||||
if(data){
|
if(data){
|
||||||
GameTool.getRankData(data,this,4);
|
cc.fx.GameTool.getRankData(data,this,4);
|
||||||
GameTool.setPic(this.selfNode.getChildByName("pic").getChildByName("icon"),this.selfData.pic);
|
cc.fx.GameTool.setPic(this.selfNode.getChildByName("pic").getChildByName("icon"),this.selfData.pic);
|
||||||
for(let i=0;i<=4;i++){
|
for(let i=0;i<=4;i++){
|
||||||
this.setRank(i,this.listData[i]);
|
this.setRank(i,this.listData[i]);
|
||||||
}
|
}
|
||||||
|
@ -89,10 +87,10 @@ export default class NewClass extends cc.Component {
|
||||||
}
|
}
|
||||||
if(hitNode){
|
if(hitNode){
|
||||||
hitNode.active = true;
|
hitNode.active = true;
|
||||||
GameTool.subName(data.nickName,4);
|
cc.fx.GameTool.subName(data.nickName,4);
|
||||||
hitNode.getChildByName("name").getComponent(cc.Label).string = data.nickName;
|
hitNode.getChildByName("name").getComponent(cc.Label).string = data.nickName;
|
||||||
hitNode.getChildByName("total").getComponent(cc.Label).string = data.totalSunCount;
|
hitNode.getChildByName("total").getComponent(cc.Label).string = data.totalSunCount;
|
||||||
GameTool.setPic(hitNode.getChildByName("pic").getChildByName("icon"),data.pic);
|
cc.fx.GameTool.setPic(hitNode.getChildByName("pic").getChildByName("icon"),data.pic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
//此页面为引导页面,后续更新成模板,暂时偷懒复制主游戏场景代码进来
|
//此页面为引导页面,后续更新成模板,暂时偷懒复制主游戏场景代码进来
|
||||||
|
|
||||||
import GameData from './module/Config/GameData';
|
|
||||||
import AudioManager from './module/Music/AudioManager';
|
|
||||||
import { Notifications } from './module/Notification/Notification';
|
|
||||||
|
|
||||||
const {ccclass, property} = cc._decorator;
|
const {ccclass, property} = cc._decorator;
|
||||||
@ccclass
|
@ccclass
|
||||||
export default class NewClass extends cc.Component {
|
export default class NewClass extends cc.Component {
|
||||||
|
@ -25,7 +21,7 @@ export default class NewClass extends cc.Component {
|
||||||
// onLoad () {}
|
// onLoad () {}
|
||||||
|
|
||||||
start () {
|
start () {
|
||||||
GameData._instance.GM_INFO.custom = 0;
|
cc.fx.GameConfig.GM_INFO.custom = 0;
|
||||||
this.init();
|
this.init();
|
||||||
this.startGuide(0);
|
this.startGuide(0);
|
||||||
}
|
}
|
||||||
|
@ -207,14 +203,14 @@ export default class NewClass extends cc.Component {
|
||||||
clickSun(data){
|
clickSun(data){
|
||||||
if(this.begin == true){
|
if(this.begin == true){
|
||||||
if(data == this.clickNow){
|
if(data == this.clickNow){
|
||||||
AudioManager._instance.playAudioButton();
|
cc.fx.AudioManager.Instance.playAudioButton();
|
||||||
if(this.clickNow > 0){
|
if(this.clickNow > 0){
|
||||||
this.createLine(cc.v2(this.ball_Array[this.clickNow-1].x,this.ball_Array[this.clickNow-1].y),
|
this.createLine(cc.v2(this.ball_Array[this.clickNow-1].x,this.ball_Array[this.clickNow-1].y),
|
||||||
cc.v2(this.ball_Array[this.clickNow].x,this.ball_Array[this.clickNow].y),
|
cc.v2(this.ball_Array[this.clickNow].x,this.ball_Array[this.clickNow].y),
|
||||||
0.2);
|
0.2);
|
||||||
}
|
}
|
||||||
this.clickNow += 1;
|
this.clickNow += 1;
|
||||||
GameData._instance.GM_INFO.total += 1;
|
cc.fx.GameConfig.GM_INFO.total += 1;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if(this.ball_Array[this.clickNow-1])
|
if(this.ball_Array[this.clickNow-1])
|
||||||
this.ball_Array[this.clickNow-1].getChildByName("guang").active = false;
|
this.ball_Array[this.clickNow-1].getChildByName("guang").active = false;
|
||||||
|
@ -231,7 +227,7 @@ export default class NewClass extends cc.Component {
|
||||||
//失败事件
|
//失败事件
|
||||||
loseLevel(){
|
loseLevel(){
|
||||||
this.begin = false;
|
this.begin = false;
|
||||||
AudioManager._instance.playWarning();
|
cc.fx.AudioManager.Instance.playWarning();
|
||||||
this.destroyLine();
|
this.destroyLine();
|
||||||
let ball = this.ball_Array[0];
|
let ball = this.ball_Array[0];
|
||||||
for(let k=1; k< this.ball_Array.length; k++){
|
for(let k=1; k< this.ball_Array.length; k++){
|
||||||
|
@ -302,10 +298,10 @@ export default class NewClass extends cc.Component {
|
||||||
return -angle;
|
return -angle;
|
||||||
}
|
}
|
||||||
onEnable () {
|
onEnable () {
|
||||||
Notifications.on("clickSun", this.clickSun, this);
|
cc.fx.Notifications.on("clickSun", this.clickSun, this);
|
||||||
}
|
}
|
||||||
onDisable () {
|
onDisable () {
|
||||||
Notifications.off("clickSun", this.clickSun);
|
cc.fx.Notifications.off("clickSun", this.clickSun);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
|
|
||||||
const {ccclass, property, requireComponent} = cc._decorator;
|
const {ccclass, property, requireComponent} = cc._decorator;
|
||||||
|
|
||||||
import GameData from "./module/Config/GameData";
|
|
||||||
import { GameTool } from "./module/Tool/GameTool";
|
|
||||||
|
|
||||||
@ccclass
|
@ccclass
|
||||||
export default class NewClass extends cc.Component {
|
export default class NewClass extends cc.Component {
|
||||||
|
|
||||||
start () {
|
start () {
|
||||||
GameTool.Authentication();
|
window.initMgr();
|
||||||
|
cc.fx.GameTool.Authentication();
|
||||||
|
cc.fx.GameConfig.init();
|
||||||
|
cc.fx.AudioManager.Instance.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
//开始游戏,跳转至引导页面
|
//开始游戏,跳转至引导页面
|
||||||
|
@ -17,7 +16,7 @@ export default class NewClass extends cc.Component {
|
||||||
}
|
}
|
||||||
//备用,用来测试跳转 指定关卡
|
//备用,用来测试跳转 指定关卡
|
||||||
clickBtn(event,data){
|
clickBtn(event,data){
|
||||||
GameData._instance.GM_INFO.custom = parseInt(data);
|
cc.fx.GameConfig.GM_INFO.custom = parseInt(data);
|
||||||
cc.director.loadScene("GameScene");
|
cc.director.loadScene("GameScene");
|
||||||
}
|
}
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
|
|
||||||
import GameData from "./module/Config/GameData";
|
|
||||||
import List from "./module/RankList/List";
|
import List from "./module/RankList/List";
|
||||||
import { GameTool } from "./module/Tool/GameTool";
|
|
||||||
|
|
||||||
const { ccclass, property } = cc._decorator;
|
const { ccclass, property } = cc._decorator;
|
||||||
//排行榜
|
//排行榜
|
||||||
@ccclass
|
@ccclass
|
||||||
|
@ -43,13 +40,13 @@ export default class RankManager extends cc.Component {
|
||||||
let dataFile = {
|
let dataFile = {
|
||||||
length:100
|
length:100
|
||||||
}
|
}
|
||||||
GameTool.getRank(dataFile,data =>this.getRankData(data));
|
cc.fx.GameTool.getRank(dataFile,data =>this.getRankData(data));
|
||||||
}
|
}
|
||||||
//实际设置排行数据
|
//实际设置排行数据
|
||||||
getRankData(data){
|
getRankData(data){
|
||||||
if(data){
|
if(data){
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
GameTool.getRankData(data,this,6);
|
cc.fx.GameTool.getRankData(data,this,6);
|
||||||
this.setPic(this.selfData.pic);
|
this.setPic(this.selfData.pic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
const {ccclass, property} = cc._decorator;
|
const {ccclass, property} = cc._decorator;
|
||||||
import { Notifications } from './module/Notification/Notification';
|
|
||||||
|
|
||||||
@ccclass
|
@ccclass
|
||||||
export default class NewClass extends cc.Component {
|
export default class NewClass extends cc.Component {
|
||||||
id_Number:number
|
id_Number:number
|
||||||
|
@ -53,13 +51,13 @@ export default class NewClass extends cc.Component {
|
||||||
.start();
|
.start();
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
this.node.zIndex = -1;
|
this.node.zIndex = -1;
|
||||||
Notifications.emit("clickSun",this.id_Number);
|
cc.fx.Notifications.emit("clickSun",this.id_Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
this.node.zIndex = -1;
|
this.node.zIndex = -1;
|
||||||
Notifications.emit("clickSun",this.id_Number);
|
cc.fx.Notifications.emit("clickSun",this.id_Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -68,7 +66,7 @@ export default class NewClass extends cc.Component {
|
||||||
if( this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true){
|
if( this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true){
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
this.node.zIndex = -1;
|
this.node.zIndex = -1;
|
||||||
Notifications.emit("clickSun",this.id_Number);
|
cc.fx.Notifications.emit("clickSun",this.id_Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
328
assets/Script/module/Config/GameConfig.ts
Normal file
|
@ -0,0 +1,328 @@
|
||||||
|
|
||||||
|
|
||||||
|
const { ccclass, property } = cc._decorator;
|
||||||
|
@ccclass('GameConfig')
|
||||||
|
export class GameConfig {
|
||||||
|
//所有控制信息都通过GameAppStart内控制
|
||||||
|
private static _instance : GameConfig = null;
|
||||||
|
//用于盛放埋点数据上传,每次上传后清空
|
||||||
|
static GM_INFO: {
|
||||||
|
// isEnd: false,
|
||||||
|
mean_Time: number; //平均放箭速度
|
||||||
|
total: number; //总共对的个数
|
||||||
|
currSeed: number; //用于随机数种子
|
||||||
|
gameId: string; //游戏ID
|
||||||
|
userId: number; //用户ID
|
||||||
|
guide: boolean; //是否有引导
|
||||||
|
url: string; //访问域名
|
||||||
|
success: boolean; //用户游戏成功与否
|
||||||
|
matchId: any; //用于埋点上传的ID
|
||||||
|
custom: number; //用于测试跳关卡
|
||||||
|
};
|
||||||
|
static CLICK_DATA: {
|
||||||
|
type: number; //上传数据类型
|
||||||
|
success: boolean; //此局游戏胜负
|
||||||
|
round: number; //回合数
|
||||||
|
totalSunCount: number; //太阳总数
|
||||||
|
movedSunCount: number; //可移动太阳个数
|
||||||
|
sunSpeed: number; //太阳移动速度
|
||||||
|
overlapSunCount: number; //重叠太阳个数
|
||||||
|
colorList: any[]; //太阳颜色数组
|
||||||
|
duration: number; //每次点击的反应时间
|
||||||
|
difficultyLevel: number; //此次难度
|
||||||
|
sunList: any[]; //太阳数组,用于存放太阳类型 0:普通 1:移动 2:重叠
|
||||||
|
stepTimeList: any[]; //每次点击间隔
|
||||||
|
remainder: number; //游戏剩余时间
|
||||||
|
};
|
||||||
|
static LEVEL_INFO: { //第一难度
|
||||||
|
number: number; //太阳总数
|
||||||
|
moveNumber: number; //太阳可移动个数
|
||||||
|
moveSpeed: number; //太阳移动速度等级
|
||||||
|
maxDistance: number; //布局后移动最大距离
|
||||||
|
maxMove: number; //每个太阳之间距离最大间距
|
||||||
|
repeat: number; //是否重叠,现在0 不重叠 1 重叠1个
|
||||||
|
}[];
|
||||||
|
static GAME_DATA: any[];
|
||||||
|
|
||||||
|
|
||||||
|
static get Instance()
|
||||||
|
{
|
||||||
|
if (this._instance == null)
|
||||||
|
{
|
||||||
|
this._instance = new GameConfig();
|
||||||
|
}
|
||||||
|
return this._instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
static init(){
|
||||||
|
cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {
|
||||||
|
if (err) {
|
||||||
|
this.GM_INFO_init();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let jsonData: object = res.json!;
|
||||||
|
this.GM_INFO = jsonData["data"];
|
||||||
|
})
|
||||||
|
cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => {
|
||||||
|
if (err) {
|
||||||
|
this.CLICK_init();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let jsonData: object = res.json!;
|
||||||
|
this.CLICK_DATA = jsonData["data"];
|
||||||
|
})
|
||||||
|
cc.resources.load('Json/LEVEL_INFO', (err: any, res: cc.JsonAsset) => {
|
||||||
|
if (err) {
|
||||||
|
this.LEVEL_INFO_init();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let jsonData: object = res.json!;
|
||||||
|
this.LEVEL_INFO = jsonData["data"];
|
||||||
|
})
|
||||||
|
|
||||||
|
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
||||||
|
this.GAME_DATA = [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
//数据备用
|
||||||
|
static GM_INFO_init() {
|
||||||
|
this.GM_INFO = {
|
||||||
|
// isEnd: false,
|
||||||
|
mean_Time: 0, //平均放箭速度
|
||||||
|
total: 0, //总共对的个数
|
||||||
|
currSeed: 203213, //用于随机数种子
|
||||||
|
gameId: '100009', //游戏ID
|
||||||
|
userId: 0, //用户ID
|
||||||
|
guide: true, //是否有引导
|
||||||
|
url: "http://api.sparkus.cn",//访问域名
|
||||||
|
success: false, //用户游戏成功与否
|
||||||
|
matchId: null, //用于埋点上传的ID
|
||||||
|
custom: 0 //用于测试跳关卡
|
||||||
|
};
|
||||||
|
}
|
||||||
|
static CLICK_init() {
|
||||||
|
this.CLICK_DATA =
|
||||||
|
{
|
||||||
|
type: 1, //上传数据类型
|
||||||
|
success: false, //此局游戏胜负
|
||||||
|
round: 0, //回合数
|
||||||
|
totalSunCount: 0, //太阳总数
|
||||||
|
movedSunCount: 0, //可移动太阳个数
|
||||||
|
sunSpeed: 0, //太阳移动速度
|
||||||
|
overlapSunCount: 0, //重叠太阳个数
|
||||||
|
colorList: [], //太阳颜色数组
|
||||||
|
duration: 0, //每次点击的反应时间
|
||||||
|
difficultyLevel: 0, //此次难度
|
||||||
|
sunList: [], //太阳数组,用于存放太阳类型 0:普通 1:移动 2:重叠
|
||||||
|
stepTimeList: [], //每次点击间隔
|
||||||
|
remainder: 120 //游戏剩余时间
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static LEVEL_INFO_init() {
|
||||||
|
this.LEVEL_INFO = [
|
||||||
|
{ //第一难度
|
||||||
|
number: 3, //太阳总数
|
||||||
|
moveNumber: 0, //太阳可移动个数
|
||||||
|
moveSpeed: 0, //太阳移动速度等级
|
||||||
|
maxDistance: 200, //布局后移动最大距离
|
||||||
|
maxMove: 1200, //每个太阳之间距离最大间距
|
||||||
|
repeat: 0 //是否重叠,现在0 不重叠 1 重叠1个
|
||||||
|
},
|
||||||
|
{ //第二难度
|
||||||
|
number: 4,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 0,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第三难度
|
||||||
|
number: 4,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 0,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //第四难度
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 1,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第五难度
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //第六难度
|
||||||
|
number: 6,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //第七难度
|
||||||
|
number: 6,
|
||||||
|
moveNumber: 3,
|
||||||
|
moveSpeed: 4,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第八难度
|
||||||
|
number: 7,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 4,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第九难度
|
||||||
|
number: 7,
|
||||||
|
moveNumber: 3,
|
||||||
|
moveSpeed: 4,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第十难度
|
||||||
|
number: 7,
|
||||||
|
moveNumber: 3,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //第十一难度
|
||||||
|
number: 8,
|
||||||
|
moveNumber: 3,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第十二难度
|
||||||
|
number: 8,
|
||||||
|
moveNumber: 5,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //第十三难度
|
||||||
|
number: 9,
|
||||||
|
moveNumber: 3,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //第十四难度
|
||||||
|
number: 9,
|
||||||
|
moveNumber: 5,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //第十五难度
|
||||||
|
number: 10,
|
||||||
|
moveNumber: 5,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //11
|
||||||
|
number: 3,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //12
|
||||||
|
number: 4,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 0,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //13
|
||||||
|
number: 4,
|
||||||
|
moveNumber: 1,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //14
|
||||||
|
number: 4,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //15
|
||||||
|
number: 4,
|
||||||
|
moveNumber: 1,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //16
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 1,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 0
|
||||||
|
},
|
||||||
|
{ //17
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 0,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //18
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 1,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //19
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 2,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
},
|
||||||
|
{ //20
|
||||||
|
number: 5,
|
||||||
|
moveNumber: 3,
|
||||||
|
moveSpeed: 6,
|
||||||
|
maxDistance: 200,
|
||||||
|
maxMove: 1200,
|
||||||
|
repeat: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"ver": "1.1.0",
|
"ver": "1.1.0",
|
||||||
"uuid": "179c4e0b-d17f-4885-987b-872768befd1d",
|
"uuid": "c5692be7-8703-45e4-9f67-23b54d290356",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"isPlugin": false,
|
"isPlugin": false,
|
||||||
"loadPluginInWeb": true,
|
"loadPluginInWeb": true,
|
|
@ -1,282 +0,0 @@
|
||||||
|
|
||||||
const {ccclass, property} = cc._decorator;
|
|
||||||
@ccclass
|
|
||||||
export default class GameData extends cc.Component {
|
|
||||||
static _instance: any;
|
|
||||||
GM_INFO: {};
|
|
||||||
AudioManager: any;//音频管理
|
|
||||||
GAME_DATA: any[];//备用
|
|
||||||
LEVEL_INFO: { //第一难度
|
|
||||||
number: number; //太阳总数
|
|
||||||
moveNumber: number; //太阳可移动个数
|
|
||||||
moveSpeed: number; //太阳移动速度等级
|
|
||||||
maxDistance: number; //布局后移动最大距离
|
|
||||||
maxMove: number; //初始布局最大移动距离
|
|
||||||
repeat: number; //是否重叠,现在0 不重叠 1 重叠1个
|
|
||||||
}[];
|
|
||||||
//上报数据,有的游戏为一整局游戏一次上报,有的为每次操作上报
|
|
||||||
CLICK_DATA: { type: number; success: boolean; round: number; totalSunCount: number; movedSunCount: number; sunSpeed: number; overlapSunCount: number; colorList: any[]; duration: number; difficultyLevel: number; sunList: any[]; stepTimeList: any[]; remainder: number; };
|
|
||||||
|
|
||||||
onLoad () {
|
|
||||||
if (GameData._instance == null) {
|
|
||||||
GameData._instance = this;
|
|
||||||
cc.game.addPersistRootNode(this.node);
|
|
||||||
//设置为常驻,绑定音频以及游戏各类信息
|
|
||||||
this.AudioManager = this.node.getComponent('AudioManager');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.node.destroy();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
start () {
|
|
||||||
this.GM_INFO_init();
|
|
||||||
this.CLICK_init();
|
|
||||||
this.LEVEL_INFO_init();
|
|
||||||
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
|
||||||
this.GAME_DATA = [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
GM_INFO_init(){
|
|
||||||
this.GM_INFO = {
|
|
||||||
// isEnd: false,
|
|
||||||
mean_Time:0, //平均放箭速度
|
|
||||||
total:0, //总共对的个数
|
|
||||||
currSeed: 203213, //用于随机数种子
|
|
||||||
gameId:'100009',
|
|
||||||
userId:0,
|
|
||||||
guide:true, //是否有引导
|
|
||||||
url:"http://api.sparkus.cn",
|
|
||||||
success:false,
|
|
||||||
matchId:null,
|
|
||||||
custom: 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
CLICK_init(){
|
|
||||||
this.CLICK_DATA =
|
|
||||||
{
|
|
||||||
type:1,
|
|
||||||
success:false,
|
|
||||||
round:0,
|
|
||||||
totalSunCount:0,
|
|
||||||
movedSunCount:0,
|
|
||||||
sunSpeed:0,
|
|
||||||
overlapSunCount:0,
|
|
||||||
colorList:[],
|
|
||||||
duration:0,
|
|
||||||
difficultyLevel:0,
|
|
||||||
sunList:[],
|
|
||||||
stepTimeList:[],
|
|
||||||
remainder:120
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LEVEL_INFO_init(){
|
|
||||||
this.LEVEL_INFO = [
|
|
||||||
{ //第一难度
|
|
||||||
number:3, //太阳总数
|
|
||||||
moveNumber:0, //太阳可移动个数
|
|
||||||
moveSpeed:0, //太阳移动速度等级
|
|
||||||
maxDistance:200, //布局后移动最大距离
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0 //是否重叠,现在0 不重叠 1 重叠1个
|
|
||||||
|
|
||||||
},
|
|
||||||
{ //第二难度
|
|
||||||
number:4,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:0,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第三难度
|
|
||||||
number:4,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:0,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //第四难度
|
|
||||||
number:5,
|
|
||||||
moveNumber:1,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第五难度
|
|
||||||
number:5,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //第六难度
|
|
||||||
number:6,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //第七难度
|
|
||||||
number:6,
|
|
||||||
moveNumber:3,
|
|
||||||
moveSpeed:4,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第八难度
|
|
||||||
number:7,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:4,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第九难度
|
|
||||||
number:7,
|
|
||||||
moveNumber:3,
|
|
||||||
moveSpeed:4,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第十难度
|
|
||||||
number:7,
|
|
||||||
moveNumber:3,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //第十一难度
|
|
||||||
number:8,
|
|
||||||
moveNumber:3,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第十二难度
|
|
||||||
number:8,
|
|
||||||
moveNumber:5,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //第十三难度
|
|
||||||
number:9,
|
|
||||||
moveNumber:3,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //第十四难度
|
|
||||||
number:9,
|
|
||||||
moveNumber:5,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //第十五难度
|
|
||||||
number:10,
|
|
||||||
moveNumber:5,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //11
|
|
||||||
number:3,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //12
|
|
||||||
number:4,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:0,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //13
|
|
||||||
number:4,
|
|
||||||
moveNumber:1,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //14
|
|
||||||
number:4,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //15
|
|
||||||
number:4,
|
|
||||||
moveNumber:1,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //16
|
|
||||||
number:5,
|
|
||||||
moveNumber:1,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:0
|
|
||||||
},
|
|
||||||
{ //17
|
|
||||||
number:5,
|
|
||||||
moveNumber:0,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //18
|
|
||||||
number:5,
|
|
||||||
moveNumber:1,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //19
|
|
||||||
number:5,
|
|
||||||
moveNumber:2,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
},
|
|
||||||
{ //20
|
|
||||||
number:5,
|
|
||||||
moveNumber:3,
|
|
||||||
moveSpeed:6,
|
|
||||||
maxDistance:200,
|
|
||||||
maxMove:1200,
|
|
||||||
repeat:1
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
import { GameConfig } from "../Config/GameConfig";
|
||||||
|
import HttpUtil from "../Crypto/HttpUtil";
|
||||||
|
import { AudioManager } from "../Music/AudioManager";
|
||||||
|
import { Notifications } from "../Notification/Notification";
|
||||||
|
import { StorageMessage } from "../Storage/Storage";
|
||||||
|
import { GameTool } from "../Tool/GameTool";
|
||||||
|
|
||||||
window.initMgr = function() {
|
window.initMgr = function() {
|
||||||
if(cc.fx)
|
if(cc.fx)
|
||||||
{
|
{
|
||||||
|
@ -13,6 +20,15 @@ window.initMgr = function() {
|
||||||
isOnForeground: true //当前是否是在前台
|
isOnForeground: true //当前是否是在前台
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//应用系统信息
|
||||||
|
//配置文件
|
||||||
|
cc.fx.GameConfig = GameConfig;
|
||||||
|
cc.fx.HttpUtil = HttpUtil;
|
||||||
|
cc.fx.GameTool = GameTool;
|
||||||
|
cc.fx.AudioManager = AudioManager;
|
||||||
|
cc.fx.Notifications = Notifications;
|
||||||
|
cc.fx.StorageMessage = StorageMessage;
|
||||||
|
|
||||||
cc.fx.ShareInfo = {
|
cc.fx.ShareInfo = {
|
||||||
queryId : -1 //分享id
|
queryId : -1 //分享id
|
||||||
};
|
};
|
||||||
|
@ -46,51 +62,6 @@ window.initMgr = function() {
|
||||||
CoinRoomBankruptcy3: 'coinRoomBankruptcy3', // 金币桌破产
|
CoinRoomBankruptcy3: 'coinRoomBankruptcy3', // 金币桌破产
|
||||||
};
|
};
|
||||||
|
|
||||||
cc.fx.BurialShareConfig = {
|
|
||||||
invite:{
|
|
||||||
oneGroupDayCount:1//同一个群一天最多分享次数:超过次数将不再向服务器获取奖励,并且提醒用户分享到不同的群
|
|
||||||
},
|
|
||||||
FetchGroupID:{
|
|
||||||
oneGroupDayCount:1//同一个群一天最多分享次数:超过次数将不再向服务器获取奖励,并且提醒用户分享到不同的群
|
|
||||||
|
|
||||||
},
|
|
||||||
SegmentUp:{
|
|
||||||
painting :true, //升星分享指定为截屏分享模式
|
|
||||||
},
|
|
||||||
|
|
||||||
RankNotify:{ //排行榜分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
|
|
||||||
FTResult:{ //朋友桌结算分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
|
|
||||||
highRate:{ //高倍分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
|
|
||||||
matchResult:{ // 比赛结算分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
MatchFix5: { // 比赛结算分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
MatchFix20: { // 比赛结算分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
MatchFix100: { // 比赛结算分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
MatchFix500: { // 比赛结算分享
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
coinRoomWinStreak: {
|
|
||||||
painting :true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 分享到哪儿给奖励 group frined all
|
* 分享到哪儿给奖励 group frined all
|
||||||
*/
|
*/
|
||||||
|
@ -101,92 +72,30 @@ window.initMgr = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
//暂时不用
|
||||||
* 日志相关方法,若不符合项目组标准,可自行进行扩展
|
|
||||||
*/
|
|
||||||
|
|
||||||
cc.fx.OUTPUT_LOG = 1;
|
|
||||||
cc.fx.OUTPUT_INFO = 1 << 1;
|
|
||||||
cc.fx.OUTPUT_WARN = 1 << 2;
|
|
||||||
cc.fx.OUTPUT_ERR = 1 << 3;
|
|
||||||
cc.fx.OUTPUT_LV = cc.fx.OUTPUT_ERR | cc.fx.OUTPUT_WARN | cc.fx.OUTPUT_INFO | cc.fx.OUTPUT_LOG;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cc.fx.clickStatEventType = {
|
cc.fx.clickStatEventType = {
|
||||||
|
|
||||||
clickStatEventTypeVideoAD : 20173201,//视频播放完成
|
clickStatEventTypeVideoAD : 20173201,//视频播放完成
|
||||||
clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成
|
clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成
|
||||||
clickStatEventTypeBannerAD : 20173203,//banner播放为完成
|
clickStatEventTypeBannerAD : 20173203,//banner播放为完成
|
||||||
|
|
||||||
clickStatEventTypeUserFrom : 99990001,//用户来源
|
clickStatEventTypeUserFrom : 99990001,//用户来源
|
||||||
clickStatEventTypeShare : 99990002,//用户分享
|
clickStatEventTypeShare : 99990002,//用户分享
|
||||||
|
|
||||||
clickStatEventTypeClickAdBtn : 99990007,//点击分流icon
|
clickStatEventTypeClickAdBtn : 99990007,//点击分流icon
|
||||||
clickStatEventTypeBannerAD2 : 67890033, // banner广告干预
|
clickStatEventTypeBannerAD2 : 67890033, // banner广告干预
|
||||||
|
|
||||||
clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息
|
clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息
|
||||||
|
|
||||||
clickStatEventTypeClickFirstAd : 99990003, //分流icon显示
|
clickStatEventTypeClickFirstAd : 99990003, //分流icon显示
|
||||||
clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮
|
clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮
|
||||||
|
|
||||||
clickStatEventTypeWxLoginStart : 10001,//微信登录开始
|
clickStatEventTypeWxLoginStart : 10001,//微信登录开始
|
||||||
clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功
|
clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功
|
||||||
clickStatEventTypeWxLoginFailed : 10003,//微信登录失败
|
clickStatEventTypeWxLoginFailed : 10003,//微信登录失败
|
||||||
|
|
||||||
clickStatEventTypeAuthorizationStart : 10003,//授权开始
|
clickStatEventTypeAuthorizationStart : 10003,//授权开始
|
||||||
clickStatEventTypeAuthorizationSuccess : 10004,//授权成功
|
clickStatEventTypeAuthorizationSuccess : 10004,//授权成功
|
||||||
clickStatEventTypeAuthorizationFailed : 10005,//授权失败
|
clickStatEventTypeAuthorizationFailed : 10005,//授权失败
|
||||||
|
|
||||||
|
|
||||||
clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始
|
clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始
|
||||||
clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功
|
clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功
|
||||||
clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败
|
clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败
|
||||||
|
|
||||||
|
|
||||||
clickStatEventTypeTCP_Start : 10009,//TCP连接开始
|
clickStatEventTypeTCP_Start : 10009,//TCP连接开始
|
||||||
clickStatEventTypeTCP_Success : 10010,//TCP连接成功
|
clickStatEventTypeTCP_Success : 10010,//TCP连接成功
|
||||||
clickStatEventTypeTCP_Failed : 10011,//TCP连接失败
|
clickStatEventTypeTCP_Failed : 10011,//TCP连接失败
|
||||||
|
};
|
||||||
|
|
||||||
};
|
|
||||||
//应用系统信息
|
|
||||||
// cc.fx.SystemInfo = require("../BallSDK/BallSystemInfo");
|
|
||||||
// cc.fx.SystemInfo.init();
|
|
||||||
// cc.fx.EventType = require("../BallSDK/BallEventType");
|
|
||||||
// cc.fx.UserInfo = require("../BallGame/UserInfo");
|
|
||||||
// cc.fx.OutPut = require("../BallUtil/LogOutPut");
|
|
||||||
// cc.fx.HttpUtil= require("../BallSDK/BallHttpUtil");
|
|
||||||
// cc.fx.EncodeDecode = require("../BallUtil/BallEncodeDecode");
|
|
||||||
// cc.fx.NotificationCenter = require("../BallUtil/BallNotificationCenter");
|
|
||||||
// cc.fx.Timer = require("../BallUtil/BallTimer");
|
|
||||||
// cc.fx.Util = require("../BallUtil/BallUtil");
|
|
||||||
// cc.fx.TCPMSG = require("../BallSDK/BallTCP_Msg");
|
|
||||||
// cc.fx.TCPRECEIVER = require("../BallSDK/BallTCP_Receiver");
|
|
||||||
// cc.fx.TCPRECEIVER.init();
|
|
||||||
// cc.fx.Loader = require("../BallUtil/BallLoader");
|
|
||||||
// cc.fx.PopWindowManager = require("../BallWindow/BallPopWindonwManager");
|
|
||||||
// cc.fx.PopWindowManager.preload();
|
|
||||||
// cc.fx.TipManager = require("../BallWindow/TipWindowManager");
|
|
||||||
// cc.fx.PayModel = require("../BallModel/BallPayModel");
|
|
||||||
// cc.fx.SceneManager = require("../BallUtil/BallSceneManager");
|
|
||||||
// cc.fx.MapCheckPoint = require("../BallUtil/MapCheckPointManager");
|
|
||||||
// cc.fx.MapCheckPoint.initMapCheckPointBallInfo();
|
|
||||||
// cc.fx.MapPointScore = require("../BallCheckPoint/CheckPointScore");
|
|
||||||
// cc.fx.Storage = require('../BallUtil/BallStorage');
|
|
||||||
// if (cc.sys.isBrowser) {
|
|
||||||
// cc.fx.Storage = require('../BallUtil/BallStorage');
|
|
||||||
// } else {
|
|
||||||
// cc.fx.Storage = require('../BallUtil/WeChatStorage');
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// cc.fx.Gift = require("../BallModel/BallGiftBox");
|
|
||||||
|
|
||||||
|
|
||||||
// cc.fx.Invite = require('../BallModel/BallInvite');
|
|
||||||
// cc.fx.ClientConf = require("../BallModel/BallClientConf");
|
|
||||||
|
|
||||||
};
|
};
|
|
@ -1,12 +1,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { ccclass, property } = cc._decorator;
|
const { ccclass, property } = cc._decorator;
|
||||||
@ccclass
|
@ccclass('AudioManager')
|
||||||
export default class AudioManager extends cc.Component {
|
export class AudioManager {
|
||||||
static playWarning() {
|
|
||||||
throw new Error('Method not implemented.');
|
private static _instance : AudioManager = null;
|
||||||
}
|
|
||||||
//背景音乐
|
//背景音乐
|
||||||
@property(cc.AudioClip)
|
@property(cc.AudioClip)
|
||||||
audioGameBgm0: cc.AudioClip = null;
|
audioGameBgm0: cc.AudioClip = null;
|
||||||
|
@ -31,7 +29,10 @@ export default class AudioManager extends cc.Component {
|
||||||
finish: boolean;
|
finish: boolean;
|
||||||
rewardCount: number;
|
rewardCount: number;
|
||||||
mMusicKey: any;
|
mMusicKey: any;
|
||||||
static _instance: any;
|
|
||||||
|
static playWarning() {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
ctor () {
|
ctor () {
|
||||||
this.mAudioMap = {};
|
this.mAudioMap = {};
|
||||||
|
@ -74,21 +75,21 @@ export default class AudioManager extends cc.Component {
|
||||||
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);
|
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);
|
||||||
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);
|
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);
|
||||||
}
|
}
|
||||||
onLoad() {
|
|
||||||
|
|
||||||
if (AudioManager._instance == null) {
|
static get Instance()
|
||||||
AudioManager._instance = this;
|
{
|
||||||
cc.game.addPersistRootNode(this.node);
|
if (this._instance == null)
|
||||||
|
{
|
||||||
|
this._instance = new AudioManager();
|
||||||
}
|
}
|
||||||
else {
|
return this._instance;
|
||||||
this.node.destroy();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public init() {
|
||||||
this.reward = false;
|
this.reward = false;
|
||||||
this.finish = false;
|
this.finish = false;
|
||||||
this.rewardCount = 0;
|
this.rewardCount = 0;
|
||||||
this.ctor();
|
this.ctor();
|
||||||
|
|
||||||
this.preload();
|
this.preload();
|
||||||
}
|
}
|
||||||
preload () {
|
preload () {
|
||||||
|
@ -98,15 +99,6 @@ export default class AudioManager extends cc.Component {
|
||||||
this.audioGameBgm0,
|
this.audioGameBgm0,
|
||||||
];
|
];
|
||||||
musics.forEach(function(path) {
|
musics.forEach(function(path) {
|
||||||
// var musicPath = wxDownloader.REMOTE_SERVER_ROOT + path;
|
|
||||||
// if (musicPath != wxDownloader.REMOTE_SERVER_ROOT && musicPath.endsWith('.mp3')) {
|
|
||||||
// cc.loader.load(musicPath, function(err, remoteUrl) {
|
|
||||||
// if (err) {
|
|
||||||
// cc.error(err.message || err);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { GameTool } from "../Tool/GameTool";
|
|
||||||
import List, { ListType } from "./List";
|
import List, { ListType } from "./List";
|
||||||
|
|
||||||
const { ccclass, property } = cc._decorator;
|
const { ccclass, property } = cc._decorator;
|
||||||
|
@ -12,7 +12,7 @@ export default class ItemRender extends cc.Component {
|
||||||
|
|
||||||
/**数据改变时调用 */
|
/**数据改变时调用 */
|
||||||
public dataChanged(){
|
public dataChanged(){
|
||||||
GameTool.subName(this.data.name,6);
|
cc.fx.GameTool.subName(this.data.name,6);
|
||||||
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
|
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
|
||||||
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
|
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
|
||||||
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "";
|
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "";
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
|
|
||||||
import GameData from "../Config/GameData";
|
|
||||||
import HttpUtil from "../Crypto/HttpUtil";
|
|
||||||
import { StorageMessage } from "../Storage/Storage";
|
|
||||||
|
|
||||||
//最大工具类 各种公共方法,以及处理上传,获取后端接口数据
|
//最大工具类 各种公共方法,以及处理上传,获取后端接口数据
|
||||||
var GameTool = {
|
var GameTool = {
|
||||||
_startTime: 0,
|
_startTime: 0,
|
||||||
|
@ -10,60 +6,60 @@ var GameTool = {
|
||||||
_totalTime: 0,
|
_totalTime: 0,
|
||||||
//获取userId
|
//获取userId
|
||||||
Authentication(){
|
Authentication(){
|
||||||
let name = "user_" + GameData._instance.GM_INFO.gameId;
|
let name = "user_" + cc.fx.GameConfig.GM_INFO.gameId;
|
||||||
var data = JSON.parse(localStorage.getItem(name));
|
var data = JSON.parse(localStorage.getItem(name));
|
||||||
if(data == "undifend" || data==null || data == ""){
|
if(data == "undifend" || data==null || data == ""){
|
||||||
let url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
|
let url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
StorageMessage.setStorage(name,data);
|
cc.fx.StorageMessage.setStorage(name,data);
|
||||||
GameData._instance.GM_INFO.userId = parseInt(data.userId);
|
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//埋点上传
|
//埋点上传
|
||||||
setGameData(){
|
setGameData(){
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
GameData._instance.GAME_DATA = [];
|
cc.fx.GameConfig.GAME_DATA = [];
|
||||||
GameData._instance.GAME_DATA.push(GameData._instance.CLICK_DATA);
|
cc.fx.GameConfig.GAME_DATA.push(cc.fx.GameConfig.CLICK_DATA);
|
||||||
GameData._instance.CLICK_init();
|
cc.fx.GameConfig.CLICK_init();
|
||||||
let data = GameData._instance.GAME_DATA;
|
let data = cc.fx.GameConfig.GAME_DATA;
|
||||||
let matchId = this.getMatchId();
|
let matchId = this.getMatchId();
|
||||||
let postData = {
|
let postData = {
|
||||||
"gameId":GameData._instance.GM_INFO.gameId,
|
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId":GameData._instance.GM_INFO.userId,
|
"userId":cc.fx.GameConfig.GM_INFO.userId,
|
||||||
"matchId":matchId,
|
"matchId":matchId,
|
||||||
"data": data
|
"data": data
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log("上传数据:")
|
// console.log("上传数据:")
|
||||||
HttpUtil.uploadUserLogData(postData,function(){})
|
cc.fx.HttpUtil.uploadUserLogData(postData,function(){})
|
||||||
},
|
},
|
||||||
//上传排行榜 type为1
|
//上传排行榜 type为1
|
||||||
setRank(data){
|
setRank(data){
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
let postData = {
|
let postData = {
|
||||||
"gameId":GameData._instance.GM_INFO.gameId,
|
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId":GameData._instance.GM_INFO.userId,
|
"userId":cc.fx.GameConfig.GM_INFO.userId,
|
||||||
"type":1,
|
"type":1,
|
||||||
"reactionTime": data,
|
"reactionTime": data,
|
||||||
"totalSunCount": GameData._instance.GM_INFO.total,
|
"totalSunCount": cc.fx.GameConfig.GM_INFO.total,
|
||||||
"success": GameData._instance.GM_INFO.success
|
"success": cc.fx.GameConfig.GM_INFO.success
|
||||||
};
|
};
|
||||||
HttpUtil.rankData(1,function(){},postData);
|
cc.fx.HttpUtil.rankData(1,function(){},postData);
|
||||||
},
|
},
|
||||||
//获取排行榜 type为2
|
//获取排行榜 type为2
|
||||||
getRank(data,callback){
|
getRank(data,callback){
|
||||||
let rankLength = data.length;
|
let rankLength = data.length;
|
||||||
let postData = {
|
let postData = {
|
||||||
"gameId":GameData._instance.GM_INFO.gameId,
|
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId":GameData._instance.GM_INFO.userId,
|
"userId":cc.fx.GameConfig.GM_INFO.userId,
|
||||||
"page":1,
|
"page":1,
|
||||||
"pageSize":rankLength
|
"pageSize":rankLength
|
||||||
};
|
};
|
||||||
//回调进getRankData
|
//回调进getRankData
|
||||||
HttpUtil.rankData(2,data =>{callback(data)},postData);
|
cc.fx.HttpUtil.rankData(2,data =>{callback(data)},postData);
|
||||||
},
|
},
|
||||||
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
||||||
getMatchId (){
|
getMatchId (){
|
||||||
|
@ -81,7 +77,7 @@ var GameTool = {
|
||||||
char += 1;
|
char += 1;
|
||||||
}
|
}
|
||||||
matchId = matchId.slice(0, 10) + char + "";
|
matchId = matchId.slice(0, 10) + char + "";
|
||||||
GameData._instance.GM_INFO.matchId = matchId;
|
cc.fx.GameConfig.GM_INFO.matchId = matchId;
|
||||||
cc.sys.localStorage.setItem("matchId",matchId);
|
cc.sys.localStorage.setItem("matchId",matchId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +105,7 @@ var GameTool = {
|
||||||
let data = uuidArray.join('') + 1 + "";
|
let data = uuidArray.join('') + 1 + "";
|
||||||
cc.sys.localStorage.setItem("matchNumber",1);
|
cc.sys.localStorage.setItem("matchNumber",1);
|
||||||
cc.sys.localStorage.setItem("matchId",data);
|
cc.sys.localStorage.setItem("matchId",data);
|
||||||
GameData._instance.GM_INFO.matchId = data;
|
cc.fx.GameConfig.GM_INFO.matchId = data;
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
//截取名字
|
//截取名字
|
||||||
|
@ -154,18 +150,20 @@ var GameTool = {
|
||||||
target.selfData = data.data.info;
|
target.selfData = data.data.info;
|
||||||
let rankData = [];
|
let rankData = [];
|
||||||
let self = false;
|
let self = false;
|
||||||
GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"),target.selfData.pic);
|
cc.fx.GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"),target.selfData.pic);
|
||||||
for(let i=0;i<=target.listData.length-1;i++){
|
for(let i=0;i<=target.listData.length-1;i++){
|
||||||
rankData.push({rank:(i+1), name:target.listData[i].nickName, total:target.listData[i].totalSunCount, pic:target.listData[i].pic});
|
rankData.push({rank:(i+1), name:target.listData[i].nickName, total:target.listData[i].totalSunCount, pic:target.listData[i].pic});
|
||||||
if(GameData._instance.GM_INFO.userId == target.listData[i].userId){
|
if(cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId){
|
||||||
self = true;
|
self = true;
|
||||||
|
target.rankNumber = i;
|
||||||
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string =(i+1) + "";
|
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string =(i+1) + "";
|
||||||
}
|
}
|
||||||
if(i == (target.listData.length-1) && self == false){
|
if(i == (target.listData.length-1) && self == false){
|
||||||
|
target.rankNumber = i;
|
||||||
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = "99+";
|
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = "99+";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameTool.subName(target.selfData.nickName,nameLength);
|
cc.fx.GameTool.subName(target.selfData.nickName,nameLength);
|
||||||
target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
|
target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
|
||||||
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.totalSunCount;
|
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.totalSunCount;
|
||||||
switch(target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string){
|
switch(target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string){
|
||||||
|
@ -197,7 +195,7 @@ var GameTool = {
|
||||||
},
|
},
|
||||||
//判断全面屏适配
|
//判断全面屏适配
|
||||||
setFit: function (canvas) {
|
setFit: function (canvas) {
|
||||||
let flag = GameTool.getSetScreenResolutionFlag();
|
let flag = cc.fx.GameTool.getSetScreenResolutionFlag();
|
||||||
if (flag) {
|
if (flag) {
|
||||||
// console.log("不是全面屏");
|
// console.log("不是全面屏");
|
||||||
} else {
|
} else {
|
||||||
|
|
13
assets/resources/Json.meta
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"ver": "1.1.3",
|
||||||
|
"uuid": "ff9e9b41-3a4c-4198-b442-6a4a1646297d",
|
||||||
|
"importer": "folder",
|
||||||
|
"isBundle": false,
|
||||||
|
"bundleName": "",
|
||||||
|
"priority": 1,
|
||||||
|
"compressionType": {},
|
||||||
|
"optimizeHotUpdate": {},
|
||||||
|
"inlineSpriteFrames": {},
|
||||||
|
"isRemoteBundle": {},
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
18
assets/resources/Json/CLICK_DATA.json
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"data" :
|
||||||
|
{
|
||||||
|
"type": 1,
|
||||||
|
"success": false,
|
||||||
|
"round": 0,
|
||||||
|
"totalSunCount": 0,
|
||||||
|
"movedSunCount": 0,
|
||||||
|
"sunSpeed": 0,
|
||||||
|
"overlapSunCount": 0,
|
||||||
|
"colorList": [],
|
||||||
|
"duration": 0,
|
||||||
|
"difficultyLevel": 0,
|
||||||
|
"sunList": [],
|
||||||
|
"stepTimeList": [],
|
||||||
|
"remainder": 120
|
||||||
|
}
|
||||||
|
}
|
6
assets/resources/Json/CLICK_DATA.json.meta
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"ver": "1.0.2",
|
||||||
|
"uuid": "e1d57e63-4f2f-467d-9c55-0a889d5533a8",
|
||||||
|
"importer": "json",
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
14
assets/resources/Json/GM_INFO.json
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"mean_Time": 0,
|
||||||
|
"total": 0,
|
||||||
|
"currSeed": 203213,
|
||||||
|
"gameId": 100009,
|
||||||
|
"userId": 0,
|
||||||
|
"guide": true,
|
||||||
|
"url": "http://api.sparkus.cn",
|
||||||
|
"success": false,
|
||||||
|
"matchId": null,
|
||||||
|
"custom": 0
|
||||||
|
}
|
||||||
|
}
|
6
assets/resources/Json/GM_INFO.json.meta
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"ver": "1.0.2",
|
||||||
|
"uuid": "2d69a479-18ec-4787-b35f-e9a9b3247435",
|
||||||
|
"importer": "json",
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
205
assets/resources/Json/LEVEL_INFO.json
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
{
|
||||||
|
"data" : [
|
||||||
|
{
|
||||||
|
"number": 3,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 6,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 6,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 4,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 7,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 4,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 7,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 4,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 7,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 8,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 8,
|
||||||
|
"moveNumber": 5,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 9,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 9,
|
||||||
|
"moveNumber": 5,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 10,
|
||||||
|
"moveNumber": 5,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 3,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 2,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
6
assets/resources/Json/LEVEL_INFO.json.meta
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"ver": "1.0.2",
|
||||||
|
"uuid": "2cddbdcb-5dba-4b13-960c-9ebe6d17a7db",
|
||||||
|
"importer": "json",
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
1
build/Sun_moves/assets/internal/config.52d36.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"paths":{"1":["effects/builtin-2d-gray-sprite",0],"2":["effects/builtin-2d-sprite",0],"3":["materials/builtin-unlit",1],"4":["effects/builtin-3d-trail",0],"5":["effects/builtin-2d-graphics",0],"6":["materials/builtin-2d-gray-sprite",1],"7":["materials/builtin-3d-trail",1],"8":["effects/builtin-unlit",0],"9":["materials/builtin-2d-base",1],"10":["materials/builtin-2d-graphics",1],"11":["effects/builtin-clear-stencil",0],"12":["materials/builtin-clear-stencil",1],"13":["materials/builtin-2d-label",1],"14":["materials/builtin-2d-sprite",1],"15":["effects/builtin-2d-label",0]},"types":["cc.EffectAsset","cc.Material"],"uuids":["02delMVqdBD70a/HSD99FK","14TDKXr2NJ6LjvHPops74o","28dPjdQWxEQIG3VVl1Qm6T","2aKWBXJHxKHLvrBUi2yYZQ","2afAA24LNP4YmYiaVLiivs","30aC+Hnw1PF4pEcoY3kUYb","3ae7efMv1CLq2ilvUY/tQi","46bU+b5fROqIXVPG6aZWWK","6dkeWRTOBGXICfYQ7JUBnG","6fgBCSDDdPMInvyNlggls2","a1U5RdJRFMFL57BdJC9H1X","c0BAyVxX9JzZy8EjFrc9DU","cffgu4qBxEqa150o1DmRAy","e0LYfU5ZlNFoAB4UiRrGUG","ecpdLyjvZBwrvm+cedCcQy","f1h0LXVtJOta5JLZ1xCzfI"],"scenes":{},"redirect":[],"deps":[],"packs":{"05464a930":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]},"name":"internal","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false,"versions":{"import":["05464a930","3c4b0"],"native":[0,"cea68"]}}
|
|
@ -1 +0,0 @@
|
||||||
{"paths":{"0":["effects/builtin-2d-gray-sprite",0],"1":["effects/builtin-2d-sprite",0],"2":["materials/builtin-unlit",1],"3":["effects/builtin-3d-trail",0],"4":["effects/builtin-2d-graphics",0],"5":["materials/builtin-2d-gray-sprite",1],"6":["materials/builtin-3d-trail",1],"7":["effects/builtin-unlit",0],"8":["materials/builtin-2d-base",1],"9":["materials/builtin-2d-graphics",1],"10":["effects/builtin-clear-stencil",0],"11":["materials/builtin-clear-stencil",1],"12":["materials/builtin-2d-label",1],"13":["materials/builtin-2d-sprite",1],"14":["effects/builtin-2d-label",0]},"types":["cc.EffectAsset","cc.Material"],"uuids":["14TDKXr2NJ6LjvHPops74o","28dPjdQWxEQIG3VVl1Qm6T","2aKWBXJHxKHLvrBUi2yYZQ","2afAA24LNP4YmYiaVLiivs","30aC+Hnw1PF4pEcoY3kUYb","3ae7efMv1CLq2ilvUY/tQi","46bU+b5fROqIXVPG6aZWWK","6dkeWRTOBGXICfYQ7JUBnG","6fgBCSDDdPMInvyNlggls2","a1U5RdJRFMFL57BdJC9H1X","c0BAyVxX9JzZy8EjFrc9DU","cffgu4qBxEqa150o1DmRAy","e0LYfU5ZlNFoAB4UiRrGUG","ecpdLyjvZBwrvm+cedCcQy","f1h0LXVtJOta5JLZ1xCzfI","02delMVqdBD70a/HSD99FK"],"scenes":{},"redirect":[],"deps":[],"packs":{"05464a930":[15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]},"name":"internal","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
|
|
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 82 B |
1
build/Sun_moves/assets/main/config.bc51b.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"paths":{},"types":[],"uuids":["a2MjXRFdtLlYQ5ouAFv/+R","14K23Xm1ROrrsGMBKG1Ql4","1fwAIEeM1Nn7i705Pdg5L5","29FYIk+N1GYaeWH/q1NxQO","29G9ngwKpNW56EfZdKv0SX","2dL3kvpAxJu6GJ7RdqJG5J","37ND3actNCqZoLzr1NBiTF","48Foz8zQZDfLObHQegvteG","4bnFp+xkVIpJrKXfOBzk71","4er1GLNexCYpKNTUl8Pygw","59MsqY7oZEy71JeUeyyS/Z","61cyPdEfRN047sDK9rO0W5","63m/tYswFOS7sCMuQGQ4kn","651MDCXIFPuZKQK1+nWOzk","71VhFCTINJM6/Ky3oX9nBT","77SCm7Ej5ItpMOaz4CSRUG","93XHrCUNdAwJfBzyLGAOJ5","9cCAYtTPFLbqi6SjiBzH59","adrVhydQhMD7nhiXljhNId","b4P/PCArtIdIH38t6mlw8Y","d3OhOXdm5P4JNse7X8GMGe","d608qFRoFHwbXd0Dap056i","d8HsitJHxOYqo801xBk8ev","e8Ueib+qJEhL6mXAHdnwbi","e97GVMl6JHh5Ml5qEDdSGa","eezChet5VG27PW9q3qdOpv","f0BIwQ8D5Ml7nTNQbh1YlS","f7ZJEQGfdJraVAIIAn8NFW","02delMVqdBD70a/HSD99FK","08/X0iIrpGHbKJqlQlA512","0cF7COgzlFRKaDnaVJrOOt","13EQ5PNYdOa4gRDKFsrIFJ","167IfY0HdDyZdtlLDeaDkg","27FeLB8OpGcaDrf9NiEDKz","28Gg0A8X1JHpYnbH9vZIzV","2aJVC/rshLnpvG+lkallqC","2cyTcZvcZP7rjmchhWREEu","3aIyOI2NxPeaHqgvY4W3zi","3fgys9roZKo5OdfZn0T4Fo","432ND8vGNFM4/Pxt+hVLkb","4cuYcoe7tPiIdp6gbSnrvF","4c7tzGCVNKE5yvOmzu4CXt","57X2D8NaxKHZ7D/uwxGBCK","59Sn0ZhhJHf7HX55ZqGeqE","5aBm0rBa9Gxr8lWEiz8nAb","5bsctimnBNw4onIGVsCfsU","5cO7kybDxGj4ipyMYdRYZB","5eUVg3ZQ5FhKCJ4qAl42w5","5f5dyqtRNNxaFmVzYns6FZ","61c+AvZ7lJH4DcNNAnJ//N","6cyjAC9cJDE6x1PK28Td4v","6eoolBkxxPvof0z1pzKU+w","70mY8jP3NKVonyvxI9/f6z","818w6dGPRH+rXb8KDTjDgq","8cv+mgkU9OTIB7sHOwnyZ8","8eo+QfsThNk7a0r8Ilro8q","95AC/gHlpJ64LEYVdSIIPB","95viAf/CZABIBJ7iCjDOU4","99vgruzGRMmJOIRLdPaQYs","9bvaMerUlDyary99mJa6xp","9cBsd3MbFMC56GS/sJnS6r","9e4xLWF9hCBq5CM6vIyvlp","a5+/rf9ZlPEIXTSsUOhw7T","adR/bBScVC/bM24V3TdrfL","adULT7sm1JR6vTV/oW1JIb","bcITWltAtAD4sUjinM7HdJ","c6VxSCRHRB+qS91aK866px","ceNMgtpZhCsKd8anXNKd7b","d1MjdySrJFJ70gUB/k+5cj","d7kiZgBYNPyIwqRjgGX7l0","ddnWn8vDxCOZaOnG9OVNnP","deq5vhWmZCFJ97k3T54cZ0","e82yVDavlBc6NpbK/tA6Dr","ecpdLyjvZBwrvm+cedCcQy","f1O5RoDlhGrI6+/w3NObrX"],"scenes":{"db://assets/Scene/GameScene.fire":9,"db://assets/Scene/GuideScene.fire":15,"db://assets/Scene/LoadScene.fire":17,"db://assets/Scene/OverScene.fire":8,"db://assets/Scene/RankScene.fire":5},"redirect":[28,0,29,1,30,1,32,1,33,1,35,1,36,1,39,1,44,1,45,1,49,1,50,1,52,1,54,1,55,1,56,1,57,1,58,1,60,1,61,1,62,1,64,1,65,1,66,1,67,1,69,1,71,1,73,0,74,1],"deps":["internal","resources"],"packs":{"03e4478d5":[2,4,7,10,11,12,13,14,16,18,19,21,22,23,25,27],"05b7e0d6d":[1,8,42],"05f3c1ca4":[6,15,0,68,20],"08a310280":[3,17,0,72,24,26],"0cd1ec7f1":[51,70],"0d7de01d8":[31,34,3,6,37,38,40,41,9,47,53,0,20,24,26],"0e0598680":[1,5,43,46,48,59,63]},"name":"main","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false,"versions":{"import":["03e4478d5","583f3","05b7e0d6d","b9828","05f3c1ca4","1b0a3","08a310280","529f3","0cd1ec7f1","718bb","0d7de01d8","334d7","0e0598680","68263"],"native":[2,"42c23",4,"6e8cb",7,"c8c0d",10,"d38b4",11,"6d707",12,"0828f",13,"618c7",14,"c06a9",16,"c0bdf",18,"2ac7c",19,"83fcc",21,"d55c2",22,"cdbc9",23,"90cf4",25,"40762",27,"27e3b"]}}
|
|
@ -1 +0,0 @@
|
||||||
{"paths":{},"types":[],"uuids":["a2MjXRFdtLlYQ5ouAFv/+R","14K23Xm1ROrrsGMBKG1Ql4","29FYIk+N1GYaeWH/q1NxQO","2dL3kvpAxJu6GJ7RdqJG5J","37ND3actNCqZoLzr1NBiTF","4bnFp+xkVIpJrKXfOBzk71","4er1GLNexCYpKNTUl8Pygw","77SCm7Ej5ItpMOaz4CSRUG","9cCAYtTPFLbqi6SjiBzH59","d3OhOXdm5P4JNse7X8GMGe","e97GVMl6JHh5Ml5qEDdSGa","f0BIwQ8D5Ml7nTNQbh1YlS","02delMVqdBD70a/HSD99FK","08/X0iIrpGHbKJqlQlA512","0cF7COgzlFRKaDnaVJrOOt","13EQ5PNYdOa4gRDKFsrIFJ","167IfY0HdDyZdtlLDeaDkg","1fwAIEeM1Nn7i705Pdg5L5","23CIt+PSBBMJopNtpbffXh","27FeLB8OpGcaDrf9NiEDKz","28Gg0A8X1JHpYnbH9vZIzV","29G9ngwKpNW56EfZdKv0SX","2aJVC/rshLnpvG+lkallqC","2cyTcZvcZP7rjmchhWREEu","3aIyOI2NxPeaHqgvY4W3zi","3fgys9roZKo5OdfZn0T4Fo","432ND8vGNFM4/Pxt+hVLkb","48Foz8zQZDfLObHQegvteG","4cuYcoe7tPiIdp6gbSnrvF","4c7tzGCVNKE5yvOmzu4CXt","57X2D8NaxKHZ7D/uwxGBCK","59MsqY7oZEy71JeUeyyS/Z","59Sn0ZhhJHf7HX55ZqGeqE","5aBm0rBa9Gxr8lWEiz8nAb","5bsctimnBNw4onIGVsCfsU","5cO7kybDxGj4ipyMYdRYZB","5eUVg3ZQ5FhKCJ4qAl42w5","5f5dyqtRNNxaFmVzYns6FZ","61cyPdEfRN047sDK9rO0W5","61c+AvZ7lJH4DcNNAnJ//N","63m/tYswFOS7sCMuQGQ4kn","651MDCXIFPuZKQK1+nWOzk","6cyjAC9cJDE6x1PK28Td4v","6eoolBkxxPvof0z1pzKU+w","70mY8jP3NKVonyvxI9/f6z","71VhFCTINJM6/Ky3oX9nBT","818w6dGPRH+rXb8KDTjDgq","8cv+mgkU9OTIB7sHOwnyZ8","8eZObX1ehJkKU3GR/hPgya","8eo+QfsThNk7a0r8Ilro8q","93XHrCUNdAwJfBzyLGAOJ5","95AC/gHlpJ64LEYVdSIIPB","95viAf/CZABIBJ7iCjDOU4","99vgruzGRMmJOIRLdPaQYs","9bvaMerUlDyary99mJa6xp","9cBsd3MbFMC56GS/sJnS6r","9e4xLWF9hCBq5CM6vIyvlp","a5+/rf9ZlPEIXTSsUOhw7T","adR/bBScVC/bM24V3TdrfL","adULT7sm1JR6vTV/oW1JIb","adrVhydQhMD7nhiXljhNId","b4P/PCArtIdIH38t6mlw8Y","bcITWltAtAD4sUjinM7HdJ","c6VxSCRHRB+qS91aK866px","ceNMgtpZhCsKd8anXNKd7b","d1MjdySrJFJ70gUB/k+5cj","d608qFRoFHwbXd0Dap056i","d7kiZgBYNPyIwqRjgGX7l0","d8HsitJHxOYqo801xBk8ev","ddnWn8vDxCOZaOnG9OVNnP","deq5vhWmZCFJ97k3T54cZ0","e7CzEDg/FMZpCTGJfBpdSu","e8Ueib+qJEhL6mXAHdnwbi","e82yVDavlBc6NpbK/tA6Dr","ecpdLyjvZBwrvm+cedCcQy","eezChet5VG27PW9q3qdOpv","f1O5RoDlhGrI6+/w3NObrX","f7ZJEQGfdJraVAIIAn8NFW"],"scenes":{"db://assets/Scene/GameScene.fire":6,"db://assets/Scene/GuideScene.fire":7,"db://assets/Scene/LoadScene.fire":8,"db://assets/Scene/OverScene.fire":5,"db://assets/Scene/RankScene.fire":3},"redirect":[12,0,13,1,14,1,16,1,19,1,22,1,23,1,26,1,33,1,34,1,39,1,42,1,44,1,47,1,49,1,51,1,52,1,53,1,55,1,56,1,57,1,59,1,62,1,63,1,64,1,67,1,70,1,74,0,76,1],"deps":["internal","resources"],"packs":{"01587c953":[18,2,48,8,0,71,73,10,11],"03e4478d5":[17,21,27,31,38,40,41,45,50,60,61,66,68,72,75,77],"05b7e0d6d":[1,5,30],"05f3c1ca4":[4,7,0,65,9],"0cd1ec7f1":[43,69],"0d7de01d8":[15,20,2,4,24,25,28,29,6,36,46,0,9,10,11],"0e0598680":[1,3,32,35,37,54,58]},"name":"main","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
|
|
1
build/Sun_moves/assets/main/index.bc51b.js
Normal file
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -40,8 +40,8 @@
|
||||||
<!--<link rel="apple-touch-icon" href=".png" />-->
|
<!--<link rel="apple-touch-icon" href=".png" />-->
|
||||||
<!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
|
<!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="style-mobile.css"/>
|
<link rel="stylesheet" type="text/css" href="style-mobile.0003a.css"/>
|
||||||
<link rel="icon" href="favicon.ico"/>
|
<link rel="icon" href="favicon.8de18.ico"/>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
|
@ -137,9 +137,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
|
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
|
||||||
<script src="src/settings.js" charset="utf-8"></script>
|
<script src="src/settings.eb3ab.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<script src="main.js" charset="utf-8"></script>
|
<script src="main.a9f4c.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js', function () {
|
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.2e4d7.js', function () {
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
loadScript(debug ? 'physics.js' : 'physics-min.js', window.boot);
|
loadScript(debug ? 'physics.js' : 'physics-min.js', window.boot);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ window.boot = function () {
|
||||||
if (window.jsb) {
|
if (window.jsb) {
|
||||||
var isRuntime = (typeof loadRuntime === 'function');
|
var isRuntime = (typeof loadRuntime === 'function');
|
||||||
if (isRuntime) {
|
if (isRuntime) {
|
||||||
require('src/settings.js');
|
require('src/settings.eb3ab.js');
|
||||||
require('src/cocos2d-runtime.js');
|
require('src/cocos2d-runtime.js');
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
require('src/physics.js');
|
require('src/physics.js');
|
||||||
|
@ -125,7 +125,7 @@ if (window.jsb) {
|
||||||
require('jsb-adapter/engine/index.js');
|
require('jsb-adapter/engine/index.js');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
require('src/settings.js');
|
require('src/settings.eb3ab.js');
|
||||||
require('src/cocos2d-jsb.js');
|
require('src/cocos2d-jsb.js');
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
require('src/physics.js');
|
require('src/physics.js');
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -1 +1 @@
|
||||||
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scene/LoadScene.fire",orientation:"portrait",jsList:[]};
|
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scene/LoadScene.fire",orientation:"portrait",jsList:[],bundleVers:{internal:"52d36",resources:"c9e69",main:"bc51b"}};
|
|
@ -61,7 +61,7 @@ p.footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
background: #171717 url(./splash.png) no-repeat center;
|
background: #171717 url(./splash.85cfd.png) no-repeat center;
|
||||||
background-size: 350px;
|
background-size: 350px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ p.footer {
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #171717 url(./splash.jpg) no-repeat center;
|
background: #171717 url(./splash.99e2c.jpg) no-repeat center;
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
} */
|
} */
|
||||||
|
|
2
creator.d.ts
vendored
|
@ -4,7 +4,7 @@ The main namespace of Cocos2d-JS, all engine core classes, functions, properties
|
||||||
!#zh
|
!#zh
|
||||||
Cocos 引擎的主要命名空间,引擎代码中所有的类,函数,属性和常量都在这个命名空间中定义。 */
|
Cocos 引擎的主要命名空间,引擎代码中所有的类,函数,属性和常量都在这个命名空间中定义。 */
|
||||||
interface Window {
|
interface Window {
|
||||||
initMgr: any;
|
initMgr: any; //控制全局信息
|
||||||
android: any; //全局变量名
|
android: any; //全局变量名
|
||||||
}
|
}
|
||||||
declare namespace cc {
|
declare namespace cc {
|
||||||
|
|
210
library/imports/2c/2cddbdcb-5dba-4b13-960c-9ebe6d17a7db.json
Normal file
|
@ -0,0 +1,210 @@
|
||||||
|
{
|
||||||
|
"__type__": "cc.JsonAsset",
|
||||||
|
"_name": "LEVEL_INFO",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_native": "",
|
||||||
|
"json": {
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"number": 3,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 6,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 6,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 4,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 7,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 4,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 7,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 4,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 7,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 8,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 8,
|
||||||
|
"moveNumber": 5,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 9,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 9,
|
||||||
|
"moveNumber": 5,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 10,
|
||||||
|
"moveNumber": 5,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 3,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 0,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 4,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 0,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 1,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 2,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"number": 5,
|
||||||
|
"moveNumber": 3,
|
||||||
|
"moveSpeed": 6,
|
||||||
|
"maxDistance": 200,
|
||||||
|
"maxMove": 1200,
|
||||||
|
"repeat": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
20
library/imports/2d/2d69a479-18ec-4787-b35f-e9a9b3247435.json
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"__type__": "cc.JsonAsset",
|
||||||
|
"_name": "GM_INFO",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_native": "",
|
||||||
|
"json": {
|
||||||
|
"data": {
|
||||||
|
"mean_Time": 0,
|
||||||
|
"total": 0,
|
||||||
|
"currSeed": 203213,
|
||||||
|
"gameId": 100009,
|
||||||
|
"userId": 0,
|
||||||
|
"guide": true,
|
||||||
|
"url": "http://api.sparkus.cn",
|
||||||
|
"success": false,
|
||||||
|
"matchId": null,
|
||||||
|
"custom": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,9 +24,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var GameData_1 = require("./module/Config/GameData");
|
|
||||||
var AudioManager_1 = require("./module/Music/AudioManager");
|
|
||||||
var Notification_1 = require("./module/Notification/Notification");
|
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var NewClass = /** @class */ (function (_super) {
|
var NewClass = /** @class */ (function (_super) {
|
||||||
__extends(NewClass, _super);
|
__extends(NewClass, _super);
|
||||||
|
@ -41,7 +38,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
// onLoad () {}
|
// onLoad () {}
|
||||||
NewClass.prototype.start = function () {
|
NewClass.prototype.start = function () {
|
||||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
cc.fx.GameConfig.GM_INFO.custom = 0;
|
||||||
this.init();
|
this.init();
|
||||||
this.startGuide(0);
|
this.startGuide(0);
|
||||||
};
|
};
|
||||||
|
@ -237,12 +234,12 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (this.begin == true) {
|
if (this.begin == true) {
|
||||||
if (data == this.clickNow) {
|
if (data == this.clickNow) {
|
||||||
AudioManager_1.default._instance.playAudioButton();
|
cc.fx.AudioManager.Instance.playAudioButton();
|
||||||
if (this.clickNow > 0) {
|
if (this.clickNow > 0) {
|
||||||
this.createLine(cc.v2(this.ball_Array[this.clickNow - 1].x, this.ball_Array[this.clickNow - 1].y), cc.v2(this.ball_Array[this.clickNow].x, this.ball_Array[this.clickNow].y), 0.2);
|
this.createLine(cc.v2(this.ball_Array[this.clickNow - 1].x, this.ball_Array[this.clickNow - 1].y), cc.v2(this.ball_Array[this.clickNow].x, this.ball_Array[this.clickNow].y), 0.2);
|
||||||
}
|
}
|
||||||
this.clickNow += 1;
|
this.clickNow += 1;
|
||||||
GameData_1.default._instance.GM_INFO.total += 1;
|
cc.fx.GameConfig.GM_INFO.total += 1;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (_this.ball_Array[_this.clickNow - 1])
|
if (_this.ball_Array[_this.clickNow - 1])
|
||||||
_this.ball_Array[_this.clickNow - 1].getChildByName("guang").active = false;
|
_this.ball_Array[_this.clickNow - 1].getChildByName("guang").active = false;
|
||||||
|
@ -260,7 +257,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
NewClass.prototype.loseLevel = function () {
|
NewClass.prototype.loseLevel = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.begin = false;
|
this.begin = false;
|
||||||
AudioManager_1.default._instance.playWarning();
|
cc.fx.AudioManager.Instance.playWarning();
|
||||||
this.destroyLine();
|
this.destroyLine();
|
||||||
var ball = this.ball_Array[0];
|
var ball = this.ball_Array[0];
|
||||||
var _loop_2 = function (k) {
|
var _loop_2 = function (k) {
|
||||||
|
@ -333,10 +330,10 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
return -angle;
|
return -angle;
|
||||||
};
|
};
|
||||||
NewClass.prototype.onEnable = function () {
|
NewClass.prototype.onEnable = function () {
|
||||||
Notification_1.Notifications.on("clickSun", this.clickSun, this);
|
cc.fx.Notifications.on("clickSun", this.clickSun, this);
|
||||||
};
|
};
|
||||||
NewClass.prototype.onDisable = function () {
|
NewClass.prototype.onDisable = function () {
|
||||||
Notification_1.Notifications.off("clickSun", this.clickSun);
|
cc.fx.Notifications.off("clickSun", this.clickSun);
|
||||||
};
|
};
|
||||||
__decorate([
|
__decorate([
|
||||||
property(cc.Node)
|
property(cc.Node)
|
||||||
|
|
|
@ -5,9 +5,6 @@ cc._RF.push(module, '43bfcJ6/25Fs4fHUE0PeBOX', 'GameTool');
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.GameTool = void 0;
|
exports.GameTool = void 0;
|
||||||
var GameData_1 = require("../Config/GameData");
|
|
||||||
var HttpUtil_1 = require("../Crypto/HttpUtil");
|
|
||||||
var Storage_1 = require("../Storage/Storage");
|
|
||||||
//最大工具类 各种公共方法,以及处理上传,获取后端接口数据
|
//最大工具类 各种公共方法,以及处理上传,获取后端接口数据
|
||||||
var GameTool = {
|
var GameTool = {
|
||||||
_startTime: 0,
|
_startTime: 0,
|
||||||
|
@ -15,57 +12,58 @@ var GameTool = {
|
||||||
_totalTime: 0,
|
_totalTime: 0,
|
||||||
//获取userId
|
//获取userId
|
||||||
Authentication: function () {
|
Authentication: function () {
|
||||||
var name = "user_" + GameData_1.default._instance.GM_INFO.gameId;
|
var name = "user_" + cc.fx.GameConfig.GM_INFO.gameId;
|
||||||
var data = JSON.parse(localStorage.getItem(name));
|
var data = JSON.parse(localStorage.getItem(name));
|
||||||
if (data == "undifend" || data == null || data == "") {
|
if (data == "undifend" || data == null || data == "") {
|
||||||
var url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
|
var url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Storage_1.StorageMessage.setStorage(name, data);
|
cc.fx.StorageMessage.setStorage(name, data);
|
||||||
GameData_1.default._instance.GM_INFO.userId = parseInt(data.userId);
|
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//埋点上传
|
//埋点上传
|
||||||
setGameData: function () {
|
setGameData: function () {
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
GameData_1.default._instance.GAME_DATA = [];
|
cc.fx.GameConfig.GAME_DATA = [];
|
||||||
GameData_1.default._instance.GAME_DATA.push(GameData_1.default._instance.CLICK_DATA);
|
cc.fx.GameConfig.GAME_DATA.push(cc.fx.GameConfig.CLICK_DATA);
|
||||||
GameData_1.default._instance.CLICK_init();
|
cc.fx.GameConfig.CLICK_init();
|
||||||
var data = GameData_1.default._instance.GAME_DATA;
|
var data = cc.fx.GameConfig.GAME_DATA;
|
||||||
var matchId = this.getMatchId();
|
var matchId = this.getMatchId();
|
||||||
var postData = {
|
var postData = {
|
||||||
"gameId": GameData_1.default._instance.GM_INFO.gameId,
|
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId": GameData_1.default._instance.GM_INFO.userId,
|
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
||||||
"matchId": matchId,
|
"matchId": matchId,
|
||||||
"data": data
|
"data": data
|
||||||
};
|
};
|
||||||
// console.log("上传数据:")
|
// console.log("上传数据:")
|
||||||
HttpUtil_1.default.uploadUserLogData(postData, function () { });
|
cc.fx.HttpUtil.uploadUserLogData(postData, function () { });
|
||||||
},
|
},
|
||||||
//上传排行榜 type为1
|
//上传排行榜 type为1
|
||||||
setRank: function (data) {
|
setRank: function (data) {
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
var postData = {
|
var postData = {
|
||||||
"gameId": GameData_1.default._instance.GM_INFO.gameId,
|
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId": GameData_1.default._instance.GM_INFO.userId,
|
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
||||||
"type": 1,
|
"type": 1,
|
||||||
"reactionTime": data,
|
"reactionTime": data,
|
||||||
"totalSunCount": GameData_1.default._instance.GM_INFO.total,
|
"totalSunCount": cc.fx.GameConfig.GM_INFO.total,
|
||||||
"success": GameData_1.default._instance.GM_INFO.success
|
"success": cc.fx.GameConfig.GM_INFO.success
|
||||||
};
|
};
|
||||||
HttpUtil_1.default.rankData(1, function () { }, postData);
|
cc.fx.HttpUtil.rankData(1, function () { }, postData);
|
||||||
},
|
},
|
||||||
//获取排行榜 type为2
|
//获取排行榜 type为2
|
||||||
getRank: function (rankLength, callback) {
|
getRank: function (data, callback) {
|
||||||
|
var rankLength = data.length;
|
||||||
var postData = {
|
var postData = {
|
||||||
"gameId": GameData_1.default._instance.GM_INFO.gameId,
|
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId": GameData_1.default._instance.GM_INFO.userId,
|
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
||||||
"page": 1,
|
"page": 1,
|
||||||
"pageSize": rankLength
|
"pageSize": rankLength
|
||||||
};
|
};
|
||||||
//回调进getRankData
|
//回调进getRankData
|
||||||
HttpUtil_1.default.rankData(2, function (data) { callback(data); }, postData);
|
cc.fx.HttpUtil.rankData(2, function (data) { callback(data); }, postData);
|
||||||
},
|
},
|
||||||
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
||||||
getMatchId: function () {
|
getMatchId: function () {
|
||||||
|
@ -83,7 +81,7 @@ var GameTool = {
|
||||||
char += 1;
|
char += 1;
|
||||||
}
|
}
|
||||||
matchId = matchId.slice(0, 10) + char + "";
|
matchId = matchId.slice(0, 10) + char + "";
|
||||||
GameData_1.default._instance.GM_INFO.matchId = matchId;
|
cc.fx.GameConfig.GM_INFO.matchId = matchId;
|
||||||
cc.sys.localStorage.setItem("matchId", matchId);
|
cc.sys.localStorage.setItem("matchId", matchId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +109,7 @@ var GameTool = {
|
||||||
var data = uuidArray.join('') + 1 + "";
|
var data = uuidArray.join('') + 1 + "";
|
||||||
cc.sys.localStorage.setItem("matchNumber", 1);
|
cc.sys.localStorage.setItem("matchNumber", 1);
|
||||||
cc.sys.localStorage.setItem("matchId", data);
|
cc.sys.localStorage.setItem("matchId", data);
|
||||||
GameData_1.default._instance.GM_INFO.matchId = data;
|
cc.fx.GameConfig.GM_INFO.matchId = data;
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
//截取名字
|
//截取名字
|
||||||
|
@ -156,18 +154,20 @@ var GameTool = {
|
||||||
target.selfData = data.data.info;
|
target.selfData = data.data.info;
|
||||||
var rankData = [];
|
var rankData = [];
|
||||||
var self = false;
|
var self = false;
|
||||||
GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"), target.selfData.pic);
|
cc.fx.GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"), target.selfData.pic);
|
||||||
for (var i = 0; i <= target.listData.length - 1; i++) {
|
for (var i = 0; i <= target.listData.length - 1; i++) {
|
||||||
rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].totalSunCount, pic: target.listData[i].pic });
|
rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].totalSunCount, pic: target.listData[i].pic });
|
||||||
if (GameData_1.default._instance.GM_INFO.userId == target.listData[i].userId) {
|
if (cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId) {
|
||||||
self = true;
|
self = true;
|
||||||
|
target.rankNumber = i;
|
||||||
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = (i + 1) + "";
|
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = (i + 1) + "";
|
||||||
}
|
}
|
||||||
if (i == (target.listData.length - 1) && self == false) {
|
if (i == (target.listData.length - 1) && self == false) {
|
||||||
|
target.rankNumber = i;
|
||||||
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = "99+";
|
target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = "99+";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameTool.subName(target.selfData.nickName, nameLength);
|
cc.fx.GameTool.subName(target.selfData.nickName, nameLength);
|
||||||
target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
|
target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
|
||||||
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.totalSunCount;
|
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.totalSunCount;
|
||||||
switch (target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string) {
|
switch (target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string) {
|
||||||
|
@ -199,7 +199,7 @@ var GameTool = {
|
||||||
},
|
},
|
||||||
//判断全面屏适配
|
//判断全面屏适配
|
||||||
setFit: function (canvas) {
|
setFit: function (canvas) {
|
||||||
var flag = GameTool.getSetScreenResolutionFlag();
|
var flag = cc.fx.GameTool.getSetScreenResolutionFlag();
|
||||||
if (flag) {
|
if (flag) {
|
||||||
// console.log("不是全面屏");
|
// console.log("不是全面屏");
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,15 +24,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
|
||||||
var GameData_1 = require("./module/Config/GameData");
|
|
||||||
var GameTool_1 = require("./module/Tool/GameTool");
|
|
||||||
var NewClass = /** @class */ (function (_super) {
|
var NewClass = /** @class */ (function (_super) {
|
||||||
__extends(NewClass, _super);
|
__extends(NewClass, _super);
|
||||||
function NewClass() {
|
function NewClass() {
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
return _super !== null && _super.apply(this, arguments) || this;
|
||||||
}
|
}
|
||||||
NewClass.prototype.start = function () {
|
NewClass.prototype.start = function () {
|
||||||
GameTool_1.GameTool.Authentication();
|
window.initMgr();
|
||||||
|
cc.fx.GameTool.Authentication();
|
||||||
|
cc.fx.GameConfig.init();
|
||||||
|
cc.fx.AudioManager.Instance.init();
|
||||||
};
|
};
|
||||||
//开始游戏,跳转至引导页面
|
//开始游戏,跳转至引导页面
|
||||||
NewClass.prototype.startGame = function () {
|
NewClass.prototype.startGame = function () {
|
||||||
|
@ -40,7 +41,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
//备用,用来测试跳转 指定关卡
|
//备用,用来测试跳转 指定关卡
|
||||||
NewClass.prototype.clickBtn = function (event, data) {
|
NewClass.prototype.clickBtn = function (event, data) {
|
||||||
GameData_1.default._instance.GM_INFO.custom = parseInt(data);
|
cc.fx.GameConfig.GM_INFO.custom = parseInt(data);
|
||||||
cc.director.loadScene("GameScene");
|
cc.director.loadScene("GameScene");
|
||||||
};
|
};
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAE5D,qDAAgD;AAChD,mDAAkD;AAGlD;IAAsC,4BAAY;IAAlD;;IAsBA,CAAC;IApBG,wBAAK,GAAL;QACI,mBAAQ,CAAC,cAAc,EAAE,CAAC;IAC9B,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,kBAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IArBgB,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAsB5B;IAAD,eAAC;CAtBD,AAsBC,CAtBqC,EAAE,CAAC,SAAS,GAsBjD;kBAtBoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\nimport GameData from \"./module/Config/GameData\";\r\nimport { GameTool } from \"./module/Tool/GameTool\";\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n\r\n start () {\r\n GameTool.Authentication();\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n GameData._instance.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
|
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;;IAwBA,CAAC;IAvBG,wBAAK,GAAL;QACI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;QAChC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IAvBgB,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAwB5B;IAAD,eAAC;CAxBD,AAwBC,CAxBqC,EAAE,CAAC,SAAS,GAwBjD;kBAxBoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n start () {\r\n window.initMgr();\r\n cc.fx.GameTool.Authentication();\r\n cc.fx.GameConfig.init();\r\n cc.fx.AudioManager.Instance.init();\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
|
|
@ -24,7 +24,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var Notification_1 = require("./module/Notification/Notification");
|
|
||||||
var NewClass = /** @class */ (function (_super) {
|
var NewClass = /** @class */ (function (_super) {
|
||||||
__extends(NewClass, _super);
|
__extends(NewClass, _super);
|
||||||
function NewClass() {
|
function NewClass() {
|
||||||
|
@ -71,13 +70,13 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
.start();
|
.start();
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
this.node.zIndex = -1;
|
this.node.zIndex = -1;
|
||||||
Notification_1.Notifications.emit("clickSun", this.id_Number);
|
cc.fx.Notifications.emit("clickSun", this.id_Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
this.node.zIndex = -1;
|
this.node.zIndex = -1;
|
||||||
Notification_1.Notifications.emit("clickSun", this.id_Number);
|
cc.fx.Notifications.emit("clickSun", this.id_Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +84,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
if (this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true) {
|
if (this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true) {
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
this.node.zIndex = -1;
|
this.node.zIndex = -1;
|
||||||
Notification_1.Notifications.emit("clickSun", this.id_Number);
|
cc.fx.Notifications.emit("clickSun", this.id_Number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,19 +3,6 @@ cc._RF.push(module, '58403/n16JCa5sZhNMjZzGo', 'AudioManager');
|
||||||
// Script/module/Music/AudioManager.ts
|
// Script/module/Music/AudioManager.ts
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
var __extends = (this && this.__extends) || (function () {
|
|
||||||
var extendStatics = function (d, b) {
|
|
||||||
extendStatics = Object.setPrototypeOf ||
|
|
||||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
||||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
||||||
return extendStatics(d, b);
|
|
||||||
};
|
|
||||||
return function (d, b) {
|
|
||||||
extendStatics(d, b);
|
|
||||||
function __() { this.constructor = d; }
|
|
||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
@ -23,20 +10,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.AudioManager = void 0;
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var AudioManager = /** @class */ (function (_super) {
|
var AudioManager = /** @class */ (function () {
|
||||||
__extends(AudioManager, _super);
|
|
||||||
function AudioManager() {
|
function AudioManager() {
|
||||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
||||||
//背景音乐
|
//背景音乐
|
||||||
_this.audioGameBgm0 = null;
|
this.audioGameBgm0 = null;
|
||||||
//跳跃
|
//跳跃
|
||||||
_this.audioButtonClick = null;
|
this.audioButtonClick = null;
|
||||||
//落地上
|
//落地上
|
||||||
_this.audioWarning = null;
|
this.audioWarning = null;
|
||||||
//碰撞
|
//碰撞
|
||||||
_this.audioWin = null;
|
this.audioWin = null;
|
||||||
return _this;
|
|
||||||
}
|
}
|
||||||
AudioManager_1 = AudioManager;
|
AudioManager_1 = AudioManager;
|
||||||
AudioManager.playWarning = function () {
|
AudioManager.playWarning = function () {
|
||||||
|
@ -82,15 +67,17 @@ var AudioManager = /** @class */ (function (_super) {
|
||||||
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);
|
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);
|
||||||
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);
|
// cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);
|
||||||
};
|
};
|
||||||
AudioManager.prototype.onLoad = function () {
|
Object.defineProperty(AudioManager, "Instance", {
|
||||||
if (AudioManager_1._instance == null) {
|
get: function () {
|
||||||
AudioManager_1._instance = this;
|
if (this._instance == null) {
|
||||||
cc.game.addPersistRootNode(this.node);
|
this._instance = new AudioManager_1();
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.node.destroy();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return this._instance;
|
||||||
|
},
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
AudioManager.prototype.init = function () {
|
||||||
this.reward = false;
|
this.reward = false;
|
||||||
this.finish = false;
|
this.finish = false;
|
||||||
this.rewardCount = 0;
|
this.rewardCount = 0;
|
||||||
|
@ -105,15 +92,6 @@ var AudioManager = /** @class */ (function (_super) {
|
||||||
this.audioGameBgm0,
|
this.audioGameBgm0,
|
||||||
];
|
];
|
||||||
musics.forEach(function (path) {
|
musics.forEach(function (path) {
|
||||||
// var musicPath = wxDownloader.REMOTE_SERVER_ROOT + path;
|
|
||||||
// if (musicPath != wxDownloader.REMOTE_SERVER_ROOT && musicPath.endsWith('.mp3')) {
|
|
||||||
// cc.loader.load(musicPath, function(err, remoteUrl) {
|
|
||||||
// if (err) {
|
|
||||||
// cc.error(err.message || err);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
AudioManager.prototype.getAudioMusicSwitch = function () {
|
AudioManager.prototype.getAudioMusicSwitch = function () {
|
||||||
|
@ -146,27 +124,9 @@ var AudioManager = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
AudioManager.prototype.onHide = function () {
|
AudioManager.prototype.onHide = function () {
|
||||||
cc.audioEngine.pauseAll();
|
cc.audioEngine.pauseAll();
|
||||||
// if (CC_JSB) {
|
|
||||||
// } else {
|
|
||||||
// for (var key in this.mAudioMap) {
|
|
||||||
// if (key === this.mMusicKey) {
|
|
||||||
// this.mAudioMap[key].pause();
|
|
||||||
// } else {
|
|
||||||
// this.mAudioMap[key].stop();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
AudioManager.prototype.onShow = function () {
|
AudioManager.prototype.onShow = function () {
|
||||||
cc.audioEngine.resumeAll();
|
cc.audioEngine.resumeAll();
|
||||||
// if (CC_JSB) {
|
|
||||||
// } else {
|
|
||||||
// if (!this.mMusicSwitch) return;
|
|
||||||
// var context = this.mAudioMap[this.mMusicKey];
|
|
||||||
// if (context) {
|
|
||||||
// context.play();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
AudioManager.prototype.playMusic = function (key, callback, loop) {
|
AudioManager.prototype.playMusic = function (key, callback, loop) {
|
||||||
loop = typeof loop == 'undefined' || loop ? true : false;
|
loop = typeof loop == 'undefined' || loop ? true : false;
|
||||||
|
@ -227,29 +187,14 @@ var AudioManager = /** @class */ (function (_super) {
|
||||||
/**
|
/**
|
||||||
* 报警的音效
|
* 报警的音效
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
* 方块碰撞的声音
|
|
||||||
*/
|
|
||||||
AudioManager.prototype.playBrick = function () {
|
|
||||||
// return this.play(this.brickSound,false);
|
|
||||||
};
|
|
||||||
//方块破碎的声音
|
|
||||||
AudioManager.prototype.brickBoom = function () {
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* 按钮
|
* 按钮
|
||||||
*/
|
*/
|
||||||
AudioManager.prototype.playAudioButton = function () {
|
AudioManager.prototype.playAudioButton = function () {
|
||||||
return this.play(this.audioButtonClick, false, null, this.mEffectSwitch);
|
return this.play(this.audioButtonClick, false, null, this.mEffectSwitch);
|
||||||
};
|
};
|
||||||
AudioManager.prototype.playRandomMatch = function () {
|
|
||||||
this.playMusic(this.audioGameBgm0, {}, true);
|
|
||||||
};
|
|
||||||
AudioManager.prototype.playMatchFoundSound = function () {
|
|
||||||
this.stopMusic();
|
|
||||||
// return this.play(this.matchFoundSound, false);
|
|
||||||
};
|
|
||||||
var AudioManager_1;
|
var AudioManager_1;
|
||||||
|
AudioManager._instance = null;
|
||||||
__decorate([
|
__decorate([
|
||||||
property(cc.AudioClip)
|
property(cc.AudioClip)
|
||||||
], AudioManager.prototype, "audioGameBgm0", void 0);
|
], AudioManager.prototype, "audioGameBgm0", void 0);
|
||||||
|
@ -263,11 +208,11 @@ var AudioManager = /** @class */ (function (_super) {
|
||||||
property(cc.AudioClip)
|
property(cc.AudioClip)
|
||||||
], AudioManager.prototype, "audioWin", void 0);
|
], AudioManager.prototype, "audioWin", void 0);
|
||||||
AudioManager = AudioManager_1 = __decorate([
|
AudioManager = AudioManager_1 = __decorate([
|
||||||
ccclass
|
ccclass('AudioManager')
|
||||||
], AudioManager);
|
], AudioManager);
|
||||||
return AudioManager;
|
return AudioManager;
|
||||||
}(cc.Component));
|
}());
|
||||||
exports.default = AudioManager;
|
exports.AudioManager = AudioManager;
|
||||||
;
|
;
|
||||||
// export { AudioManager };
|
// export { AudioManager };
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,14 @@
|
||||||
cc._RF.push(module, '61d4ccY2ztLMYIh8WvqPPAw', 'GameAppStart');
|
cc._RF.push(module, '61d4ccY2ztLMYIh8WvqPPAw', 'GameAppStart');
|
||||||
// Script/module/GameStart/GameAppStart.ts
|
// Script/module/GameStart/GameAppStart.ts
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var GameConfig_1 = require("../Config/GameConfig");
|
||||||
|
var HttpUtil_1 = require("../Crypto/HttpUtil");
|
||||||
|
var AudioManager_1 = require("../Music/AudioManager");
|
||||||
|
var Notification_1 = require("../Notification/Notification");
|
||||||
|
var Storage_1 = require("../Storage/Storage");
|
||||||
|
var GameTool_1 = require("../Tool/GameTool");
|
||||||
window.initMgr = function () {
|
window.initMgr = function () {
|
||||||
if (cc.fx) {
|
if (cc.fx) {
|
||||||
return;
|
return;
|
||||||
|
@ -15,6 +23,14 @@ window.initMgr = function () {
|
||||||
networkType: 'none',
|
networkType: 'none',
|
||||||
isOnForeground: true //当前是否是在前台
|
isOnForeground: true //当前是否是在前台
|
||||||
};
|
};
|
||||||
|
//应用系统信息
|
||||||
|
//配置文件
|
||||||
|
cc.fx.GameConfig = GameConfig_1.GameConfig;
|
||||||
|
cc.fx.HttpUtil = HttpUtil_1.default;
|
||||||
|
cc.fx.GameTool = GameTool_1.GameTool;
|
||||||
|
cc.fx.AudioManager = AudioManager_1.AudioManager;
|
||||||
|
cc.fx.Notifications = Notification_1.Notifications;
|
||||||
|
cc.fx.StorageMessage = Storage_1.StorageMessage;
|
||||||
cc.fx.ShareInfo = {
|
cc.fx.ShareInfo = {
|
||||||
queryId: -1 //分享id
|
queryId: -1 //分享id
|
||||||
};
|
};
|
||||||
|
@ -44,44 +60,6 @@ window.initMgr = function () {
|
||||||
CoinRoomBankruptcy2: 'coinRoomBankruptcy2',
|
CoinRoomBankruptcy2: 'coinRoomBankruptcy2',
|
||||||
CoinRoomBankruptcy3: 'coinRoomBankruptcy3',
|
CoinRoomBankruptcy3: 'coinRoomBankruptcy3',
|
||||||
};
|
};
|
||||||
cc.fx.BurialShareConfig = {
|
|
||||||
invite: {
|
|
||||||
oneGroupDayCount: 1 //同一个群一天最多分享次数:超过次数将不再向服务器获取奖励,并且提醒用户分享到不同的群
|
|
||||||
},
|
|
||||||
FetchGroupID: {
|
|
||||||
oneGroupDayCount: 1 //同一个群一天最多分享次数:超过次数将不再向服务器获取奖励,并且提醒用户分享到不同的群
|
|
||||||
},
|
|
||||||
SegmentUp: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
RankNotify: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
FTResult: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
highRate: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
matchResult: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
MatchFix5: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
MatchFix20: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
MatchFix100: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
MatchFix500: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
coinRoomWinStreak: {
|
|
||||||
painting: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
/*
|
/*
|
||||||
* 分享到哪儿给奖励 group frined all
|
* 分享到哪儿给奖励 group frined all
|
||||||
*/
|
*/
|
||||||
|
@ -90,14 +68,7 @@ window.initMgr = function () {
|
||||||
Friend: "friend",
|
Friend: "friend",
|
||||||
All: "all",
|
All: "all",
|
||||||
};
|
};
|
||||||
/**
|
//暂时不用
|
||||||
* 日志相关方法,若不符合项目组标准,可自行进行扩展
|
|
||||||
*/
|
|
||||||
cc.fx.OUTPUT_LOG = 1;
|
|
||||||
cc.fx.OUTPUT_INFO = 1 << 1;
|
|
||||||
cc.fx.OUTPUT_WARN = 1 << 2;
|
|
||||||
cc.fx.OUTPUT_ERR = 1 << 3;
|
|
||||||
cc.fx.OUTPUT_LV = cc.fx.OUTPUT_ERR | cc.fx.OUTPUT_WARN | cc.fx.OUTPUT_INFO | cc.fx.OUTPUT_LOG;
|
|
||||||
cc.fx.clickStatEventType = {
|
cc.fx.clickStatEventType = {
|
||||||
clickStatEventTypeVideoAD: 20173201,
|
clickStatEventTypeVideoAD: 20173201,
|
||||||
clickStatEventTypeClickAdVideo: 20173202,
|
clickStatEventTypeClickAdVideo: 20173202,
|
||||||
|
@ -122,38 +93,6 @@ window.initMgr = function () {
|
||||||
clickStatEventTypeTCP_Success: 10010,
|
clickStatEventTypeTCP_Success: 10010,
|
||||||
clickStatEventTypeTCP_Failed: 10011,
|
clickStatEventTypeTCP_Failed: 10011,
|
||||||
};
|
};
|
||||||
//应用系统信息
|
|
||||||
// cc.fx.SystemInfo = require("../BallSDK/BallSystemInfo");
|
|
||||||
// cc.fx.SystemInfo.init();
|
|
||||||
// cc.fx.EventType = require("../BallSDK/BallEventType");
|
|
||||||
// cc.fx.UserInfo = require("../BallGame/UserInfo");
|
|
||||||
// cc.fx.OutPut = require("../BallUtil/LogOutPut");
|
|
||||||
// cc.fx.HttpUtil= require("../BallSDK/BallHttpUtil");
|
|
||||||
// cc.fx.EncodeDecode = require("../BallUtil/BallEncodeDecode");
|
|
||||||
// cc.fx.NotificationCenter = require("../BallUtil/BallNotificationCenter");
|
|
||||||
// cc.fx.Timer = require("../BallUtil/BallTimer");
|
|
||||||
// cc.fx.Util = require("../BallUtil/BallUtil");
|
|
||||||
// cc.fx.TCPMSG = require("../BallSDK/BallTCP_Msg");
|
|
||||||
// cc.fx.TCPRECEIVER = require("../BallSDK/BallTCP_Receiver");
|
|
||||||
// cc.fx.TCPRECEIVER.init();
|
|
||||||
// cc.fx.Loader = require("../BallUtil/BallLoader");
|
|
||||||
// cc.fx.PopWindowManager = require("../BallWindow/BallPopWindonwManager");
|
|
||||||
// cc.fx.PopWindowManager.preload();
|
|
||||||
// cc.fx.TipManager = require("../BallWindow/TipWindowManager");
|
|
||||||
// cc.fx.PayModel = require("../BallModel/BallPayModel");
|
|
||||||
// cc.fx.SceneManager = require("../BallUtil/BallSceneManager");
|
|
||||||
// cc.fx.MapCheckPoint = require("../BallUtil/MapCheckPointManager");
|
|
||||||
// cc.fx.MapCheckPoint.initMapCheckPointBallInfo();
|
|
||||||
// cc.fx.MapPointScore = require("../BallCheckPoint/CheckPointScore");
|
|
||||||
// cc.fx.Storage = require('../BallUtil/BallStorage');
|
|
||||||
// if (cc.sys.isBrowser) {
|
|
||||||
// cc.fx.Storage = require('../BallUtil/BallStorage');
|
|
||||||
// } else {
|
|
||||||
// cc.fx.Storage = require('../BallUtil/WeChatStorage');
|
|
||||||
// }
|
|
||||||
// cc.fx.Gift = require("../BallModel/BallGiftBox");
|
|
||||||
// cc.fx.Invite = require('../BallModel/BallInvite');
|
|
||||||
// cc.fx.ClientConf = require("../BallModel/BallClientConf");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cc._RF.pop();
|
cc._RF.pop();
|
|
@ -60,21 +60,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var GameData_1 = require("../Config/GameData");
|
|
||||||
var CryptoJS = require("./crypto-js.min.js"); //引用AES源码js
|
var CryptoJS = require("./crypto-js.min.js"); //引用AES源码js
|
||||||
var BASE_URL = "http://api.sparkus.cn";
|
var BASE_URL = "http://api.sparkus.cn";
|
||||||
|
//只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool
|
||||||
var HttpUtil = /** @class */ (function (_super) {
|
var HttpUtil = /** @class */ (function (_super) {
|
||||||
__extends(HttpUtil, _super);
|
__extends(HttpUtil, _super);
|
||||||
function HttpUtil() {
|
function HttpUtil() {
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
return _super !== null && _super.apply(this, arguments) || this;
|
||||||
}
|
}
|
||||||
//排行榜type2为获取,type1为上传
|
//排行榜
|
||||||
HttpUtil.rankData = function (type, callback, data) {
|
HttpUtil.rankData = function (type, callback, data) {
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
return __awaiter(this, void 0, Promise, function () {
|
||||||
var time, url;
|
var time, url;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
|
|
||||||
data.userId = GameData_1.default._instance.GM_INFO.userId;
|
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
url = apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback);
|
||||||
|
@ -86,8 +84,6 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
return __awaiter(this, void 0, Promise, function () {
|
||||||
var url;
|
var url;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
|
|
||||||
data.userId = GameData_1.default._instance.GM_INFO.userId;
|
|
||||||
url = '/log/collect/data';
|
url = '/log/collect/data';
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
|
@ -99,8 +95,6 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
return __awaiter(this, void 0, Promise, function () {
|
||||||
var time, url;
|
var time, url;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
|
|
||||||
data.userId = GameData_1.default._instance.GM_INFO.userId;
|
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
url = apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback);
|
||||||
|
|
|
@ -23,8 +23,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var GameData_1 = require("./module/Config/GameData");
|
|
||||||
var GameTool_1 = require("./module/Tool/GameTool");
|
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var NewClass = /** @class */ (function (_super) {
|
var NewClass = /** @class */ (function (_super) {
|
||||||
__extends(NewClass, _super);
|
__extends(NewClass, _super);
|
||||||
|
@ -42,11 +40,11 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
// onLoad () {}
|
// onLoad () {}
|
||||||
NewClass.prototype.start = function () {
|
NewClass.prototype.start = function () {
|
||||||
this.count.string = GameData_1.default._instance.GM_INFO.total;
|
this.count.string = cc.fx.GameConfig.GM_INFO.total + "";
|
||||||
if (GameData_1.default._instance.GM_INFO.mean_Time > 10) {
|
if (cc.fx.GameConfig.GM_INFO.mean_Time > 10) {
|
||||||
GameData_1.default._instance.GM_INFO.mean_Time = (parseInt(Math.random() * 10 + "") + 5) / 10;
|
cc.fx.GameConfig.GM_INFO.mean_Time = (parseInt(Math.random() * 10 + "") + 5) / 10;
|
||||||
}
|
}
|
||||||
this.time.string = GameData_1.default._instance.GM_INFO.mean_Time + "s";
|
this.time.string = cc.fx.GameConfig.GM_INFO.mean_Time + "s";
|
||||||
this.init();
|
this.init();
|
||||||
};
|
};
|
||||||
//初始化数据
|
//初始化数据
|
||||||
|
@ -71,13 +69,17 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
//获取排行榜
|
//获取排行榜
|
||||||
NewClass.prototype.getRank = function () {
|
NewClass.prototype.getRank = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
GameTool_1.GameTool.getRank(5, function (data) { return _this.getRankData(data); });
|
//获取排行榜数据 所需数据量
|
||||||
|
var dataFile = {
|
||||||
|
length: 5
|
||||||
|
};
|
||||||
|
cc.fx.GameTool.getRank(dataFile, function (data) { return _this.getRankData(data); });
|
||||||
};
|
};
|
||||||
//设置排行信息
|
//设置排行信息
|
||||||
NewClass.prototype.getRankData = function (data) {
|
NewClass.prototype.getRankData = function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
GameTool_1.GameTool.getRankData(data, this, 4);
|
cc.fx.GameTool.getRankData(data, this, 4);
|
||||||
GameTool_1.GameTool.setPic(this.selfNode.getChildByName("pic").getChildByName("icon"), this.selfData.pic);
|
cc.fx.GameTool.setPic(this.selfNode.getChildByName("pic").getChildByName("icon"), this.selfData.pic);
|
||||||
for (var i = 0; i <= 4; i++) {
|
for (var i = 0; i <= 4; i++) {
|
||||||
this.setRank(i, this.listData[i]);
|
this.setRank(i, this.listData[i]);
|
||||||
}
|
}
|
||||||
|
@ -103,10 +105,10 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
if (hitNode) {
|
if (hitNode) {
|
||||||
hitNode.active = true;
|
hitNode.active = true;
|
||||||
GameTool_1.GameTool.subName(data.nickName, 4);
|
cc.fx.GameTool.subName(data.nickName, 4);
|
||||||
hitNode.getChildByName("name").getComponent(cc.Label).string = data.nickName;
|
hitNode.getChildByName("name").getComponent(cc.Label).string = data.nickName;
|
||||||
hitNode.getChildByName("total").getComponent(cc.Label).string = data.totalSunCount;
|
hitNode.getChildByName("total").getComponent(cc.Label).string = data.totalSunCount;
|
||||||
GameTool_1.GameTool.setPic(hitNode.getChildByName("pic").getChildByName("icon"), data.pic);
|
cc.fx.GameTool.setPic(hitNode.getChildByName("pic").getChildByName("icon"), data.pic);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
__decorate([
|
__decorate([
|
||||||
|
|
|
@ -1,320 +0,0 @@
|
||||||
"use strict";
|
|
||||||
cc._RF.push(module, '98307M8uUtLYKaHXPmGgCWf', 'serverAPI');
|
|
||||||
// Script/module/Crypto/serverAPI.ts
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// import CryptoJS from "crypto-js";
|
|
||||||
var __extends = (this && this.__extends) || (function () {
|
|
||||||
var extendStatics = function (d, b) {
|
|
||||||
extendStatics = Object.setPrototypeOf ||
|
|
||||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
||||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
||||||
return extendStatics(d, b);
|
|
||||||
};
|
|
||||||
return function (d, b) {
|
|
||||||
extendStatics(d, b);
|
|
||||||
function __() { this.constructor = d; }
|
|
||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
||||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
||||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
||||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
||||||
function step(op) {
|
|
||||||
if (f) throw new TypeError("Generator is already executing.");
|
|
||||||
while (_) try {
|
|
||||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
||||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
||||||
switch (op[0]) {
|
|
||||||
case 0: case 1: t = op; break;
|
|
||||||
case 4: _.label++; return { value: op[1], done: false };
|
|
||||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
||||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
||||||
default:
|
|
||||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
||||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
||||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
||||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
||||||
if (t[2]) _.ops.pop();
|
|
||||||
_.trys.pop(); continue;
|
|
||||||
}
|
|
||||||
op = body.call(thisArg, _);
|
|
||||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
||||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var GameData_1 = require("../GameData");
|
|
||||||
var CryptoJS = require("./crypto-js.min.js"); //引用AES源码js
|
|
||||||
// import axios from 'axios'
|
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
|
||||||
var BASE_URL = "http://api.sparkus.cn";
|
|
||||||
var HttpUtil = /** @class */ (function (_super) {
|
|
||||||
__extends(HttpUtil, _super);
|
|
||||||
function HttpUtil() {
|
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
|
||||||
}
|
|
||||||
//排行榜type2为获取,type1为上传
|
|
||||||
HttpUtil.rankData = function (type, callback, data) {
|
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
|
||||||
var time, url;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
|
|
||||||
data.userId = GameData_1.default._instance.GM_INFO.userId;
|
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
|
||||||
url = apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
|
||||||
this.post(url, data, callback);
|
|
||||||
return [2 /*return*/];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
HttpUtil.uploadUserLogData = function (data, callback) {
|
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
|
||||||
var url;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
|
|
||||||
data.userId = GameData_1.default._instance.GM_INFO.userId;
|
|
||||||
url = '/log/collect/data';
|
|
||||||
this.get(url, callback);
|
|
||||||
return [2 /*return*/];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
//暂时用不到
|
|
||||||
HttpUtil.getUserRecord = function (data, callback) {
|
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
|
||||||
var time, url;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
|
|
||||||
data.userId = GameData_1.default._instance.GM_INFO.userId;
|
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
|
||||||
url = apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
|
||||||
this.post(url, data, callback);
|
|
||||||
return [2 /*return*/];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
HttpUtil.post = function (url, data, callback) {
|
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
|
||||||
var response;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
switch (_a.label) {
|
|
||||||
case 0: return [4 /*yield*/, this.fetchData(url, data, 'POST')];
|
|
||||||
case 1:
|
|
||||||
response = _a.sent();
|
|
||||||
callback && callback(response);
|
|
||||||
return [2 /*return*/];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
HttpUtil.get = function (url, callback) {
|
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
|
||||||
var response;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
switch (_a.label) {
|
|
||||||
case 0: return [4 /*yield*/, this.fetchData(url, null, 'GET')];
|
|
||||||
case 1:
|
|
||||||
response = _a.sent();
|
|
||||||
callback && callback(response);
|
|
||||||
return [2 /*return*/];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
HttpUtil.fetchData = function (url, data, method) {
|
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
|
||||||
var fullUrl, headers, options, response, error_1;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
switch (_a.label) {
|
|
||||||
case 0:
|
|
||||||
fullUrl = "" + BASE_URL + url;
|
|
||||||
headers = { 'Content-Type': 'application/json' };
|
|
||||||
options = {
|
|
||||||
method: method,
|
|
||||||
headers: headers,
|
|
||||||
body: data ? JSON.stringify(data) : null,
|
|
||||||
};
|
|
||||||
_a.label = 1;
|
|
||||||
case 1:
|
|
||||||
_a.trys.push([1, 4, , 5]);
|
|
||||||
return [4 /*yield*/, fetch(fullUrl, options)];
|
|
||||||
case 2:
|
|
||||||
response = _a.sent();
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error("HTTP error! status: " + response.status);
|
|
||||||
}
|
|
||||||
return [4 /*yield*/, response.json()];
|
|
||||||
case 3: return [2 /*return*/, _a.sent()];
|
|
||||||
case 4:
|
|
||||||
error_1 = _a.sent();
|
|
||||||
console.error('Fetch error:', error_1);
|
|
||||||
return [2 /*return*/, null];
|
|
||||||
case 5: return [2 /*return*/];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
HttpUtil = __decorate([
|
|
||||||
ccclass
|
|
||||||
], HttpUtil);
|
|
||||||
return HttpUtil;
|
|
||||||
}(cc.Component));
|
|
||||||
exports.default = HttpUtil;
|
|
||||||
function responseHandler(response) {
|
|
||||||
return response.data;
|
|
||||||
}
|
|
||||||
// 响应拦截器
|
|
||||||
// Rq.interceptors.response.use(responseHandler)
|
|
||||||
var config = {
|
|
||||||
gameId: "100009",
|
|
||||||
secretKey: "CMNhOzBA",
|
|
||||||
EK: "hui231%1"
|
|
||||||
};
|
|
||||||
var Crypoto = /** @class */ (function () {
|
|
||||||
function Crypoto() {
|
|
||||||
// 加密的向明值,自己根据项目实际情况定,需要跟后端开发保持一致
|
|
||||||
this.keyHex = this.getHetKey();
|
|
||||||
}
|
|
||||||
Crypoto.prototype.getHetKey = function () {
|
|
||||||
return CryptoJS.enc.Utf8.parse(config.EK);
|
|
||||||
};
|
|
||||||
/** DES加密 */
|
|
||||||
Crypoto.prototype.encryptByDES = function (message, secret) {
|
|
||||||
if (!message) {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
var key = secret ? CryptoJS.enc.Utf8.parse(secret) : this.keyHex;
|
|
||||||
var encrypted = CryptoJS.DES.encrypt(message, key, {
|
|
||||||
mode: CryptoJS.mode.ECB,
|
|
||||||
padding: CryptoJS.pad.Pkcs7
|
|
||||||
});
|
|
||||||
return encrypted.toString();
|
|
||||||
};
|
|
||||||
/** DES解密 */
|
|
||||||
Crypoto.prototype.decryptByDES = function (message, secret) {
|
|
||||||
var key = secret ? CryptoJS.enc.Utf8.parse(secret) : this.keyHex;
|
|
||||||
var decrypted = CryptoJS.DES.decrypt({
|
|
||||||
ciphertext: CryptoJS.enc.Base64.parse(message)
|
|
||||||
}, key, {
|
|
||||||
mode: CryptoJS.mode.ECB,
|
|
||||||
padding: CryptoJS.pad.Pkcs7
|
|
||||||
});
|
|
||||||
return decrypted.toString(CryptoJS.enc.Utf8);
|
|
||||||
};
|
|
||||||
/** hmacSHA256加密 */
|
|
||||||
Crypoto.prototype.hmacSha256 = function (message, secret) {
|
|
||||||
var keyHex = secret ? CryptoJS.enc.Utf8.parse(secret) : this.keyHex;
|
|
||||||
var hash = CryptoJS.HmacSHA256(message, keyHex);
|
|
||||||
return hash.toString();
|
|
||||||
};
|
|
||||||
/** hmacSHA256验证 */
|
|
||||||
Crypoto.prototype.verifyHmacSha256 = function (message, signature) {
|
|
||||||
var hash = CryptoJS.HmacSHA256(message, this.keyHex);
|
|
||||||
return hash.toString() === signature;
|
|
||||||
};
|
|
||||||
/** CBC加密 */
|
|
||||||
Crypoto.prototype.encryptCBC = function (word) {
|
|
||||||
if (!word) {
|
|
||||||
return word;
|
|
||||||
}
|
|
||||||
var srcs = CryptoJS.enc.Utf8.parse(word);
|
|
||||||
var encrypted = CryptoJS.AES.encrypt(srcs, this.keyHex, {
|
|
||||||
iv: this.keyHex,
|
|
||||||
mode: CryptoJS.mode.CBC,
|
|
||||||
padding: CryptoJS.pad.ZeroPadding
|
|
||||||
});
|
|
||||||
return encrypted.toString();
|
|
||||||
};
|
|
||||||
/** CBC解密 */
|
|
||||||
Crypoto.prototype.decryptCBC = function (word) {
|
|
||||||
if (!word) {
|
|
||||||
return word;
|
|
||||||
}
|
|
||||||
var encryptedHexStr = CryptoJS.enc.Hex.parse(word);
|
|
||||||
var srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
|
|
||||||
var decrypt = CryptoJS.AES.decrypt(srcs, this.keyHex, {
|
|
||||||
iv: this.keyHex,
|
|
||||||
mode: CryptoJS.mode.CBC,
|
|
||||||
padding: CryptoJS.pad.ZeroPadding
|
|
||||||
});
|
|
||||||
var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
|
|
||||||
return decryptedStr.toString();
|
|
||||||
};
|
|
||||||
return Crypoto;
|
|
||||||
}());
|
|
||||||
var fxCry = new Crypoto();
|
|
||||||
function isEmpty(data) {
|
|
||||||
return data === "" || data === null || data === undefined || data.length === 0 || JSON.stringify(data) == "{}";
|
|
||||||
}
|
|
||||||
function getQueryString(obj) {
|
|
||||||
// 首先对对象的键进行排序并过滤空值
|
|
||||||
var sortedKeys = Object.keys(obj).sort();
|
|
||||||
var sortedObj = {};
|
|
||||||
for (var i = 0; i < sortedKeys.length; i++) {
|
|
||||||
if (isEmpty(obj[sortedKeys[i]])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
sortedObj[sortedKeys[i]] = obj[sortedKeys[i]];
|
|
||||||
}
|
|
||||||
// 然后将排序后的对象转换为查询字符串
|
|
||||||
var params = [];
|
|
||||||
for (var key in sortedObj) {
|
|
||||||
params.push(encodeURIComponent(key) + "=" + encodeURIComponent(sortedObj[key]));
|
|
||||||
}
|
|
||||||
return params.join('&');
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 组装签名字符串
|
|
||||||
* @param string url: 请求地址
|
|
||||||
* @param string postStr: post参数的a=1&b=2
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
function genSignStr(url, postStr) {
|
|
||||||
var lessUrl = url.replace('?', '');
|
|
||||||
lessUrl = lessUrl + "&" + postStr;
|
|
||||||
return encodeURIComponent(fxCry.hmacSha256(lessUrl));
|
|
||||||
}
|
|
||||||
// 对参数进行统一urlencode
|
|
||||||
function urlencode(url) {
|
|
||||||
var _a = url.split("?", 2), baseUrl = _a[0], queryString = _a[1];
|
|
||||||
var params = new URLSearchParams(queryString);
|
|
||||||
return baseUrl + "?" + params.toString();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param url {string} 接口地址
|
|
||||||
* @param params {object} 需要加密的参数对象
|
|
||||||
*/
|
|
||||||
function apiSign(url, params) {
|
|
||||||
if (params === void 0) { params = {}; }
|
|
||||||
var convertUrl = url.trim();
|
|
||||||
if (convertUrl.indexOf('?') === -1) {
|
|
||||||
convertUrl += '?';
|
|
||||||
}
|
|
||||||
// 传入参数转换拼接字符串
|
|
||||||
var postStr = getQueryString(params);
|
|
||||||
var signedStr = genSignStr(convertUrl, postStr);
|
|
||||||
var encryptStr = "sign=" + signedStr;
|
|
||||||
var encryptSignStr = fxCry.encryptByDES(encryptStr, config.secretKey);
|
|
||||||
encryptSignStr = encodeURIComponent(encryptSignStr);
|
|
||||||
return urlencode(convertUrl) + "&_p=" + encryptSignStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
cc._RF.pop();
|
|
|
@ -25,10 +25,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
// 主游戏控制类
|
// 主游戏控制类
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var GameData_1 = require("./module/Config/GameData");
|
|
||||||
var AudioManager_1 = require("./module/Music/AudioManager");
|
|
||||||
var Notification_1 = require("./module/Notification/Notification");
|
|
||||||
var GameTool_1 = require("./module/Tool/GameTool");
|
|
||||||
var GameManager = /** @class */ (function (_super) {
|
var GameManager = /** @class */ (function (_super) {
|
||||||
__extends(GameManager, _super);
|
__extends(GameManager, _super);
|
||||||
function GameManager() {
|
function GameManager() {
|
||||||
|
@ -71,10 +67,10 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
this.round = 0;
|
this.round = 0;
|
||||||
this.level = 2;
|
this.level = 2;
|
||||||
this.countTime = 60;
|
this.countTime = 60;
|
||||||
if (GameData_1.default._instance.GM_INFO.custom != 0) {
|
if (cc.fx.GameConfig.GM_INFO.custom != 0) {
|
||||||
this.level = GameData_1.default._instance.GM_INFO.custom;
|
this.level = cc.fx.GameConfig.GM_INFO.custom;
|
||||||
// this.levelLabel.string = this.level + "";
|
// this.levelLabel.string = this.level + "";
|
||||||
GameData_1.default._instance.GM_INFO.custom += 1;
|
cc.fx.GameConfig.GM_INFO.custom += 1;
|
||||||
this.countTime = 12000000;
|
this.countTime = 12000000;
|
||||||
}
|
}
|
||||||
// this.levelLabel.string = this.level + "";
|
// this.levelLabel.string = this.level + "";
|
||||||
|
@ -91,13 +87,13 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
this.Pos_Array = [];
|
this.Pos_Array = [];
|
||||||
this.time_Array = [];
|
this.time_Array = [];
|
||||||
this.color_Array = [];
|
this.color_Array = [];
|
||||||
GameData_1.default._instance.GAME_DATA = [];
|
cc.fx.GameConfig.GAME_DATA = [];
|
||||||
GameData_1.default._instance.GM_INFO.success = false;
|
cc.fx.GameConfig.GM_INFO.success = false;
|
||||||
this.startTime = 0;
|
this.startTime = 0;
|
||||||
this.overTime = 0;
|
this.overTime = 0;
|
||||||
this.winTime = 0;
|
this.winTime = 0;
|
||||||
GameData_1.default._instance.GM_INFO.total = 0;
|
cc.fx.GameConfig.GM_INFO.total = 0;
|
||||||
GameData_1.default._instance.GM_INFO.mean_Time = 0;
|
cc.fx.GameConfig.GM_INFO.mean_Time = 0;
|
||||||
this.schedule(this.updateCountDownTime, 1);
|
this.schedule(this.updateCountDownTime, 1);
|
||||||
this.startGame();
|
this.startGame();
|
||||||
};
|
};
|
||||||
|
@ -135,7 +131,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
//下一关,或者重新开始,或者返回上一关,根据level决定
|
//下一关,或者重新开始,或者返回上一关,根据level决定
|
||||||
GameManager.prototype.reStart = function (type) {
|
GameManager.prototype.reStart = function (type) {
|
||||||
// if(GameData._instance.GM_INFO.custom != 0){
|
// if(cc.fx.GameConfig.GM_INFO.custom != 0){
|
||||||
// cc.director.loadScene("LoadScene");
|
// cc.director.loadScene("LoadScene");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
@ -244,11 +240,11 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (this.begin == true) {
|
if (this.begin == true) {
|
||||||
this.clickCount += 1;
|
this.clickCount += 1;
|
||||||
var clickTime = GameTool_1.GameTool.getTime();
|
var clickTime = cc.fx.GameTool.getTime();
|
||||||
this.time_Array.push((clickTime - this.timeStart));
|
this.time_Array.push((clickTime - this.timeStart));
|
||||||
this.timeStart = GameTool_1.GameTool.getTime();
|
this.timeStart = cc.fx.GameTool.getTime();
|
||||||
if (data == this.clickNow) {
|
if (data == this.clickNow) {
|
||||||
AudioManager_1.default._instance.playAudioButton();
|
cc.fx.AudioManager.Instance.playAudioButton();
|
||||||
if (this.clickNow > 0) {
|
if (this.clickNow > 0) {
|
||||||
this.createLine(cc.v2(this.ball_Array[this.clickNow - 1].x, this.ball_Array[this.clickNow - 1].y), cc.v2(this.ball_Array[this.clickNow].x, this.ball_Array[this.clickNow].y), 0.2);
|
this.createLine(cc.v2(this.ball_Array[this.clickNow - 1].x, this.ball_Array[this.clickNow - 1].y), cc.v2(this.ball_Array[this.clickNow].x, this.ball_Array[this.clickNow].y), 0.2);
|
||||||
}
|
}
|
||||||
|
@ -257,10 +253,10 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
this.ball_Array[this.clickNow - 1].getChildByName("guang").active = false;
|
this.ball_Array[this.clickNow - 1].getChildByName("guang").active = false;
|
||||||
if (this.clickNow == this.now_Array.length) {
|
if (this.clickNow == this.now_Array.length) {
|
||||||
this.pause = true;
|
this.pause = true;
|
||||||
GameData_1.default._instance.GM_INFO.total += this.clickNow;
|
cc.fx.GameConfig.GM_INFO.total += this.clickNow;
|
||||||
this.overTime = GameTool_1.GameTool.getTime();
|
this.overTime = cc.fx.GameTool.getTime();
|
||||||
if (this.startTime > 0 && this.overTime > 0) {
|
if (this.startTime > 0 && this.overTime > 0) {
|
||||||
GameData_1.default._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
cc.fx.GameConfig.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||||
}
|
}
|
||||||
var finish_time = parseInt((this.overTime - this.startTime) / 100 + "");
|
var finish_time = parseInt((this.overTime - this.startTime) / 100 + "");
|
||||||
this.startTime = 0;
|
this.startTime = 0;
|
||||||
|
@ -273,7 +269,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
var win_1 = this.node.getChildByName("Win");
|
var win_1 = this.node.getChildByName("Win");
|
||||||
win_1.active = true;
|
win_1.active = true;
|
||||||
win_1.setScale(0);
|
win_1.setScale(0);
|
||||||
AudioManager_1.default._instance.playWin();
|
cc.fx.AudioManager.Instance.playWin();
|
||||||
this.round += 1;
|
this.round += 1;
|
||||||
var sunArray = [];
|
var sunArray = [];
|
||||||
if (this.moveArray.length > 0) {
|
if (this.moveArray.length > 0) {
|
||||||
|
@ -293,15 +289,15 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
sunArray.push(0);
|
sunArray.push(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameData_1.default._instance.CLICK_DATA =
|
cc.fx.GameConfig.CLICK_DATA =
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
success: true,
|
success: true,
|
||||||
round: this.round,
|
round: this.round,
|
||||||
totalSunCount: this.now_Array.length,
|
totalSunCount: this.now_Array.length,
|
||||||
movedSunCount: GameData_1.default._instance.LEVEL_INFO[this.level - 1].moveNumber,
|
movedSunCount: cc.fx.GameConfig.LEVEL_INFO[this.level - 1].moveNumber,
|
||||||
sunSpeed: GameData_1.default._instance.LEVEL_INFO[this.level - 1].moveSpeed,
|
sunSpeed: cc.fx.GameConfig.LEVEL_INFO[this.level - 1].moveSpeed,
|
||||||
overlapSunCount: GameData_1.default._instance.LEVEL_INFO[this.level - 1].repeat,
|
overlapSunCount: cc.fx.GameConfig.LEVEL_INFO[this.level - 1].repeat,
|
||||||
colorList: this.color_Array,
|
colorList: this.color_Array,
|
||||||
duration: finish_time / 10,
|
duration: finish_time / 10,
|
||||||
difficultyLevel: this.level,
|
difficultyLevel: this.level,
|
||||||
|
@ -309,6 +305,9 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
stepTimeList: this.time_Array,
|
stepTimeList: this.time_Array,
|
||||||
remainder: this.countTime
|
remainder: this.countTime
|
||||||
};
|
};
|
||||||
|
if (cc.fx.GameConfig.CLICK_DATA.duration > 50) {
|
||||||
|
cc.fx.GameConfig.CLICK_DATA.duration = 50;
|
||||||
|
}
|
||||||
this.setData();
|
this.setData();
|
||||||
cc.tween(win_1)
|
cc.tween(win_1)
|
||||||
.delay(0.4)
|
.delay(0.4)
|
||||||
|
@ -320,7 +319,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
_this.destroyLine();
|
_this.destroyLine();
|
||||||
if (_this.over == false && _this.countTime >= 0) {
|
if (_this.over == false && _this.countTime >= 0) {
|
||||||
if (_this.level >= 15) {
|
if (_this.level >= 15) {
|
||||||
GameData_1.default._instance.GM_INFO.success = true;
|
cc.fx.GameConfig.GM_INFO.success = true;
|
||||||
_this.level += 0;
|
_this.level += 0;
|
||||||
// this.levelLabel.string = this.level + "";
|
// this.levelLabel.string = this.level + "";
|
||||||
_this.fuhuo = true;
|
_this.fuhuo = true;
|
||||||
|
@ -344,13 +343,15 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
//执行失败
|
//执行失败
|
||||||
GameManager.prototype.setLoss = function () {
|
GameManager.prototype.setLoss = function () {
|
||||||
AudioManager_1.default._instance.playWarning();
|
cc.fx.AudioManager.Instance.playWarning();
|
||||||
this.begin = false;
|
this.begin = false;
|
||||||
this.overTime = GameTool_1.GameTool.getTime();
|
this.overTime = cc.fx.GameTool.getTime();
|
||||||
if (this.startTime > 0 && this.overTime > 0) {
|
if (this.startTime > 0 && this.overTime > 0) {
|
||||||
GameData_1.default._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
cc.fx.GameConfig.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||||
}
|
}
|
||||||
var finish_time = parseInt((this.overTime - this.startTime) / 100 + "");
|
var finish_time = parseInt((this.overTime - this.startTime) / 100 + "");
|
||||||
|
if (finish_time > 58)
|
||||||
|
finish_time = 58;
|
||||||
this.startTime = 0;
|
this.startTime = 0;
|
||||||
this.overTime = 0;
|
this.overTime = 0;
|
||||||
var color = "y";
|
var color = "y";
|
||||||
|
@ -377,15 +378,15 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
sunArray.push(0);
|
sunArray.push(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameData_1.default._instance.CLICK_DATA =
|
cc.fx.GameConfig.CLICK_DATA =
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
success: false,
|
success: false,
|
||||||
round: this.round,
|
round: this.round,
|
||||||
totalSunCount: this.now_Array.length,
|
totalSunCount: this.now_Array.length,
|
||||||
movedSunCount: GameData_1.default._instance.LEVEL_INFO[this.level - 1].moveNumber,
|
movedSunCount: cc.fx.GameConfig.LEVEL_INFO[this.level - 1].moveNumber,
|
||||||
sunSpeed: GameData_1.default._instance.LEVEL_INFO[this.level - 1].moveSpeed,
|
sunSpeed: cc.fx.GameConfig.LEVEL_INFO[this.level - 1].moveSpeed,
|
||||||
overlapSunCount: GameData_1.default._instance.LEVEL_INFO[this.level - 1].repeat,
|
overlapSunCount: cc.fx.GameConfig.LEVEL_INFO[this.level - 1].repeat,
|
||||||
colorList: this.color_Array,
|
colorList: this.color_Array,
|
||||||
duration: finish_time / 10,
|
duration: finish_time / 10,
|
||||||
difficultyLevel: this.level,
|
difficultyLevel: this.level,
|
||||||
|
@ -393,6 +394,9 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
stepTimeList: this.time_Array,
|
stepTimeList: this.time_Array,
|
||||||
remainder: this.countTime
|
remainder: this.countTime
|
||||||
};
|
};
|
||||||
|
if (cc.fx.GameConfig.CLICK_DATA.duration > 50) {
|
||||||
|
cc.fx.GameConfig.CLICK_DATA.duration = 50;
|
||||||
|
}
|
||||||
this.setData();
|
this.setData();
|
||||||
if (this.fuhuo == true) {
|
if (this.fuhuo == true) {
|
||||||
this.fuhuo = false;
|
this.fuhuo = false;
|
||||||
|
@ -458,7 +462,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
_this.destroyLine();
|
_this.destroyLine();
|
||||||
_this.beginGame();
|
_this.beginGame();
|
||||||
if (GameData_1.default._instance.LEVEL_INFO[_this.level - 1].moveNumber < 1) {
|
if (cc.fx.GameConfig.LEVEL_INFO[_this.level - 1].moveNumber < 1) {
|
||||||
_this.pause = false;
|
_this.pause = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -480,7 +484,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
GameManager.prototype.createMove = function () {
|
GameManager.prototype.createMove = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (this.over == false) {
|
if (this.over == false) {
|
||||||
var info = GameData_1.default._instance.LEVEL_INFO[this.level - 1];
|
var info = cc.fx.GameConfig.LEVEL_INFO[this.level - 1];
|
||||||
//改变移动速度
|
//改变移动速度
|
||||||
var speed = 7;
|
var speed = 7;
|
||||||
if (info.moveSpeed >= 2) {
|
if (info.moveSpeed >= 2) {
|
||||||
|
@ -586,7 +590,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.updateArray();
|
this.updateArray();
|
||||||
var moveArray = this.moveArray;
|
var moveArray = this.moveArray;
|
||||||
var info = GameData_1.default._instance.LEVEL_INFO[this.level - 1];
|
var info = cc.fx.GameConfig.LEVEL_INFO[this.level - 1];
|
||||||
//改变移动速度
|
//改变移动速度
|
||||||
var speed = 7;
|
var speed = 7;
|
||||||
if (info.moveSpeed >= 2) {
|
if (info.moveSpeed >= 2) {
|
||||||
|
@ -648,29 +652,15 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
//每次重新开始新一轮儿游戏
|
//每次重新开始新一轮儿游戏
|
||||||
GameManager.prototype.beginGame = function () {
|
GameManager.prototype.beginGame = function () {
|
||||||
this.begin = true;
|
this.begin = true;
|
||||||
this.startTime = GameTool_1.GameTool.getTime();
|
this.startTime = cc.fx.GameTool.getTime();
|
||||||
this.timeStart = GameTool_1.GameTool.getTime();
|
this.timeStart = cc.fx.GameTool.getTime();
|
||||||
this.pause = false;
|
this.pause = false;
|
||||||
// this.node.getChildByName("showBtn").active = true;
|
// this.node.getChildByName("showBtn").active = true;
|
||||||
};
|
};
|
||||||
//暂时作废
|
|
||||||
// getRandomArray(lastNumber){
|
|
||||||
// let num = parseInt(Math.random()*8 - 4 + "");
|
|
||||||
// let jg = num + lastNumber;
|
|
||||||
// if(num > 1 || num <-1){
|
|
||||||
// if( num == 0 || ( jg<0 || jg >= this.Pos_Array.length)){
|
|
||||||
// jg = this.getRandomArray(lastNumber);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// jg = this.getRandomArray(lastNumber);
|
|
||||||
// }
|
|
||||||
// return jg;
|
|
||||||
// }
|
|
||||||
//创建太阳所需数据
|
//创建太阳所需数据
|
||||||
GameManager.prototype.createSun = function () {
|
GameManager.prototype.createSun = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var levelData = GameData_1.default._instance.LEVEL_INFO[this.level - 1];
|
var levelData = cc.fx.GameConfig.LEVEL_INFO[this.level - 1];
|
||||||
var tiemOut = 0;
|
var tiemOut = 0;
|
||||||
var _loop_6 = function (l) {
|
var _loop_6 = function (l) {
|
||||||
tiemOut += 1;
|
tiemOut += 1;
|
||||||
|
@ -692,7 +682,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
//创建太阳位置,颜色信息等数据
|
//创建太阳位置,颜色信息等数据
|
||||||
GameManager.prototype.createPos = function () {
|
GameManager.prototype.createPos = function () {
|
||||||
var data = { x: this.ball.x, y: this.ball.y, time: 0, timeCount: 0, color: 0, speed: 0, repeat: false };
|
var data = { x: this.ball.x, y: this.ball.y, time: 0, timeCount: 0, color: 0, speed: 0, repeat: false };
|
||||||
var levelData = GameData_1.default._instance.LEVEL_INFO[this.level - 1];
|
var levelData = cc.fx.GameConfig.LEVEL_INFO[this.level - 1];
|
||||||
//颜色区分
|
//颜色区分
|
||||||
var colorArray = [0, 1];
|
var colorArray = [0, 1];
|
||||||
for (var j = 0; j < levelData.number - 2; j++) {
|
for (var j = 0; j < levelData.number - 2; j++) {
|
||||||
|
@ -775,14 +765,15 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||||
if (distance > 160) {
|
if (distance > 160) {
|
||||||
if (num == true) {
|
if (num == true) {
|
||||||
if (distance < GameData_1.default._instance.LEVEL_INFO[this.level - 1].maxMove) {
|
cc.fx.GameConfig;
|
||||||
|
if (distance < cc.fx.GameConfig.LEVEL_INFO[this.level - 1].maxMove) {
|
||||||
jg = true;
|
jg = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
jg = false;
|
jg = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (distance < GameData_1.default._instance.LEVEL_INFO[this.level - 1].maxMove) {
|
if (distance < cc.fx.GameConfig.LEVEL_INFO[this.level - 1].maxMove) {
|
||||||
jg = true;
|
jg = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -884,7 +875,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||||
if (distance > 160) {
|
if (distance > 160) {
|
||||||
if (num == true) {
|
if (num == true) {
|
||||||
if (distance < GameData_1.default._instance.LEVEL_INFO[this.level - 1].maxDistance)
|
if (distance < cc.fx.GameConfig.LEVEL_INFO[this.level - 1].maxDistance)
|
||||||
jg = true;
|
jg = true;
|
||||||
else
|
else
|
||||||
jg = false;
|
jg = false;
|
||||||
|
@ -919,7 +910,7 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
GameManager.prototype.updateCountDownTime = function () {
|
GameManager.prototype.updateCountDownTime = function () {
|
||||||
if (this.countTime > 0 && this.pause == false) {
|
if (this.countTime > 0 && this.pause == false) {
|
||||||
this.countTime -= 1;
|
this.countTime -= 1;
|
||||||
this.time.string = GameTool_1.GameTool.getTimeMargin(this.countTime);
|
this.time.string = cc.fx.GameTool.getTimeMargin(this.countTime);
|
||||||
if (this.countTime < 5) {
|
if (this.countTime < 5) {
|
||||||
cc.tween(this.time.node)
|
cc.tween(this.time.node)
|
||||||
.to(0.25, { scale: 1.5, color: cc.color(255, 0, 0) })
|
.to(0.25, { scale: 1.5, color: cc.color(255, 0, 0) })
|
||||||
|
@ -939,9 +930,9 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
this.setLoss();
|
this.setLoss();
|
||||||
var time = 0;
|
var time = 0;
|
||||||
if (this.clickCount > 0)
|
if (this.clickCount > 0)
|
||||||
time = parseInt(GameData_1.default._instance.GM_INFO.mean_Time / this.clickCount + "");
|
time = parseInt(cc.fx.GameConfig.GM_INFO.mean_Time / this.clickCount + "");
|
||||||
GameData_1.default._instance.GM_INFO.mean_Time = parseInt(time / 100 + "");
|
cc.fx.GameConfig.GM_INFO.mean_Time = parseInt(time / 100 + "");
|
||||||
GameData_1.default._instance.GM_INFO.mean_Time = GameData_1.default._instance.GM_INFO.mean_Time / 10;
|
cc.fx.GameConfig.GM_INFO.mean_Time = cc.fx.GameConfig.GM_INFO.mean_Time / 10;
|
||||||
if (time > 10000)
|
if (time > 10000)
|
||||||
time = (Math.random() * 10 + 5) * 100;
|
time = (Math.random() * 10 + 5) * 100;
|
||||||
this.gameOver(time);
|
this.gameOver(time);
|
||||||
|
@ -950,58 +941,11 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
//上传每次操作数据
|
//上传每次操作数据
|
||||||
GameManager.prototype.setData = function () {
|
GameManager.prototype.setData = function () {
|
||||||
GameTool_1.GameTool.setGameData();
|
cc.fx.GameTool.setGameData();
|
||||||
};
|
|
||||||
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
|
||||||
GameManager.prototype.getMatchId = function () {
|
|
||||||
var matchId = cc.sys.localStorage.getItem("matchId");
|
|
||||||
if (matchId == "undifend" || matchId == null) {
|
|
||||||
matchId = this.setMatchId();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (this.containsNanana(matchId) == true) {
|
|
||||||
matchId = this.setMatchId();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var char = parseInt(matchId[10]);
|
|
||||||
if (this.round == 1) {
|
|
||||||
char += 1;
|
|
||||||
}
|
|
||||||
matchId = matchId.slice(0, 10) + char + "";
|
|
||||||
GameData_1.default._instance.GM_INFO.matchId = matchId;
|
|
||||||
cc.sys.localStorage.setItem("matchId", matchId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return matchId;
|
|
||||||
};
|
|
||||||
//检测matchId 如果有缓存以前的nanana数据清除
|
|
||||||
GameManager.prototype.containsNanana = function (str) {
|
|
||||||
return /na/i.test(str);
|
|
||||||
};
|
|
||||||
//重新设置MatchId
|
|
||||||
GameManager.prototype.setMatchId = function () {
|
|
||||||
// 定义包含可用字符的字符集
|
|
||||||
var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
||||||
// 创建一个数组以保存随机字符
|
|
||||||
var uuidArray = [];
|
|
||||||
// 循环10次 生成10位的UUID
|
|
||||||
for (var i = 0; i < 10; i++) {
|
|
||||||
// 生成随机索引,范围是字符集的长度
|
|
||||||
var randomIndex = Math.floor(Math.random() * characters.length);
|
|
||||||
// 从字符集中获取随机字符
|
|
||||||
var randomChar = characters.charAt(randomIndex);
|
|
||||||
// 将字符添加到数组中
|
|
||||||
uuidArray.push(randomChar);
|
|
||||||
}
|
|
||||||
var data = uuidArray.join('') + 1 + "";
|
|
||||||
cc.sys.localStorage.setItem("matchNumber", 1);
|
|
||||||
cc.sys.localStorage.setItem("matchId", data);
|
|
||||||
GameData_1.default._instance.GM_INFO.matchId = data;
|
|
||||||
return data;
|
|
||||||
};
|
};
|
||||||
//上传排行榜数据
|
//上传排行榜数据
|
||||||
GameManager.prototype.gameOver = function (time) {
|
GameManager.prototype.gameOver = function (time) {
|
||||||
GameTool_1.GameTool.setRank(time);
|
cc.fx.GameTool.setRank(time);
|
||||||
this.node.getChildByName("GameOver").active = true;
|
this.node.getChildByName("GameOver").active = true;
|
||||||
this.node.getChildByName("GameOver").opacity = 0;
|
this.node.getChildByName("GameOver").opacity = 0;
|
||||||
cc.tween(this.node.getChildByName("GameOver"))
|
cc.tween(this.node.getChildByName("GameOver"))
|
||||||
|
@ -1024,10 +968,10 @@ var GameManager = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
GameManager.prototype.onEnable = function () {
|
GameManager.prototype.onEnable = function () {
|
||||||
Notification_1.Notifications.on("clickSun", this.clickSun, this);
|
cc.fx.Notifications.on("clickSun", this.clickSun, this);
|
||||||
};
|
};
|
||||||
GameManager.prototype.onDisable = function () {
|
GameManager.prototype.onDisable = function () {
|
||||||
Notification_1.Notifications.off("clickSun", this.clickSun);
|
cc.fx.Notifications.off("clickSun", this.clickSun);
|
||||||
};
|
};
|
||||||
GameManager.prototype.update = function (dt) {
|
GameManager.prototype.update = function (dt) {
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,21 +1,8 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
cc._RF.push(module, '179c44L0X9IhZh7hydovv0d', 'GameData');
|
cc._RF.push(module, 'c5692vnhwNF5J9nI7VNKQNW', 'GameConfig');
|
||||||
// Script/module/Config/GameData.ts
|
// Script/module/Config/GameConfig.ts
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
var __extends = (this && this.__extends) || (function () {
|
|
||||||
var extendStatics = function (d, b) {
|
|
||||||
extendStatics = Object.setPrototypeOf ||
|
|
||||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
||||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
||||||
return extendStatics(d, b);
|
|
||||||
};
|
|
||||||
return function (d, b) {
|
|
||||||
extendStatics(d, b);
|
|
||||||
function __() { this.constructor = d; }
|
|
||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
@ -23,33 +10,53 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.GameConfig = void 0;
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
var GameData = /** @class */ (function (_super) {
|
var GameConfig = /** @class */ (function () {
|
||||||
__extends(GameData, _super);
|
function GameConfig() {
|
||||||
function GameData() {
|
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
|
||||||
}
|
}
|
||||||
GameData_1 = GameData;
|
GameConfig_1 = GameConfig;
|
||||||
GameData.prototype.onLoad = function () {
|
Object.defineProperty(GameConfig, "Instance", {
|
||||||
if (GameData_1._instance == null) {
|
get: function () {
|
||||||
GameData_1._instance = this;
|
if (this._instance == null) {
|
||||||
cc.game.addPersistRootNode(this.node);
|
this._instance = new GameConfig_1();
|
||||||
//设置为常驻,绑定音频以及游戏各类信息
|
|
||||||
this.AudioManager = this.node.getComponent('AudioManager');
|
|
||||||
}
|
}
|
||||||
else {
|
return this._instance;
|
||||||
this.node.destroy();
|
},
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
GameConfig.init = function () {
|
||||||
|
var _this = this;
|
||||||
|
cc.resources.load('Json/GM_INFO', function (err, res) {
|
||||||
|
if (err) {
|
||||||
|
_this.GM_INFO_init();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
var jsonData = res.json;
|
||||||
GameData.prototype.start = function () {
|
_this.GM_INFO = jsonData["data"];
|
||||||
this.GM_INFO_init();
|
});
|
||||||
this.CLICK_init();
|
cc.resources.load('Json/CLICK_DATA', function (err, res) {
|
||||||
this.LEVEL_INFO_init();
|
if (err) {
|
||||||
|
_this.CLICK_init();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var jsonData = res.json;
|
||||||
|
_this.CLICK_DATA = jsonData["data"];
|
||||||
|
});
|
||||||
|
cc.resources.load('Json/LEVEL_INFO', function (err, res) {
|
||||||
|
if (err) {
|
||||||
|
_this.LEVEL_INFO_init();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var jsonData = res.json;
|
||||||
|
_this.LEVEL_INFO = jsonData["data"];
|
||||||
|
});
|
||||||
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
||||||
this.GAME_DATA = [];
|
this.GAME_DATA = [];
|
||||||
};
|
};
|
||||||
GameData.prototype.GM_INFO_init = function () {
|
//数据备用
|
||||||
|
GameConfig.GM_INFO_init = function () {
|
||||||
this.GM_INFO = {
|
this.GM_INFO = {
|
||||||
// isEnd: false,
|
// isEnd: false,
|
||||||
mean_Time: 0,
|
mean_Time: 0,
|
||||||
|
@ -61,10 +68,10 @@ var GameData = /** @class */ (function (_super) {
|
||||||
url: "http://api.sparkus.cn",
|
url: "http://api.sparkus.cn",
|
||||||
success: false,
|
success: false,
|
||||||
matchId: null,
|
matchId: null,
|
||||||
custom: 0
|
custom: 0 //用于测试跳关卡
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
GameData.prototype.CLICK_init = function () {
|
GameConfig.CLICK_init = function () {
|
||||||
this.CLICK_DATA =
|
this.CLICK_DATA =
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
|
@ -79,10 +86,10 @@ var GameData = /** @class */ (function (_super) {
|
||||||
difficultyLevel: 0,
|
difficultyLevel: 0,
|
||||||
sunList: [],
|
sunList: [],
|
||||||
stepTimeList: [],
|
stepTimeList: [],
|
||||||
remainder: 120
|
remainder: 120 //游戏剩余时间
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
GameData.prototype.LEVEL_INFO_init = function () {
|
GameConfig.LEVEL_INFO_init = function () {
|
||||||
this.LEVEL_INFO = [
|
this.LEVEL_INFO = [
|
||||||
{
|
{
|
||||||
number: 3,
|
number: 3,
|
||||||
|
@ -286,12 +293,14 @@ var GameData = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
var GameData_1;
|
var GameConfig_1;
|
||||||
GameData = GameData_1 = __decorate([
|
//所有控制信息都通过GameAppStart内控制
|
||||||
ccclass
|
GameConfig._instance = null;
|
||||||
], GameData);
|
GameConfig = GameConfig_1 = __decorate([
|
||||||
return GameData;
|
ccclass('GameConfig')
|
||||||
}(cc.Component));
|
], GameConfig);
|
||||||
exports.default = GameData;
|
return GameConfig;
|
||||||
|
}());
|
||||||
|
exports.GameConfig = GameConfig;
|
||||||
|
|
||||||
cc._RF.pop();
|
cc._RF.pop();
|
|
@ -36,9 +36,7 @@ var ItemRender = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
/**数据改变时调用 */
|
/**数据改变时调用 */
|
||||||
ItemRender.prototype.dataChanged = function () {
|
ItemRender.prototype.dataChanged = function () {
|
||||||
if (this.data.name.length > 6) {
|
cc.fx.GameTool.subName(this.data.name, 6);
|
||||||
this.data.name = this.data.name.substring(0, 6) + "...";
|
|
||||||
}
|
|
||||||
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
|
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
|
||||||
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
|
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
|
||||||
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "";
|
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "";
|
||||||
|
|
23
library/imports/e1/e1d57e63-4f2f-467d-9c55-0a889d5533a8.json
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"__type__": "cc.JsonAsset",
|
||||||
|
"_name": "CLICK_DATA",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_native": "",
|
||||||
|
"json": {
|
||||||
|
"data": {
|
||||||
|
"type": 1,
|
||||||
|
"success": false,
|
||||||
|
"round": 0,
|
||||||
|
"totalSunCount": 0,
|
||||||
|
"movedSunCount": 0,
|
||||||
|
"sunSpeed": 0,
|
||||||
|
"overlapSunCount": 0,
|
||||||
|
"colorList": [],
|
||||||
|
"duration": 0,
|
||||||
|
"difficultyLevel": 0,
|
||||||
|
"sunList": [],
|
||||||
|
"stepTimeList": [],
|
||||||
|
"remainder": 120
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,7 +24,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var List_1 = require("./module/RankList/List");
|
var List_1 = require("./module/RankList/List");
|
||||||
var GameTool_1 = require("./module/Tool/GameTool");
|
|
||||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||||
//排行榜
|
//排行榜
|
||||||
var RankManager = /** @class */ (function (_super) {
|
var RankManager = /** @class */ (function (_super) {
|
||||||
|
@ -56,13 +55,16 @@ var RankManager = /** @class */ (function (_super) {
|
||||||
//调用获取排行榜接口
|
//调用获取排行榜接口
|
||||||
RankManager.prototype.getRank = function () {
|
RankManager.prototype.getRank = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
GameTool_1.GameTool.getRank(100, function (data) { return _this.getRankData(data); });
|
var dataFile = {
|
||||||
|
length: 100
|
||||||
|
};
|
||||||
|
cc.fx.GameTool.getRank(dataFile, function (data) { return _this.getRankData(data); });
|
||||||
};
|
};
|
||||||
//实际设置排行数据
|
//实际设置排行数据
|
||||||
RankManager.prototype.getRankData = function (data) {
|
RankManager.prototype.getRankData = function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
GameTool_1.GameTool.getRankData(data, this, 6);
|
cc.fx.GameTool.getRankData(data, this, 6);
|
||||||
this.setPic(this.selfData.pic);
|
this.setPic(this.selfData.pic);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|