优化代码
This commit is contained in:
parent
e977395107
commit
17010139ce
|
@ -57,7 +57,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "774829bb-123e-48b6-930e-6b3e02491506"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"uuid": "774829bb-123e-48b6-930e-6b3e02491506",
|
||||
"importer": "scene",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"subMetas": {}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "4b9c5a7e-c645-48a4-9aca-5df381ce4ef5"
|
||||
},
|
||||
{
|
||||
|
@ -1411,7 +1411,7 @@
|
|||
},
|
||||
"component": "",
|
||||
"_componentId": "805c6nf399HWZeuWnNB9CTH",
|
||||
"handler": "back",
|
||||
"handler": "openRank",
|
||||
"customEventData": ""
|
||||
},
|
||||
{
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"uuid": "4b9c5a7e-c645-48a4-9aca-5df381ce4ef5",
|
||||
"importer": "scene",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"subMetas": {}
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"importer": "scene",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"subMetas": {}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
m_delayTime: {
|
||||
default: 0,
|
||||
},
|
||||
m_fluxayTime: {
|
||||
default: 1,
|
||||
},
|
||||
m_intervalTime: {
|
||||
default: 1,
|
||||
},
|
||||
m_scale: {
|
||||
default: 1,
|
||||
},
|
||||
m_angle: {
|
||||
default: 0,
|
||||
},
|
||||
m_reviseStartTime:{
|
||||
default: 0,
|
||||
},
|
||||
m_reviseTimeScale:{
|
||||
default: 1,
|
||||
},
|
||||
},
|
||||
|
||||
ctor(){
|
||||
this._time = 0;
|
||||
},
|
||||
onLoad () {
|
||||
this._time -= this.m_delayTime;
|
||||
|
||||
let sprite = this.node.getComponent(cc.Sprite);
|
||||
this._material = sprite.getMaterial(0);
|
||||
this._material.setProperty("u_scale", this.m_scale);
|
||||
this._material.setProperty("u_angle", this.m_angle);
|
||||
|
||||
this.refreshSpriteFrameData();
|
||||
},
|
||||
|
||||
update(dt) {
|
||||
if (this._time > (this.m_fluxayTime + this.m_intervalTime)) {
|
||||
this._time = 0;
|
||||
}
|
||||
|
||||
let u_time = this._time/this.m_fluxayTime;
|
||||
if(this._time >this.m_fluxayTime)
|
||||
{
|
||||
u_time = 1+((this._time-this.m_fluxayTime)/this.m_intervalTime);
|
||||
}
|
||||
if(this.m_reviseTimeScale != null && this.m_reviseStartTime != null)
|
||||
{
|
||||
u_time = u_time/this.m_reviseTimeScale;
|
||||
u_time -= this.m_reviseStartTime;
|
||||
}
|
||||
this._material.setProperty("u_time", u_time);
|
||||
this._time += dt;
|
||||
},
|
||||
|
||||
refreshSpriteFrameData(){
|
||||
let sprite = this.node.getComponent(cc.Sprite);
|
||||
let material = sprite.getMaterial(0);
|
||||
let frame = sprite.spriteFrame;
|
||||
|
||||
if(frame != null)
|
||||
{
|
||||
// xMin
|
||||
let l = frame.uv[0];
|
||||
// xMax
|
||||
let r = frame.uv[6];
|
||||
// yMax
|
||||
let b = frame.uv[3];
|
||||
// yMin
|
||||
let t = frame.uv[5];
|
||||
// 纹理在合图中的四个边界 uv 坐标
|
||||
let u_uvOffset = new cc.Vec4(l, t, r, b);
|
||||
// 纹理是否旋转
|
||||
let u_uvRotated = frame.isRotated() ? 1.0 : 0.0;
|
||||
// 设置材质的属性
|
||||
|
||||
if(material.getProperty("u_uvOffset") !== undefined)
|
||||
{
|
||||
material.setProperty("u_uvOffset", u_uvOffset);
|
||||
}
|
||||
if(material.getProperty("u_uvRotated") !== undefined)
|
||||
{
|
||||
material.setProperty("u_uvRotated", u_uvRotated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
|
@ -1,25 +1,11 @@
|
|||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class GameData extends cc.Component {
|
||||
|
||||
@property(cc.Label)
|
||||
label: cc.Label = null;
|
||||
|
||||
@property
|
||||
text: string = 'hello';
|
||||
static _instance: any;
|
||||
GM_INFO: {};
|
||||
AudioManager: any;
|
||||
|
||||
GAME_DATA: any[];
|
||||
AudioManager: any;//音频管理
|
||||
GAME_DATA: any[];//备用
|
||||
LEVEL_INFO: { //第一难度
|
||||
number: number; //太阳总数
|
||||
moveNumber: number; //太阳可移动个数
|
||||
|
@ -28,20 +14,15 @@ export default class GameData extends cc.Component {
|
|||
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; };
|
||||
|
||||
// LEVEL_INFO: { number: number; }[];
|
||||
// LEVEL_INFO:[];
|
||||
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
|
||||
|
||||
onLoad () {
|
||||
if (GameData._instance == null) {
|
||||
GameData._instance = this;
|
||||
cc.game.addPersistRootNode(this.node);
|
||||
|
||||
this.AudioManager = this.node.getComponent('BallAudioManager');
|
||||
//设置为常驻,绑定音频以及游戏各类信息
|
||||
this.AudioManager = this.node.getComponent('AudioManager');
|
||||
}
|
||||
else {
|
||||
this.node.destroy();
|
||||
|
@ -50,6 +31,15 @@ export default class GameData extends cc.Component {
|
|||
}
|
||||
|
||||
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, //平均放箭速度
|
||||
|
@ -63,6 +53,27 @@ export default class GameData extends cc.Component {
|
|||
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, //太阳总数
|
||||
|
@ -267,47 +278,5 @@ export default class GameData extends cc.Component {
|
|||
}
|
||||
|
||||
]
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
this.GAME_DATA = [
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
|
||||
// 主游戏控制类
|
||||
const {ccclass, property} = cc._decorator;
|
||||
import GameData from './GameData';
|
||||
import { Notification } from './Notification';
|
||||
import HttpUtil from './crypto/serverAPI';
|
||||
@ccclass
|
||||
export default class GameManager extends cc.Component {
|
||||
|
||||
@property(cc.Node)
|
||||
ball: cc.Node = null;
|
||||
@property(cc.Prefab)
|
||||
|
@ -24,12 +17,9 @@ export default class GameManager extends cc.Component {
|
|||
linePrefab: cc.Prefab = null;
|
||||
@property(cc.Node)
|
||||
hit: cc.Node = null;
|
||||
|
||||
bg1: cc.Node = null;
|
||||
bg2: cc.Node = null;
|
||||
time: cc.Label = null;
|
||||
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
begin: boolean = false;
|
||||
fuhuo: boolean = false;
|
||||
over: boolean = false;
|
||||
|
@ -52,8 +42,6 @@ export default class GameManager extends cc.Component {
|
|||
Pos_Array: any[];
|
||||
time_Array: any[];
|
||||
color_Array: any[];
|
||||
|
||||
|
||||
@property(cc.Label)
|
||||
levelLabel: cc.Label = null;
|
||||
static _instance: any;
|
||||
|
@ -62,41 +50,11 @@ export default class GameManager extends cc.Component {
|
|||
numberRepeat: number;
|
||||
round: number;
|
||||
pause: boolean;
|
||||
|
||||
onLoad () {
|
||||
|
||||
}
|
||||
|
||||
onLoad () {}
|
||||
start () {
|
||||
this.fit();
|
||||
this.init();
|
||||
}
|
||||
fit(){
|
||||
this.fitTop = 450; //600
|
||||
this.fitBot = -600; //-700
|
||||
var jg = this.setFit();
|
||||
if(!jg){
|
||||
this.fitTop = 600;
|
||||
this.fitBot = -700;
|
||||
}
|
||||
}
|
||||
|
||||
getSetScreenResolutionFlag () {
|
||||
let size = cc.winSize;
|
||||
let width = size.width;
|
||||
let height = size.height;
|
||||
if ((height / width) > (16.2 / 9)) return false;
|
||||
return true;
|
||||
}
|
||||
//判断全面屏适配
|
||||
setFit () {
|
||||
let flag = this.getSetScreenResolutionFlag();
|
||||
if (flag) {
|
||||
} else {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//初始化数据
|
||||
init(){
|
||||
this.node.getChildByName("GameOver").zIndex = 100;
|
||||
|
@ -121,7 +79,6 @@ export default class GameManager extends cc.Component {
|
|||
this.countTime = 12000000;
|
||||
}
|
||||
// this.levelLabel.string = this.level + "";
|
||||
|
||||
this.timeCount = 0.1;
|
||||
this.clickNow = 0;
|
||||
this.clickCount = 0;
|
||||
|
@ -141,19 +98,40 @@ export default class GameManager extends cc.Component {
|
|||
this.overTime = 0;
|
||||
this.winTime = 0;
|
||||
GameData._instance.GM_INFO.total = 0;
|
||||
|
||||
GameData._instance.GM_INFO.mean_Time = 0;
|
||||
this.schedule(this.updateCountDownTime,1);
|
||||
|
||||
|
||||
this.startGame();
|
||||
}
|
||||
|
||||
//根据是否全面屏,做独立适配方面
|
||||
fit(){
|
||||
this.fitTop = 450; //600
|
||||
this.fitBot = -600; //-700
|
||||
var jg = this.setFit();
|
||||
if(!jg){
|
||||
this.fitTop = 600;
|
||||
this.fitBot = -700;
|
||||
}
|
||||
}
|
||||
//判断全面屏
|
||||
getSetScreenResolutionFlag () {
|
||||
let size = cc.winSize;
|
||||
let width = size.width;
|
||||
let height = size.height;
|
||||
if ((height / width) > (16.2 / 9)) return false;
|
||||
return true;
|
||||
}
|
||||
//判断全面屏适配
|
||||
setFit () {
|
||||
let flag = this.getSetScreenResolutionFlag();
|
||||
if (flag) {
|
||||
} else {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
//返回首页
|
||||
backScene(){
|
||||
cc.director.loadScene("LoadScene");
|
||||
}
|
||||
|
||||
|
||||
//下一关,或者重新开始,或者返回上一关,根据level决定
|
||||
reStart(type){
|
||||
// if(GameData._instance.GM_INFO.custom != 0){
|
||||
|
@ -167,7 +145,6 @@ export default class GameManager extends cc.Component {
|
|||
this.timeStart = 0;
|
||||
this.repeat = -1;
|
||||
this.numberRepeat = -1;
|
||||
|
||||
this.begin = false;
|
||||
this.route_Array = [];
|
||||
this.now_Array = [];
|
||||
|
@ -176,7 +153,6 @@ export default class GameManager extends cc.Component {
|
|||
this.moveArray = [];
|
||||
this.time_Array = [];
|
||||
this.color_Array = [];
|
||||
|
||||
if(type == 0){
|
||||
this.bgMove(1);
|
||||
}
|
||||
|
@ -188,17 +164,11 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
begin_Guide(){
|
||||
|
||||
}
|
||||
|
||||
//获取时间戳
|
||||
getTime(){
|
||||
const timestamp = new Date().getTime();
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
//获胜
|
||||
passLevel(){
|
||||
this.destroyLine();
|
||||
|
@ -207,8 +177,8 @@ export default class GameManager extends cc.Component {
|
|||
let timeCount = 0;
|
||||
let ball = this.ball_Array[0];
|
||||
for(let i=1; i< this.ball_Array.length; i++){
|
||||
let time = this.calculateDistance2(this.ball_Array[i].x,this.ball_Array[i].y,
|
||||
this.ball_Array[i-1].x,this.ball_Array[i-1].y);
|
||||
let time = this.calculateDistance(this.ball_Array[i].x,this.ball_Array[i].y,
|
||||
this.ball_Array[i-1].x,this.ball_Array[i-1].y,2);
|
||||
timeArray.push(time);
|
||||
}
|
||||
for(let k=1; k< this.ball_Array.length; k++){
|
||||
|
@ -232,7 +202,6 @@ export default class GameManager extends cc.Component {
|
|||
timeCount += (timeArray[k-1]+0.1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//失败
|
||||
loseLevel(type){
|
||||
|
@ -254,16 +223,14 @@ export default class GameManager extends cc.Component {
|
|||
.start()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//清理太阳
|
||||
clearSun(){
|
||||
for(let k=0; k< this.ball_Array.length; k++){
|
||||
this.ball_Array[k].removeFromParent();
|
||||
this.ball_Array[k] = null;
|
||||
}
|
||||
}
|
||||
|
||||
//点击太阳执行方法
|
||||
clickSun(data){
|
||||
if(this.begin == true){
|
||||
|
@ -279,27 +246,17 @@ export default class GameManager extends cc.Component {
|
|||
0.2);
|
||||
}
|
||||
this.clickNow += 1;
|
||||
// GameData._instance.GM_INFO.total += 1;
|
||||
if(this.ball_Array[this.clickNow-1])
|
||||
this.ball_Array[this.clickNow-1].getChildByName("guang").active = false;
|
||||
// setTimeout(() => {
|
||||
|
||||
// }, 200);
|
||||
|
||||
|
||||
if(this.clickNow == this.now_Array.length){
|
||||
this.pause = true;
|
||||
GameData._instance.GM_INFO.total += this.clickNow;
|
||||
|
||||
this.overTime = this.getTime();
|
||||
if(this.startTime > 0 && this.overTime > 0){
|
||||
GameData._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||
}
|
||||
// console.log("成功",GameData._instance.GM_INFO.mean_Time,this.overTime,this.startTime);
|
||||
// console.log(GameData._instance.GM_INFO.mean_Time);
|
||||
let finish_time = parseInt((this.overTime - this.startTime)/100+"");
|
||||
this.startTime = 0; this.overTime = 0;
|
||||
// console.log("33333333");
|
||||
let color = "y";
|
||||
if(this.level < 4 && this.level > 1)color = "yr";
|
||||
else if(this.level >= 4) color = "yrb";
|
||||
|
@ -341,8 +298,6 @@ export default class GameManager extends cc.Component {
|
|||
stepTimeList:this.time_Array,
|
||||
remainder:this.countTime
|
||||
}
|
||||
|
||||
this.outPut();
|
||||
this.setData();
|
||||
cc.tween(win)
|
||||
.delay(0.4)
|
||||
|
@ -358,18 +313,15 @@ export default class GameManager extends cc.Component {
|
|||
this.level += 0;
|
||||
// this.levelLabel.string = this.level + "";
|
||||
this.fuhuo = true;
|
||||
|
||||
this.passLevel();
|
||||
}
|
||||
else{
|
||||
this.level += 1;
|
||||
// this.levelLabel.string = this.level + "";
|
||||
this.fuhuo = true;
|
||||
|
||||
this.passLevel();
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
@ -377,11 +329,9 @@ export default class GameManager extends cc.Component {
|
|||
else{
|
||||
this.setLoss();
|
||||
}
|
||||
// this.hitAction(data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//执行失败
|
||||
setLoss(){
|
||||
GameData._instance.AudioManager.playWarning();
|
||||
this.begin = false;
|
||||
|
@ -413,7 +363,6 @@ export default class GameManager extends cc.Component {
|
|||
sunArray.push(0);
|
||||
}
|
||||
}
|
||||
|
||||
GameData._instance.CLICK_DATA =
|
||||
{
|
||||
type:1,
|
||||
|
@ -430,7 +379,6 @@ export default class GameManager extends cc.Component {
|
|||
stepTimeList:this.time_Array,
|
||||
remainder:this.countTime
|
||||
}
|
||||
this.outPut();
|
||||
this.setData();
|
||||
if(this.fuhuo == true){
|
||||
this.fuhuo = false;
|
||||
|
@ -459,22 +407,6 @@ export default class GameManager extends cc.Component {
|
|||
.to(0.1,{opacity:0})
|
||||
.start();
|
||||
}
|
||||
|
||||
hitAction(data){
|
||||
this.hit.active = true; this.hit.opacity = 0;
|
||||
this.hit.setPosition
|
||||
this.hit.setPosition(this.ball_Array[data].x+35,this.ball_Array[data].y+35);
|
||||
cc.tween(this.hit)
|
||||
.to(0,{opacity:255})
|
||||
.to(0.2,{position:cc.v3(this.hit.x-35,this.hit.y-35,0)})
|
||||
.delay(0.2)
|
||||
.to(0.1,{opacity:0})
|
||||
.call(() =>{
|
||||
this.hit.active = false;
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
//开始游戏
|
||||
startGame(){
|
||||
if(this.over == false && this.countTime > 0){
|
||||
|
@ -484,10 +416,9 @@ export default class GameManager extends cc.Component {
|
|||
cc.tween(this.ball)
|
||||
.to(0.5,{opacity:255,scale:1.3})
|
||||
.start();
|
||||
// this.runGame()
|
||||
}
|
||||
}
|
||||
|
||||
//执行太阳运行动画,以及后面移动动画
|
||||
runGame(){
|
||||
let time = -650;
|
||||
for(let i=0; i<this.now_Array.length; i++){
|
||||
|
@ -525,12 +456,10 @@ export default class GameManager extends cc.Component {
|
|||
})
|
||||
.start()
|
||||
}
|
||||
|
||||
}, time);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//设置移动重叠数据
|
||||
createMove(){
|
||||
if(this.over == false){
|
||||
let info = GameData._instance.LEVEL_INFO[this.level-1];
|
||||
|
@ -580,7 +509,6 @@ export default class GameManager extends cc.Component {
|
|||
//0 1 2 3 4 5 6 7 8 9
|
||||
//可移动区分
|
||||
let pos = cc.v2(0,0);
|
||||
|
||||
for(let z=0; z<info.number; z++){
|
||||
this.moveArray[z] = 0;
|
||||
}
|
||||
|
@ -599,11 +527,6 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
// debugger;
|
||||
//设置重叠
|
||||
// this.repeat = -1;
|
||||
// this.numberRepeat = -1;
|
||||
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
for(let k =0; k<this.moveArray.length;k++){
|
||||
if(this.moveArray[k]==1 && (k == this.repeat || k == this.numberRepeat)){
|
||||
|
@ -628,7 +551,6 @@ export default class GameManager extends cc.Component {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//移动后数据 重新刷一遍赋值
|
||||
updateArray(){
|
||||
|
@ -638,7 +560,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
}
|
||||
//太阳初始化后移动方法
|
||||
moveAction(){
|
||||
moveAction(){
|
||||
this.updateArray();
|
||||
let moveArray = this.moveArray;
|
||||
let info = GameData._instance.LEVEL_INFO[this.level-1];
|
||||
|
@ -647,18 +569,10 @@ export default class GameManager extends cc.Component {
|
|||
if(info.moveSpeed >= 2){
|
||||
speed = 7 - info.moveSpeed/2;
|
||||
}
|
||||
|
||||
|
||||
if(info.moveNumber > 0){
|
||||
//0 1 2 3 4 5 6 7 8 9
|
||||
//可移动区分
|
||||
let pos = cc.v2(0,0);
|
||||
|
||||
|
||||
// this.repeat = -1;
|
||||
// this.numberRepeat = -1;
|
||||
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
for(let k =0; k<this.moveArray.length;k++){
|
||||
if(this.moveArray[k]==1 && (k == this.repeat || k == this.numberRepeat)){
|
||||
for(let m = this.moveArray.length-1; m >= 0; m--){
|
||||
|
@ -670,7 +584,6 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
let lastNumber = 0;
|
||||
//锁定最后一个可移动的
|
||||
for(let j =0; j<moveArray.length;j++){
|
||||
|
@ -678,11 +591,10 @@ export default class GameManager extends cc.Component {
|
|||
lastNumber = j;
|
||||
}
|
||||
}
|
||||
|
||||
for(let i =0; i<this.ball_Array.length;i++){
|
||||
if(moveArray[i] == 1){
|
||||
if(i != lastNumber){ //如果不是最后一个移动的
|
||||
let time = speed*this.calculateDistance3(this.ball_Array[i].x,this.ball_Array[i].y,this.Pos_Array[i].x,this.Pos_Array[i].y);
|
||||
let time = speed*this.calculateDistance(this.ball_Array[i].x,this.ball_Array[i].y,this.Pos_Array[i].x,this.Pos_Array[i].y,3);
|
||||
this.ball_Array[i].getComponent("Sun").move = true;
|
||||
cc.tween(this.ball_Array[i])
|
||||
.to(time,{position:this.Pos_Array[i]})
|
||||
|
@ -693,7 +605,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
//如果是最后一个
|
||||
else{
|
||||
let time = speed*this.calculateDistance3(this.ball_Array[i].x,this.ball_Array[i].y,this.Pos_Array[i].x,this.Pos_Array[i].y);
|
||||
let time = speed*this.calculateDistance(this.ball_Array[i].x,this.ball_Array[i].y,this.Pos_Array[i].x,this.Pos_Array[i].y,3);
|
||||
this.ball_Array[i].getComponent("Sun").move = true;
|
||||
cc.tween(this.ball_Array[i])
|
||||
.to(time,{position:this.Pos_Array[i]})
|
||||
|
@ -706,7 +618,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//每次重新开始新一轮儿游戏
|
||||
beginGame(){
|
||||
this.begin = true;
|
||||
this.startTime = this.getTime();
|
||||
|
@ -714,21 +626,20 @@ export default class GameManager extends cc.Component {
|
|||
this.pause = false;
|
||||
// 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;
|
||||
}
|
||||
//暂时作废
|
||||
// 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;
|
||||
// }
|
||||
|
||||
//创建太阳所需数据
|
||||
createSun(){
|
||||
|
@ -747,12 +658,9 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
|
||||
}, tiemOut*100);
|
||||
|
||||
}
|
||||
// 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
}
|
||||
|
||||
//创建太阳位置,颜色信息等数据
|
||||
createPos(){
|
||||
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];
|
||||
|
@ -767,11 +675,10 @@ export default class GameManager extends cc.Component {
|
|||
colorArray.sort(() => Math.random() - 0.5);
|
||||
if(levelData.number == 4) colorArray = [0,0,0,0];
|
||||
this.color_Array = colorArray;
|
||||
|
||||
|
||||
//存储太阳数据
|
||||
for(let i=0; i<levelData.number;i++){
|
||||
let timeCount = this.timeCount + (0.6-this.calculateDistance(this.ball.x,this.ball.y,this.Pos_Array[i].x,this.Pos_Array[i].y));
|
||||
let time = this.calculateDistance(this.ball.x,this.ball.y,this.Pos_Array[i].x,this.Pos_Array[i].y)+timeCount;
|
||||
let timeCount = this.timeCount + (0.6-this.calculateDistance(this.ball.x,this.ball.y,this.Pos_Array[i].x,this.Pos_Array[i].y,1));
|
||||
let time = this.calculateDistance(this.ball.x,this.ball.y,this.Pos_Array[i].x,this.Pos_Array[i].y,1)+timeCount;
|
||||
data = {x:this.Pos_Array[i].x,y:this.Pos_Array[i].y,time:time,timeCount:timeCount,color:colorArray[i],speed:levelData.moveSpeed,repeat:false};
|
||||
if(this.repeat == i){
|
||||
data.repeat = true;
|
||||
|
@ -780,18 +687,14 @@ export default class GameManager extends cc.Component {
|
|||
data.repeat = true;
|
||||
}
|
||||
this.now_Array.push(data);
|
||||
|
||||
}
|
||||
|
||||
this.runGame();
|
||||
}
|
||||
|
||||
//获取,N个太阳位置的方法,和POS2分开两个方法,防止递归溢出
|
||||
getPos(type,num){
|
||||
let posX = Math.random()*620 - 310;
|
||||
let posY = Math.random()*(this.fitTop-this.fitBot) + this.fitBot;
|
||||
|
||||
let point = cc.v2(posX,posY);
|
||||
|
||||
if(this.Pos_Array.length > 0){
|
||||
for(let i=0; i<this.Pos_Array.length;i++){
|
||||
let distance = false;
|
||||
|
@ -809,15 +712,11 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
//获取,N个太阳可移动位置的方法,和POS分开算防止递归溢出
|
||||
getPos2(type,num){
|
||||
|
||||
let posX = Math.random()*620 - 310;
|
||||
let posY = Math.random()*(this.fitTop-this.fitBot) + this.fitBot;
|
||||
|
||||
let point = cc.v2(posX,posY);
|
||||
|
||||
|
||||
if(this.Pos_Array.length > 0){
|
||||
for(let i=0; i<this.Pos_Array.length;i++){
|
||||
let distance = false;
|
||||
|
@ -835,7 +734,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
//获取两点之间距离,返回判断是否在一定范围内 将来提出到工具类
|
||||
getDistance(x1, y1, x2, y2,num) {
|
||||
var jg = false;
|
||||
const dx = x2 - x1;
|
||||
|
@ -857,7 +756,85 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
return jg;
|
||||
}
|
||||
//命中动画
|
||||
hitAction(data){
|
||||
this.hit.active = true; this.hit.opacity = 0;
|
||||
this.hit.setPosition
|
||||
this.hit.setPosition(this.ball_Array[data].x+35,this.ball_Array[data].y+35);
|
||||
cc.tween(this.hit)
|
||||
.to(0,{opacity:255})
|
||||
.to(0.2,{position:cc.v3(this.hit.x-35,this.hit.y-35,0)})
|
||||
.delay(0.2)
|
||||
.to(0.1,{opacity:0})
|
||||
.call(() =>{
|
||||
this.hit.active = false;
|
||||
})
|
||||
.start();
|
||||
}
|
||||
//创造太阳
|
||||
createBall(number,color,speed,repeat){
|
||||
let ball = null;
|
||||
if(color == 0)ball = cc.instantiate(this.qiu1);
|
||||
else if(color == 1)ball = cc.instantiate(this.qiu2);
|
||||
else if(color == 2)ball = cc.instantiate(this.qiu3);
|
||||
ball.parent = this.node.getChildByName("Sun");
|
||||
ball.zIndex = this.now_Array.length - number;
|
||||
ball.setPosition(this.ball.x,this.ball.y);
|
||||
ball.getComponent("Sun").init(number,color,speed,repeat);
|
||||
this.ball_Array.push(ball);
|
||||
}
|
||||
//销毁连线
|
||||
destroyLine() {
|
||||
for(let i =0; i< this.node.getChildByName("Line").children.length;i++){
|
||||
if(this.node.getChildByName("Line").children[i]){
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
}
|
||||
//创建连线
|
||||
createLine(start,end,time){
|
||||
let line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
line.setPosition(start.x,start.y);
|
||||
const dx = end.x - start.x;
|
||||
const dy = end.y - start.y;
|
||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||
line.height = distance;
|
||||
line.getComponent(cc.Sprite).fillRange = 0;
|
||||
line.angle = -this.calculateAngle(start.x,start.y,end.x,end.y);
|
||||
cc.tween(line.getComponent(cc.Sprite))
|
||||
.to(time,{fillRange:1})
|
||||
.start();
|
||||
}
|
||||
//获取两点之间的角度,将来都可放工具类
|
||||
calculateAngle(x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2-y1,x2-x1)*180 / Math.PI - 90;
|
||||
return -angle;
|
||||
}
|
||||
//获取两点之间的距离 返回对应时间
|
||||
calculateDistance(x1, y1, x2, y2, num) {
|
||||
const dx = x2 - x1;
|
||||
const dy = y2 - y1;
|
||||
let time = 0;
|
||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||
if(num == 1){
|
||||
if(distance > 800) distance = 800;
|
||||
time = distance/800 * 0.6;
|
||||
}
|
||||
else if(num == 2){
|
||||
if(distance > 1200) distance = 1200;
|
||||
time = distance/1200 * 1;
|
||||
}
|
||||
else if(num == 3){
|
||||
if(distance > 1200) distance = 1200;
|
||||
time = distance/1200 * 1.5;
|
||||
}
|
||||
|
||||
return time;
|
||||
}
|
||||
//获取两点之间距离 返回距离判断
|
||||
getDistance2(x1, y1, x2, y2,num) {
|
||||
var jg = false;
|
||||
const dx = x2 - x1;
|
||||
|
@ -874,110 +851,22 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
return jg;
|
||||
}
|
||||
|
||||
|
||||
createBall(number,color,speed,repeat){
|
||||
let ball = null;
|
||||
if(color == 0)ball = cc.instantiate(this.qiu1);
|
||||
else if(color == 1)ball = cc.instantiate(this.qiu2);
|
||||
else if(color == 2)ball = cc.instantiate(this.qiu3);
|
||||
ball.parent = this.node.getChildByName("Sun");
|
||||
ball.zIndex = this.now_Array.length - number;
|
||||
ball.setPosition(this.ball.x,this.ball.y);
|
||||
ball.getComponent("Sun").init(number,color,speed,repeat);
|
||||
this.ball_Array.push(ball);
|
||||
}
|
||||
|
||||
destroyLine() {
|
||||
for(let i =0; i< this.node.getChildByName("Line").children.length;i++){
|
||||
if(this.node.getChildByName("Line").children[i]){
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
}
|
||||
|
||||
createLine(start,end,time){
|
||||
let line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
line.setPosition(start.x,start.y);
|
||||
|
||||
const dx = end.x - start.x;
|
||||
const dy = end.y - start.y;
|
||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||
line.height = distance;
|
||||
line.getComponent(cc.Sprite).fillRange = 0;
|
||||
line.angle = -this.calculateAngle(start.x,start.y,end.x,end.y);
|
||||
cc.tween(line.getComponent(cc.Sprite))
|
||||
.to(time,{fillRange:1})
|
||||
.start();
|
||||
}
|
||||
|
||||
calculateAngle(x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2-y1,x2-x1)*180 / Math.PI - 90;
|
||||
return -angle;
|
||||
}
|
||||
|
||||
calculateDistance(x1, y1, x2, y2) {
|
||||
const dx = x2 - x1;
|
||||
const dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||
if(distance > 800) distance = 800;
|
||||
const time = distance/800 * 0.6;
|
||||
return time;
|
||||
}
|
||||
|
||||
calculateDistance2(x1, y1, x2, y2) {
|
||||
const dx = x2 - x1;
|
||||
const dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||
if(distance > 1200) distance = 1200;
|
||||
const time = distance/1200 * 1;
|
||||
return time;
|
||||
}
|
||||
|
||||
calculateDistance3(x1, y1, x2, y2) {
|
||||
const dx = x2 - x1;
|
||||
const dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx*dx + dy*dy);
|
||||
if(distance > 1200) distance = 1200;
|
||||
const time = distance/1200 * 1.5;
|
||||
return time;
|
||||
}
|
||||
|
||||
//背景移动
|
||||
bgMove(type){
|
||||
let random = Math.random()*300 + 300;
|
||||
let posX = Math.random()*600 - 300;
|
||||
|
||||
let y1 = this.bg1.y - random*type;
|
||||
// let y2 = this.bg2.y - random*type;
|
||||
let time1 = 0.7*(random/400);
|
||||
|
||||
cc.tween(this.ball)
|
||||
.to(0.3,{scale:1.3})
|
||||
.to(time1,{x:posX})
|
||||
.start();
|
||||
|
||||
cc.tween(this.bg1)
|
||||
.delay(0.3)
|
||||
.to(time1,{y:y1})
|
||||
.start();
|
||||
|
||||
// cc.tween(this.bg2)
|
||||
// .delay(0.3)
|
||||
// .to(time1,{y:y2})
|
||||
// .start();
|
||||
|
||||
setTimeout(() => {
|
||||
// if(this.over == false && GameData._instance.GM_INFO.custom == 0){
|
||||
// this.startGame();
|
||||
// }
|
||||
if(this.over == false){
|
||||
this.startGame();
|
||||
}
|
||||
|
||||
if(this.over == false) this.startGame();
|
||||
}, time1*1500);
|
||||
}
|
||||
//时间格式转换
|
||||
|
@ -995,8 +884,6 @@ export default class GameManager extends cc.Component {
|
|||
if(afterMin < 10) miao = "0" + afterMin;
|
||||
return m + ':' + miao
|
||||
}
|
||||
|
||||
|
||||
//如果是倒计时 调用此方法
|
||||
updateCountDownTime () {
|
||||
if (this.countTime > 0 && this.pause == false) {
|
||||
|
@ -1020,20 +907,19 @@ export default class GameManager extends cc.Component {
|
|||
this.unschedule(this.updateCountDownTime);
|
||||
this.setLoss();
|
||||
var time = 0;
|
||||
|
||||
// console.log(GameData._instance.GM_INFO.mean_Time,this.clickCount);
|
||||
if(this.clickCount > 0) time = parseInt(GameData._instance.GM_INFO.mean_Time/this.clickCount + "");
|
||||
GameData._instance.GM_INFO.mean_Time = parseInt(time/100 + "");
|
||||
GameData._instance.GM_INFO.mean_Time = GameData._instance.GM_INFO.mean_Time /10;
|
||||
// console.log( GameData._instance.GM_INFO.mean_Time,time);
|
||||
// debugger;
|
||||
if(time > 10000) time = (Math.random()*10+5)*100;
|
||||
this.setRank(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//上传每次操作数据
|
||||
setData(){
|
||||
GameData._instance.GAME_DATA = [];
|
||||
GameData._instance.GAME_DATA.push(GameData._instance.CLICK_DATA);
|
||||
GameData._instance.CLICK_init();
|
||||
let data = GameData._instance.GAME_DATA;
|
||||
let matchId = this.getMatchId();
|
||||
console.log(matchId);
|
||||
|
@ -1044,10 +930,9 @@ export default class GameManager extends cc.Component {
|
|||
console.log("上传数据:")
|
||||
HttpUtil.uploadUserLogData(postData,function(){})
|
||||
}
|
||||
|
||||
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
||||
getMatchId (){
|
||||
let matchId = cc.sys.localStorage.getItem("matchId");
|
||||
|
||||
if(matchId == "undifend" || matchId==null){
|
||||
matchId = this.setMatchId();
|
||||
}
|
||||
|
@ -1065,20 +950,18 @@ export default class GameManager extends cc.Component {
|
|||
cc.sys.localStorage.setItem("matchId",matchId);
|
||||
}
|
||||
}
|
||||
|
||||
return matchId;
|
||||
}
|
||||
|
||||
//检测matchId 如果有缓存以前的nanana数据清除
|
||||
containsNanana(str) {
|
||||
return /na/i.test(str);
|
||||
}
|
||||
|
||||
//重新设置MatchId
|
||||
setMatchId (){
|
||||
// 定义包含可用字符的字符集
|
||||
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
// 创建一个数组以保存随机字符
|
||||
const uuidArray = [];
|
||||
|
||||
// 循环10次 生成10位的UUID
|
||||
for (let i = 0; i < 10; i++) {
|
||||
// 生成随机索引,范围是字符集的长度
|
||||
|
@ -1088,14 +971,13 @@ export default class GameManager extends cc.Component {
|
|||
// 将字符添加到数组中
|
||||
uuidArray.push(randomChar);
|
||||
}
|
||||
|
||||
let data = uuidArray.join('') + 1 + "";
|
||||
cc.sys.localStorage.setItem("matchNumber",1);
|
||||
cc.sys.localStorage.setItem("matchId",data);
|
||||
GameData._instance.GM_INFO.matchId = data;
|
||||
return data;
|
||||
}
|
||||
|
||||
//上传排行榜数据
|
||||
setRank(time){
|
||||
let postData = {
|
||||
"type":1,
|
||||
|
@ -1104,7 +986,6 @@ export default class GameManager extends cc.Component {
|
|||
"success": GameData._instance.GM_INFO.success
|
||||
|
||||
};
|
||||
// console.log(postData);
|
||||
HttpUtil.rankData(1,function(){},postData);
|
||||
this.node.getChildByName("GameOver").active = true;
|
||||
this.node.getChildByName("GameOver").opacity = 0;
|
||||
|
@ -1116,18 +997,8 @@ export default class GameManager extends cc.Component {
|
|||
cc.director.loadScene("OverScene");
|
||||
})
|
||||
.start()
|
||||
|
||||
}
|
||||
|
||||
outPut(){
|
||||
|
||||
let data = GameData._instance.CLICK_DATA;
|
||||
GameData._instance.GAME_DATA = [];
|
||||
|
||||
GameData._instance.GAME_DATA.push(GameData._instance.CLICK_DATA);
|
||||
GameData._instance.CLICK_init();
|
||||
}
|
||||
|
||||
//作弊,测试用
|
||||
showNumber(){
|
||||
if(this.show == false) this.show = true;
|
||||
else if(this.show == true) this.show = false;
|
||||
|
@ -1135,20 +1006,12 @@ export default class GameManager extends cc.Component {
|
|||
this.ball_Array[i].getComponent("Sun").showNumber(this.show);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onEnable () {
|
||||
Notification.on("clickSun", this.clickSun, this);
|
||||
// Notification.on("HammerPlay", this.HammerPlay, this);
|
||||
}
|
||||
|
||||
onDisable () {
|
||||
// Notification.off("rightAnswers", this.rightAnswers);
|
||||
Notification.off("clickSun", this.clickSun);
|
||||
}
|
||||
|
||||
|
||||
update (dt) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,13 +14,10 @@ const {ccclass, property} = cc._decorator;
|
|||
|
||||
@ccclass
|
||||
export default class NewClass extends cc.Component {
|
||||
|
||||
@property(cc.Label)
|
||||
count: cc.Label = null;
|
||||
|
||||
@property(cc.Label)
|
||||
time: cc.Label = null;
|
||||
|
||||
@property(cc.Node)
|
||||
selfNode: cc.Node = null;
|
||||
@property(cc.Node)
|
||||
|
@ -33,19 +30,19 @@ export default class NewClass extends cc.Component {
|
|||
four: cc.Node = null;
|
||||
@property(cc.Node)
|
||||
five: cc.Node = null;
|
||||
|
||||
listData: any;
|
||||
selfData: any;
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
|
||||
// onLoad () {}
|
||||
|
||||
start () {
|
||||
this.count.string = GameData._instance.GM_INFO.total;
|
||||
if(GameData._instance.GM_INFO.mean_Time > 10){
|
||||
GameData._instance.GM_INFO.mean_Time = (parseInt(Math.random()*10+"")+5)/10
|
||||
}
|
||||
this.time.string = GameData._instance.GM_INFO.mean_Time + "s";
|
||||
this.init();
|
||||
}
|
||||
//初始化数据
|
||||
init(){
|
||||
this.listData = [];
|
||||
this.selfData = null;
|
||||
this.one.active = false;
|
||||
|
@ -53,26 +50,17 @@ export default class NewClass extends cc.Component {
|
|||
this.three.active = false;
|
||||
this.four.active = false;
|
||||
this.five.active = false;
|
||||
// this.setData();
|
||||
this.getRank();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
success(data){
|
||||
}
|
||||
|
||||
|
||||
|
||||
back(){
|
||||
//打开排行榜
|
||||
openRank(){
|
||||
cc.director.loadScene("RankScene");
|
||||
}
|
||||
|
||||
//重新开始玩
|
||||
again(){
|
||||
cc.director.loadScene("GameScene");
|
||||
}
|
||||
|
||||
//获取排行榜
|
||||
getRank(){
|
||||
let postData = {
|
||||
"page":1,
|
||||
|
@ -80,7 +68,7 @@ export default class NewClass extends cc.Component {
|
|||
};
|
||||
HttpUtil.rankData(2,this.getRankData.bind(this),postData);
|
||||
}
|
||||
|
||||
//设置排行信息
|
||||
getRankData(data){
|
||||
if(data){
|
||||
this.listData = data.data.list;
|
||||
|
@ -104,10 +92,9 @@ export default class NewClass extends cc.Component {
|
|||
}
|
||||
if(i<5) this.setRank(i,this.listData[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//根据内容填充排行榜
|
||||
setRank(num,data){
|
||||
var hitNode = null;
|
||||
if(num == 0){
|
||||
|
@ -134,9 +121,8 @@ export default class NewClass extends cc.Component {
|
|||
hitNode.getChildByName("total").getComponent(cc.Label).string = data.totalSunCount;
|
||||
this.setPic(hitNode.getChildByName("pic").getChildByName("icon"),data.pic);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//设置头像
|
||||
public setPic(node,pic){
|
||||
node.active = false;
|
||||
let url = pic;
|
||||
|
@ -166,5 +152,4 @@ export default class NewClass extends cc.Component {
|
|||
})
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
//此页面为引导页面,后续更新成模板,暂时偷懒复制主游戏场景代码进来
|
||||
import GameData from './GameData';
|
||||
import { Notification } from './Notification';
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class NewClass extends cc.Component {
|
||||
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
@property(cc.Node)
|
||||
dialog: cc.Node = null;
|
||||
|
@ -29,12 +22,13 @@ export default class NewClass extends cc.Component {
|
|||
// onLoad () {}
|
||||
|
||||
start () {
|
||||
this.custom = 1;
|
||||
GameData._instance.GM_INFO.custom = 0;
|
||||
this.init();
|
||||
this.startGuide(0);
|
||||
}
|
||||
|
||||
//初始化数据
|
||||
init(){
|
||||
this.custom = 1;
|
||||
this.ball.zIndex = 100;
|
||||
this.Pos_Array = [];
|
||||
this.ball_Array = [];
|
||||
|
@ -42,13 +36,11 @@ export default class NewClass extends cc.Component {
|
|||
this.clickNow = 0;
|
||||
this.tip = null;
|
||||
}
|
||||
|
||||
//开始引导方法
|
||||
startGuide(type){
|
||||
let num = this.custom;
|
||||
let time = 0.5;
|
||||
let delay = 1.5;
|
||||
let name = "tip" + num;
|
||||
|
||||
if(type!=0){
|
||||
cc.tween(this.node)
|
||||
.to(time,{opacity:255})
|
||||
|
@ -57,12 +49,8 @@ export default class NewClass extends cc.Component {
|
|||
if(type != 0) this.custom = 2;
|
||||
if( this.custom == 2) this.createSun1();
|
||||
else if( this.custom == 3) this.createSun2();
|
||||
else if( this.custom == 4){
|
||||
|
||||
this.begin = true;
|
||||
}
|
||||
else if( this.custom == 4) this.begin = true;
|
||||
else if( this.custom == 5) cc.director.loadScene("GameScene");
|
||||
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
@ -72,98 +60,82 @@ export default class NewClass extends cc.Component {
|
|||
cc.tween(this.tip)
|
||||
.to(time,{opacity:255})
|
||||
.start();
|
||||
// cc.tween(tip)
|
||||
// .to(time,{opacity:255})
|
||||
// .delay(delay)
|
||||
// .to(time,{opacity:0})
|
||||
// .call(() =>{
|
||||
// this.custom += 1;
|
||||
// if(type != 0) this.custom = 2;
|
||||
// if( this.custom == 2) this.createSun1();
|
||||
// else if( this.custom == 3) this.createSun2();
|
||||
// else if( this.custom == 4) this.begin = true;
|
||||
// else if( this.custom == 5) cc.director.loadScene("GameScene");
|
||||
|
||||
// })
|
||||
// .start();
|
||||
}
|
||||
|
||||
}
|
||||
//创建太阳
|
||||
createSun1(){
|
||||
this.ball_Array = [];
|
||||
this.Pos_Array.push(cc.v2(-250,-216),cc.v2(200,-115),cc.v2(-35,-500));
|
||||
let time1 = this.calculateDistance(this.ball.x,this.ball.y,this.Pos_Array[0].x,this.Pos_Array[0].y)
|
||||
this.ball.opacity = 0;
|
||||
cc.tween(this.ball)
|
||||
.to(time1,{position:this.Pos_Array[0]})
|
||||
.call(() =>{
|
||||
this.createBall(0,0,0,false);
|
||||
})
|
||||
.delay(1)
|
||||
.call(() =>{
|
||||
this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
//清除所有太阳
|
||||
beginClick(){
|
||||
for(let i=0; i<this.ball_Array.length; i++){
|
||||
this.ball_Array[i].getComponent("Sun").move = false;
|
||||
}
|
||||
}
|
||||
|
||||
//点击开始游戏,或者点击跳过引导
|
||||
clickBtn(){
|
||||
cc.director.loadScene("GameScene");
|
||||
}
|
||||
|
||||
//点击下一步按钮
|
||||
next(){
|
||||
let time = 0.5;
|
||||
cc.tween(this.tip)
|
||||
.to(time,{opacity:0})
|
||||
.call(() =>{
|
||||
this.custom += 1;
|
||||
// if(type != 0) this.custom = 2;
|
||||
if( this.custom == 2) this.createSun1();
|
||||
else if( this.custom == 3) this.createSun2();
|
||||
if( this.custom == 2) this.createSun(true);
|
||||
else if( this.custom == 3) this.createSun(false);
|
||||
else if( this.custom == 4) this.begin = true;
|
||||
else if( this.custom == 5) cc.director.loadScene("GameScene");
|
||||
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
createSun2(){
|
||||
let time2 = this.calculateDistance(this.Pos_Array[0].x,this.Pos_Array[0].y,this.Pos_Array[1].x,this.Pos_Array[1].y)
|
||||
let time3 = this.calculateDistance(this.Pos_Array[1].x,this.Pos_Array[1].y,this.Pos_Array[2].x,this.Pos_Array[2].y)
|
||||
this.ball.opacity = 255;
|
||||
this.createLine(cc.v2(this.ball.x,this.ball.y),cc.v2(this.Pos_Array[1].x,this.Pos_Array[1].y),
|
||||
0.5);
|
||||
cc.tween(this.ball)
|
||||
.to(time2,{position:this.Pos_Array[1]})
|
||||
.call(() =>{
|
||||
this.createBall(1,0,0,false);
|
||||
})
|
||||
.delay(0.5)
|
||||
.call(() =>{
|
||||
this.createLine(cc.v2(this.ball.x,this.ball.y),cc.v2(this.Pos_Array[2].x,this.Pos_Array[2].y),
|
||||
0.5);
|
||||
})
|
||||
.to(time3,{position:this.Pos_Array[2]})
|
||||
.call(() =>{
|
||||
this.createBall(2,0,0,false);
|
||||
//创建太阳
|
||||
createSun(type){
|
||||
if(type == true){
|
||||
this.ball_Array = [];
|
||||
this.Pos_Array.push(cc.v2(-250,-216),cc.v2(200,-115),cc.v2(-35,-500));
|
||||
let time1 = this.calculateDistance(this.ball.x,this.ball.y,this.Pos_Array[0].x,this.Pos_Array[0].y)
|
||||
this.ball.opacity = 0;
|
||||
})
|
||||
.delay(0.2)
|
||||
.call(() =>{
|
||||
this.destroyLine();
|
||||
this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
|
||||
cc.tween(this.ball)
|
||||
.to(time1,{position:this.Pos_Array[0]})
|
||||
.call(() =>{
|
||||
this.createBall(0,0,0,false);
|
||||
})
|
||||
.delay(1)
|
||||
.call(() =>{
|
||||
this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
else{
|
||||
let time2 = this.calculateDistance(this.Pos_Array[0].x,this.Pos_Array[0].y,this.Pos_Array[1].x,this.Pos_Array[1].y)
|
||||
let time3 = this.calculateDistance(this.Pos_Array[1].x,this.Pos_Array[1].y,this.Pos_Array[2].x,this.Pos_Array[2].y)
|
||||
this.ball.opacity = 255;
|
||||
this.createLine(cc.v2(this.ball.x,this.ball.y),cc.v2(this.Pos_Array[1].x,this.Pos_Array[1].y),
|
||||
0.5);
|
||||
cc.tween(this.ball)
|
||||
.to(time2,{position:this.Pos_Array[1]})
|
||||
.call(() =>{
|
||||
this.createBall(1,0,0,false);
|
||||
})
|
||||
.delay(0.5)
|
||||
.call(() =>{
|
||||
this.createLine(cc.v2(this.ball.x,this.ball.y),cc.v2(this.Pos_Array[2].x,this.Pos_Array[2].y),
|
||||
0.5);
|
||||
})
|
||||
.to(time3,{position:this.Pos_Array[2]})
|
||||
.call(() =>{
|
||||
this.createBall(2,0,0,false);
|
||||
this.ball.opacity = 0;
|
||||
})
|
||||
.delay(0.2)
|
||||
.call(() =>{
|
||||
this.destroyLine();
|
||||
this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
}
|
||||
//创建太阳
|
||||
createBall(number,color,speed,repeat){
|
||||
let ball = null;
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
|
@ -174,7 +146,7 @@ export default class NewClass extends cc.Component {
|
|||
ball.getComponent("Sun").move = true;
|
||||
this.ball_Array.push(ball);
|
||||
}
|
||||
|
||||
//获取两点之间角度创建连线用
|
||||
calculateDistance(x1, y1, x2, y2) {
|
||||
const dx = x2 - x1;
|
||||
const dy = y2 - y1;
|
||||
|
@ -184,43 +156,50 @@ export default class NewClass extends cc.Component {
|
|||
return time;
|
||||
}
|
||||
|
||||
//移动创建下一个太阳
|
||||
moveSun(){
|
||||
|
||||
}
|
||||
|
||||
//获胜
|
||||
//引导成功
|
||||
passLevel(){
|
||||
this.destroyLine();
|
||||
let timeArray = [];
|
||||
let timeCount = 0;
|
||||
let ball = this.ball_Array[0];
|
||||
for(let i=1; i< this.ball_Array.length; i++){
|
||||
let time = this.calculateDistance(this.ball_Array[i].x,this.ball_Array[i].y,
|
||||
this.ball_Array[i-1].x,this.ball_Array[i-1].y);
|
||||
timeArray.push(time);
|
||||
}
|
||||
for(let k=1; k< this.ball_Array.length; k++){
|
||||
let win = this.node.getChildByName("Win");
|
||||
win.active = true; win.setScale(0);
|
||||
cc.tween(win)
|
||||
.delay(0.4)
|
||||
.to(0.01,{scale:2.5})
|
||||
.to(0.35,{scale:1})
|
||||
.delay(0.6)
|
||||
.call(() =>{
|
||||
win.active = false;
|
||||
setTimeout(() => {
|
||||
cc.tween(ball)
|
||||
.to(timeArray[k-1],{x:this.ball_Array[k].x,y:this.ball_Array[k].y})
|
||||
.call(() =>{
|
||||
this.ball_Array[k].active = false;
|
||||
if(k == this.ball_Array.length-1){
|
||||
setTimeout(() => {
|
||||
this.ball.opacity = 255;
|
||||
this.ball.position = cc.v3(ball.x,ball.y,0);
|
||||
this.ball.active = false;
|
||||
this.startGuide(0);
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, timeCount*1000);
|
||||
timeCount += (timeArray[k-1]+0.1);
|
||||
}
|
||||
this.destroyLine();
|
||||
let timeArray = [];
|
||||
let timeCount = 0;
|
||||
let ball = this.ball_Array[0];
|
||||
for(let i=1; i< this.ball_Array.length; i++){
|
||||
let time = this.calculateDistance(this.ball_Array[i].x,this.ball_Array[i].y,
|
||||
this.ball_Array[i-1].x,this.ball_Array[i-1].y);
|
||||
timeArray.push(time);
|
||||
}
|
||||
for(let k=1; k< this.ball_Array.length; k++){
|
||||
setTimeout(() => {
|
||||
cc.tween(ball)
|
||||
.to(timeArray[k-1],{x:this.ball_Array[k].x,y:this.ball_Array[k].y})
|
||||
.call(() =>{
|
||||
this.ball_Array[k].active = false;
|
||||
if(k == this.ball_Array.length-1){
|
||||
setTimeout(() => {
|
||||
this.ball.opacity = 255;
|
||||
this.ball.position = cc.v3(ball.x,ball.y,0);
|
||||
this.ball.active = false;
|
||||
this.startGuide(0);
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, timeCount*1000);
|
||||
timeCount += (timeArray[k-1]+0.1);
|
||||
}
|
||||
}, 400);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
//点击太阳执行方法
|
||||
clickSun(data){
|
||||
if(this.begin == true){
|
||||
|
@ -237,46 +216,19 @@ export default class NewClass extends cc.Component {
|
|||
if(this.ball_Array[this.clickNow-1])
|
||||
this.ball_Array[this.clickNow-1].getChildByName("guang").active = false;
|
||||
}, 200);
|
||||
|
||||
|
||||
if(this.clickNow == 3){
|
||||
let win = this.node.getChildByName("Win");
|
||||
win.active = true; win.setScale(0);
|
||||
cc.tween(win)
|
||||
.delay(0.4)
|
||||
.to(0.01,{scale:2.5})
|
||||
.to(0.35,{scale:1})
|
||||
.delay(0.6)
|
||||
.call(() =>{
|
||||
win.active = false;
|
||||
setTimeout(() => {
|
||||
this.passLevel();
|
||||
}, 400);
|
||||
|
||||
})
|
||||
.start();
|
||||
this.passLevel();
|
||||
}
|
||||
}
|
||||
else{
|
||||
GameData._instance.AudioManager.playWarning();
|
||||
this.begin = false;
|
||||
|
||||
this.loseLevel(1)
|
||||
let over = this.node.getChildByName("Over");
|
||||
cc.tween(over)
|
||||
.to(0.25,{opacity:255})
|
||||
.delay(0.1)
|
||||
.to(0.2,{opacity:0})
|
||||
.delay(0.1)
|
||||
.to(0.15,{opacity:255})
|
||||
.delay(0.1)
|
||||
.to(0.1,{opacity:0})
|
||||
.start();
|
||||
this.loseLevel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loseLevel(type){
|
||||
//失败事件
|
||||
loseLevel(){
|
||||
this.begin = false;
|
||||
GameData._instance.AudioManager.playWarning();
|
||||
this.destroyLine();
|
||||
let ball = this.ball_Array[0];
|
||||
for(let k=1; k< this.ball_Array.length; k++){
|
||||
|
@ -294,8 +246,19 @@ export default class NewClass extends cc.Component {
|
|||
})
|
||||
.start()
|
||||
}
|
||||
//结束页面动画
|
||||
let over = this.node.getChildByName("Over");
|
||||
cc.tween(over)
|
||||
.to(0.25,{opacity:255})
|
||||
.delay(0.1)
|
||||
.to(0.2,{opacity:0})
|
||||
.delay(0.1)
|
||||
.to(0.15,{opacity:255})
|
||||
.delay(0.1)
|
||||
.to(0.1,{opacity:0})
|
||||
.start();
|
||||
}
|
||||
|
||||
//点击太阳事件
|
||||
clearSun(){
|
||||
for(let k=0; k< this.ball_Array.length; k++){
|
||||
this.ball_Array[k].removeFromParent();
|
||||
|
@ -303,23 +266,12 @@ export default class NewClass extends cc.Component {
|
|||
}
|
||||
this.ball_Array = [];
|
||||
}
|
||||
|
||||
//获取时间戳
|
||||
getTime(){
|
||||
const timestamp = new Date().getTime();
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
destroyLine() {
|
||||
for(let i =0; i< this.node.getChildByName("Line").children.length;i++){
|
||||
if(this.node.getChildByName("Line").children[i]){
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
}
|
||||
|
||||
//创造连线,参数起点,终点,连线时间
|
||||
createLine(start,end,time){
|
||||
let line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
|
@ -335,19 +287,26 @@ export default class NewClass extends cc.Component {
|
|||
.to(time,{fillRange:1})
|
||||
.start();
|
||||
}
|
||||
|
||||
//摧毁连线
|
||||
destroyLine() {
|
||||
for(let i =0; i< this.node.getChildByName("Line").children.length;i++){
|
||||
if(this.node.getChildByName("Line").children[i]){
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
}
|
||||
//获取两个点之间的角度 用于写连线 确定连线方向
|
||||
calculateAngle(x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2-y1,x2-x1)*180 / Math.PI - 90;
|
||||
return -angle;
|
||||
}
|
||||
|
||||
onEnable () {
|
||||
Notification.on("clickSun", this.clickSun, this);
|
||||
}
|
||||
|
||||
onDisable () {
|
||||
Notification.off("clickSun", this.clickSun);
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
|
|
|
@ -1,47 +1,35 @@
|
|||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
|
||||
const {ccclass, property, requireComponent} = cc._decorator;
|
||||
import GameData from "./GameData";
|
||||
import { StorageMessage } from "./Storage";
|
||||
import HttpUtil from "./crypto/serverAPI";
|
||||
import Rq from "./crypto/serverAPI";
|
||||
// import {StorageMessage} from "./StorageMessage";
|
||||
// import { apiSign } from "./crypto/sign";
|
||||
|
||||
@ccclass
|
||||
export default class NewClass extends cc.Component {
|
||||
|
||||
@property(cc.Label)
|
||||
label: cc.Label = null;
|
||||
|
||||
@property
|
||||
text: string = 'hello';
|
||||
|
||||
|
||||
start () {
|
||||
this.Authentication();
|
||||
}
|
||||
|
||||
//鉴权,判断有无缓存userid,有的话判断是否过期,没有的话重新获取userid 并且缓存上
|
||||
private Authentication(){
|
||||
let userId = StorageMessage.getStorage("user");
|
||||
if(userId == "undifend" || userId==null){
|
||||
this.setId();
|
||||
if(userId == "undifend" || userId==null || userId == ""){
|
||||
this.setUserId();
|
||||
}
|
||||
else{
|
||||
let data = StorageMessage.getStorage("user");
|
||||
data = this.getId(data);
|
||||
data = this.getUserId(data);
|
||||
let timestamp = parseInt(new Date().getTime()/1000 + "");
|
||||
if((timestamp - data[2]) > 86400){
|
||||
this.setId();
|
||||
this.setUserId();
|
||||
return;
|
||||
}
|
||||
GameData._instance.GM_INFO.userId = data[1];
|
||||
GameData._instance.GM_INFO.userId = parseInt(GameData._instance.GM_INFO.userId);
|
||||
GameData._instance.GM_INFO.userId = parseInt(data[1]);
|
||||
}
|
||||
}
|
||||
|
||||
setId(){
|
||||
GameData._instance.GM_INFO.userId = this.getUserId();
|
||||
//设置userId,链接有获取,没有跳转授权
|
||||
private setUserId(){
|
||||
GameData._instance.GM_INFO.userId = this.getUserId(null);
|
||||
if(GameData._instance.GM_INFO.userId == null){
|
||||
let url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
|
||||
window.location.href = url;
|
||||
|
@ -54,81 +42,33 @@ export default class NewClass extends cc.Component {
|
|||
GameData._instance.GM_INFO.userId = parseInt(GameData._instance.GM_INFO.userId);
|
||||
}
|
||||
}
|
||||
|
||||
createTexture(){
|
||||
let url = "http://static.sparkus.cn/shoot-sun/assets/resources/native/7a/7a8b41ad-9425-44e2-8f55-7740f12b0e0a.jpg";
|
||||
cc.assetManager.loadRemote(url, (err, texture:cc.Texture2D) => {
|
||||
console.log(err,texture)
|
||||
if(texture){
|
||||
var sprite = this.node.getChildByName("icon").getComponent(cc.Sprite);
|
||||
sprite.spriteFrame = new cc.SpriteFrame(texture);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private getUserId() {
|
||||
//获取user id 有参数为获取gameid userid 时间戳, 无参数为只获取链接尾缀上的userId
|
||||
private getUserId(str) {
|
||||
let pathStr = window.location.search;
|
||||
|
||||
let arr=pathStr.split("&");
|
||||
if(str != null) arr=pathStr.split("?");
|
||||
if (pathStr.length>= 0&&arr.length>0) {
|
||||
let arr2=[];
|
||||
arr.map(item=>{
|
||||
arr2.push(item.split("=")[1])
|
||||
})
|
||||
// GameData._instance.GM_INFO.userId = arr2[0] + "";
|
||||
return arr2[0];
|
||||
return str == null ? arr2[0]:arr2;
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
private getId(str) {
|
||||
let pathStr = str;
|
||||
|
||||
let arr=pathStr.split("?");
|
||||
if (pathStr.length>= 0&&arr.length>0) {
|
||||
let arr2=[];
|
||||
arr.map(item=>{
|
||||
arr2.push(item.split("=")[1])
|
||||
})
|
||||
// GameData._instance.GM_INFO.userId = arr2[1] + "";
|
||||
return arr2;
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
//开始游戏,跳转至引导页面
|
||||
startGame(){
|
||||
GameData._instance.GM_INFO.custom = 0;
|
||||
cc.director.loadScene("GuideScene");
|
||||
}
|
||||
|
||||
//备用,用来测试跳转 指定关卡
|
||||
clickBtn(event,data){
|
||||
GameData._instance.GM_INFO.custom = parseInt(data);
|
||||
cc.director.loadScene("GameScene");
|
||||
}
|
||||
|
||||
openLevel(){
|
||||
this.node.getChildByName("Level").active = true;
|
||||
}
|
||||
|
||||
closeBtn(){
|
||||
this.node.getChildByName("Level").active = false;
|
||||
}
|
||||
|
||||
back(data){
|
||||
// debugger;
|
||||
}
|
||||
|
||||
openBtn(){
|
||||
GameData._instance.GM_INFO.custom = 0;
|
||||
cc.director.loadScene("GuideScene");
|
||||
}
|
||||
|
||||
//打开排行榜
|
||||
openRank(){
|
||||
cc.director.loadScene("RankScene");
|
||||
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,428 +0,0 @@
|
|||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "RankListItem",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "bg",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 164,
|
||||
"g": 118,
|
||||
"b": 239,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "6eyN1+nK5HT7svNqUsa2/+",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "rankLab",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 16,
|
||||
"g": 1,
|
||||
"b": 1,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 97.87,
|
||||
"height": 50.4
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-46.832,
|
||||
22.301,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "Label",
|
||||
"_N$string": "Label",
|
||||
"_fontSize": 40,
|
||||
"_lineHeight": 40,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 0,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "de4HHWkIhExrJq1+nHHMA6",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "nameLab",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 9
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 13,
|
||||
"g": 1,
|
||||
"b": 1,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100.06,
|
||||
"height": 50.4
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-45.717,
|
||||
-24.531,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "name",
|
||||
"_N$string": "name",
|
||||
"_fontSize": 40,
|
||||
"_lineHeight": 40,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 0,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "05c46heZhJV4sYMqYyxlB5",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "ca0f9k0oBVDbpQC+OMNTF3m",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "55FH2q1HJAyK0hrjxGH/+q",
|
||||
"sync": false
|
||||
}
|
||||
]
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"ver": "1.3.2",
|
||||
"uuid": "5aca560f-66b4-413d-95bd-73669c0bca6b",
|
||||
"importer": "prefab",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
|
@ -1,47 +1,54 @@
|
|||
import GameData from "./GameData";
|
||||
import List from "./ListView/List";
|
||||
import HttpUtil from "./crypto/serverAPI";
|
||||
// import { apiSign } from "./crypto/sign";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
//排行榜
|
||||
@ccclass
|
||||
export default class Helloworld extends cc.Component {
|
||||
|
||||
@property(cc.Node)
|
||||
export default class RankManager extends cc.Component {
|
||||
@property(cc.Node) //用户上方头像
|
||||
Player: cc.Node = null;
|
||||
|
||||
@property(cc.Node)
|
||||
@property(cc.Node) //用户最下方个人信息
|
||||
selfNode: cc.Node = null;
|
||||
|
||||
@property(cc.Sprite)
|
||||
@property(cc.Sprite) //用户头像换图
|
||||
phone: cc.Sprite = null;
|
||||
|
||||
private rankList: List; //排行榜
|
||||
tween: cc.Tween<cc.Node>;
|
||||
listData: any;
|
||||
selfData: any;
|
||||
rankNumber: number;
|
||||
rankTotal: number;
|
||||
private rankList: List; //排行榜
|
||||
tween: cc.Tween<cc.Node>; //最上方用户头像动画
|
||||
listData: any; //总列表信息
|
||||
selfData: any; //自己信息
|
||||
rankNumber: number; //用户自己排名 有可能不在排行榜内99+
|
||||
rankTotal: number; //获取排行榜用户数量 现在为100
|
||||
|
||||
onLoad() {
|
||||
this.Player.getChildByName("rank").active = false;
|
||||
this.init();
|
||||
}
|
||||
//初始化数据
|
||||
init(){
|
||||
this.rankList = cc.find("ScrollView", this.node).getComponent(List);
|
||||
this.Player.getChildByName("rank").active = false;
|
||||
this.listData = [];
|
||||
this.selfData = null;
|
||||
this.rankNumber = 100;
|
||||
this.rankTotal= 100;
|
||||
this.selfNode.opacity = 0;
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
this.Player.active = false;
|
||||
this.getRank();
|
||||
}
|
||||
|
||||
//调用获取排行榜接口
|
||||
getRank(){
|
||||
let postData = {
|
||||
"page":1,
|
||||
"pageSize":100
|
||||
};
|
||||
//回调进getRankData
|
||||
HttpUtil.rankData(2,this.getRankData.bind(this),postData);
|
||||
}
|
||||
//实际设置排行数据
|
||||
getRankData(data){
|
||||
if(data){
|
||||
// console.log(data);
|
||||
console.log(data);
|
||||
this.listData = data.data.list;
|
||||
this.selfData = data.data.info;
|
||||
let rankData = [];
|
||||
|
@ -65,7 +72,6 @@ export default class Helloworld extends cc.Component {
|
|||
this.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = this.selfData.nickName;
|
||||
this.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = this.selfData.totalSunCount;
|
||||
this.setPic(this.selfData.pic);
|
||||
this.setPic2(this.selfData.pic);
|
||||
if(this.selfNode.getChildByName("rankLab").getComponent(cc.Label).string == "1"){
|
||||
this.selfNode.getChildByName("rank").getChildByName("one").active = true;
|
||||
}
|
||||
|
@ -82,14 +88,14 @@ export default class Helloworld extends cc.Component {
|
|||
if(this.selfData.totalSunCount == 0) this.selfNode.opacity = 0;
|
||||
}
|
||||
}
|
||||
//返回按钮
|
||||
backClick(){
|
||||
cc.director.loadScene("LoadScene");
|
||||
}
|
||||
|
||||
//最上方用户动画
|
||||
playerAction(){
|
||||
//-254 377 210 453
|
||||
this.Player.getChildByName("rank").active = false;
|
||||
|
||||
let time = 1;
|
||||
this.tween = cc.tween(this.Player)
|
||||
.to(2,{position:cc.v3(210,453,0)})
|
||||
|
@ -109,12 +115,6 @@ export default class Helloworld extends cc.Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
if(this.tween)this.tween.stop();
|
||||
this.Player.getChildByName("rank").active = true;
|
||||
|
@ -123,56 +123,21 @@ export default class Helloworld extends cc.Component {
|
|||
}, time*2000);
|
||||
|
||||
}
|
||||
|
||||
getRank(){
|
||||
let postData = {
|
||||
"page":1,
|
||||
"pageSize":100
|
||||
};
|
||||
HttpUtil.rankData(2,this.getRankData.bind(this),postData);
|
||||
}
|
||||
|
||||
//设置头像
|
||||
public setPic(pic){
|
||||
this.phone.node.parent.getChildByName("icon").active = false;
|
||||
this.phone.node.active = false;
|
||||
let url = pic;
|
||||
fetch(url)
|
||||
this.Player.active = true;
|
||||
this.Player.opacity = 0;
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
this.Player.getChildByName("mask").getChildByName("phone").active = false;
|
||||
fetch(pic)
|
||||
.then(response => {
|
||||
return response.headers.get('Content-Length');
|
||||
})
|
||||
.then(errNo => {
|
||||
if(errNo == "5093"){
|
||||
this.phone.node.parent.getChildByName("icon").active = true;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching X-Info:', error);
|
||||
});
|
||||
var self = this;
|
||||
cc.assetManager.loadRemote(url, {ext:'.jpg'},(err, texture:cc.Texture2D) => {
|
||||
if(texture){
|
||||
this.phone.node.active = true;
|
||||
self.phone.spriteFrame = new cc.SpriteFrame(texture);
|
||||
}
|
||||
else{
|
||||
console.log(err,texture)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public setPic2(pic){
|
||||
this.Player.active = true;
|
||||
this.Player.opacity = 0;
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
this.Player.getChildByName("mask").getChildByName("phone").active = false;
|
||||
let url = pic;
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
return response.headers.get('Content-Length');
|
||||
})
|
||||
|
||||
.then(errNo => {
|
||||
if(errNo == "5093"){
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = true;
|
||||
}
|
||||
})
|
||||
|
@ -180,27 +145,26 @@ export default class Helloworld extends cc.Component {
|
|||
console.error('Error fetching X-Info:', error);
|
||||
});
|
||||
var self = this;
|
||||
cc.assetManager.loadRemote(url, {ext:'.jpg'},(err, texture:cc.Texture2D) => {
|
||||
cc.assetManager.loadRemote(pic, {ext:'.jpg'},(err, texture:cc.Texture2D) => {
|
||||
self.Player.opacity = 255;
|
||||
if(texture){
|
||||
this.Player.opacity = 255;
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
this.Player.getChildByName("mask").getChildByName("phone").active = true;
|
||||
this.Player.getChildByName("mask").getChildByName("phone").getComponent(cc.Sprite)
|
||||
self.phone.node.active = true;
|
||||
self.phone.spriteFrame = new cc.SpriteFrame(texture);
|
||||
self.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
self.Player.getChildByName("mask").getChildByName("phone").active = true;
|
||||
self.Player.getChildByName("mask").getChildByName("phone").getComponent(cc.Sprite)
|
||||
.spriteFrame = new cc.SpriteFrame(texture);
|
||||
setTimeout(() => {
|
||||
this.playerAction();
|
||||
self.playerAction();
|
||||
}, 500);
|
||||
// console.log("设置头像成功",err);
|
||||
}
|
||||
else{
|
||||
this.Player.opacity = 255;
|
||||
// console.log("设置头像失败",url);
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = true;
|
||||
console.log(err,texture)
|
||||
self.Player.getChildByName("mask").getChildByName("icon").active = true;
|
||||
setTimeout(() => {
|
||||
this.playerAction();
|
||||
self.playerAction();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"ver": "1.1.0",
|
||||
"uuid": "f7f5d7e6-2a27-4e6d-988c-2edb817408aa",
|
||||
"uuid": "e74a9f7d-2031-4e69-bcb2-9998174088b2",
|
||||
"importer": "typescript",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
//缓存浏览器数据
|
||||
var StorageMessage = {
|
||||
getStorage : function(key){
|
||||
var result = null;
|
||||
|
@ -15,9 +15,6 @@ var StorageMessage = {
|
|||
//主动拉起分享接口
|
||||
var temp = JSON.stringify(value);
|
||||
cc.sys.localStorage.setItem(key, temp)
|
||||
// debugger;
|
||||
// var temp = cc.sys.localStorage.getItem(key);
|
||||
// debugger;
|
||||
},
|
||||
removeStorage : function(key){
|
||||
//主动删除消息接口
|
||||
|
|
|
@ -11,25 +11,25 @@ import { Notification } from './Notification';
|
|||
|
||||
@ccclass
|
||||
export default class NewClass extends cc.Component {
|
||||
|
||||
id_Number:number
|
||||
_speed:number
|
||||
_color:number
|
||||
touch:boolean
|
||||
_repeat:boolean
|
||||
move:boolean
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
|
||||
// onLoad () {}
|
||||
|
||||
start () {
|
||||
}
|
||||
//初始化数据
|
||||
init(_id,color,speed,repeat){
|
||||
this.touch = true;
|
||||
this.move = false;
|
||||
this._color = 0;
|
||||
this._speed = 0;
|
||||
var shan = this.node.getChildByName("shan");
|
||||
|
||||
cc.tween(shan)
|
||||
this.id_Number = _id;
|
||||
this._color = color;
|
||||
this._speed = speed;
|
||||
this._repeat = repeat;
|
||||
//太阳动画
|
||||
cc.tween(this.node.getChildByName("shan"))
|
||||
.repeatForever(
|
||||
cc.tween()
|
||||
.to(1,{opacity:0,scale:0.5,})
|
||||
|
@ -38,57 +38,45 @@ export default class NewClass extends cc.Component {
|
|||
.delay(0.5)
|
||||
)
|
||||
.start();
|
||||
|
||||
}
|
||||
|
||||
init(_id,color,speed,repeat){
|
||||
this.id_Number = _id;
|
||||
this._color = color;
|
||||
this._speed = speed;
|
||||
this._repeat = repeat;
|
||||
}
|
||||
|
||||
//用于作弊 测试
|
||||
showNumber(type){
|
||||
this.node.getChildByName("number").active = type;
|
||||
if(type == true)
|
||||
this.node.getChildByName("number").getComponent(cc.Label).string = this.id_Number + "";
|
||||
}
|
||||
|
||||
clickBtn(){
|
||||
var temp = this.node.parent.parent.name;
|
||||
// console.log(temp,this.move,this.touch);
|
||||
if( this.move == false && this.touch == true){
|
||||
if(this.node.parent.parent.name == "GameNode"){
|
||||
if(this.node.parent.parent.getComponent("GameManager").begin == true){
|
||||
cc.tween(this.node.getChildByName("action"))
|
||||
.to(0.5,{opacity:0,scale:1.8})
|
||||
.start();
|
||||
cc.tween(this.node)
|
||||
.to(0.3,{scale:1.3})
|
||||
.to(0.3,{scale:1})
|
||||
.start();
|
||||
//点击事件
|
||||
clickBtn(event,data){
|
||||
if(data === "1"){
|
||||
if( this.move == false && this.touch == true){
|
||||
if(this.node.parent.parent.name == "GameNode"){
|
||||
if(this.node.parent.parent.getComponent("GameManager").begin == true){
|
||||
cc.tween(this.node.getChildByName("action"))
|
||||
.to(0.5,{opacity:0,scale:1.8})
|
||||
.start();
|
||||
cc.tween(this.node)
|
||||
.to(0.3,{scale:1.3})
|
||||
.to(0.3,{scale:1})
|
||||
.start();
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification.emit("clickSun",this.id_Number);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification.emit("clickSun",this.id_Number);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
}
|
||||
else{
|
||||
if( this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true){
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification.emit("clickSun",this.id_Number);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
clickBtn2(){
|
||||
if( this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true){
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification.emit("clickSun",this.id_Number);
|
||||
}
|
||||
}
|
||||
|
||||
update (dt) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,6 @@ cc.Class({
|
|||
callback.call(this);
|
||||
}.bind(this));
|
||||
}
|
||||
// cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src);
|
||||
|
||||
this.mAudioMap[audioSource] = context;
|
||||
return audioSource;
|
||||
|
@ -81,8 +80,6 @@ cc.Class({
|
|||
context.play()
|
||||
this.mAudioMap[audioSource] = context;
|
||||
|
||||
// cc.wwx.OutPut.log('play audio effect wx: ' + audioSource.nativeUrl);
|
||||
|
||||
return audioSource;
|
||||
}
|
||||
},
|
||||
|
@ -100,7 +97,6 @@ cc.Class({
|
|||
// this.mEffectSwitch = parseInt(volume);
|
||||
// }.bind(this), 1);
|
||||
|
||||
|
||||
this.reward = false;
|
||||
this.finish = false;
|
||||
this.rewardCount = 0;
|
10
assets/Script/tool/AudioManager.js.meta
Normal file
10
assets/Script/tool/AudioManager.js.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"ver": "1.1.0",
|
||||
"uuid": "971c4bee-6f80-49a6-aad2-08b3c9f20d55",
|
||||
"importer": "javascript",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -856,8 +856,8 @@
|
|||
},
|
||||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn2",
|
||||
"customEventData": ""
|
||||
"handler": "clickBtn",
|
||||
"customEventData": "2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "2d2f792f-a40c-49bb-a189-ed176a246e49"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -23,12 +23,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
//此页面为引导页面,后续更新成模板,暂时偷懒复制主游戏场景代码进来
|
||||
var GameData_1 = require("./GameData");
|
||||
var Notification_1 = require("./Notification");
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||
|
@ -42,15 +37,16 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.qiu1 = null;
|
||||
_this.linePrefab = null;
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
}
|
||||
// onLoad () {}
|
||||
NewClass.prototype.start = function () {
|
||||
this.custom = 1;
|
||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
||||
this.init();
|
||||
this.startGuide(0);
|
||||
};
|
||||
//初始化数据
|
||||
NewClass.prototype.init = function () {
|
||||
this.custom = 1;
|
||||
this.ball.zIndex = 100;
|
||||
this.Pos_Array = [];
|
||||
this.ball_Array = [];
|
||||
|
@ -58,11 +54,11 @@ var NewClass = /** @class */ (function (_super) {
|
|||
this.clickNow = 0;
|
||||
this.tip = null;
|
||||
};
|
||||
//开始引导方法
|
||||
NewClass.prototype.startGuide = function (type) {
|
||||
var _this = this;
|
||||
var num = this.custom;
|
||||
var time = 0.5;
|
||||
var delay = 1.5;
|
||||
var name = "tip" + num;
|
||||
if (type != 0) {
|
||||
cc.tween(this.node)
|
||||
|
@ -75,9 +71,8 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.createSun1();
|
||||
else if (_this.custom == 3)
|
||||
_this.createSun2();
|
||||
else if (_this.custom == 4) {
|
||||
else if (_this.custom == 4)
|
||||
_this.begin = true;
|
||||
}
|
||||
else if (_this.custom == 5)
|
||||
cc.director.loadScene("GameScene");
|
||||
})
|
||||
|
@ -90,47 +85,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
cc.tween(this.tip)
|
||||
.to(time, { opacity: 255 })
|
||||
.start();
|
||||
// cc.tween(tip)
|
||||
// .to(time,{opacity:255})
|
||||
// .delay(delay)
|
||||
// .to(time,{opacity:0})
|
||||
// .call(() =>{
|
||||
// this.custom += 1;
|
||||
// if(type != 0) this.custom = 2;
|
||||
// if( this.custom == 2) this.createSun1();
|
||||
// else if( this.custom == 3) this.createSun2();
|
||||
// else if( this.custom == 4) this.begin = true;
|
||||
// else if( this.custom == 5) cc.director.loadScene("GameScene");
|
||||
// })
|
||||
// .start();
|
||||
}
|
||||
};
|
||||
//创建太阳
|
||||
NewClass.prototype.createSun1 = function () {
|
||||
var _this = this;
|
||||
this.ball_Array = [];
|
||||
this.Pos_Array.push(cc.v2(-250, -216), cc.v2(200, -115), cc.v2(-35, -500));
|
||||
var time1 = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[0].x, this.Pos_Array[0].y);
|
||||
this.ball.opacity = 0;
|
||||
cc.tween(this.ball)
|
||||
.to(time1, { position: this.Pos_Array[0] })
|
||||
.call(function () {
|
||||
_this.createBall(0, 0, 0, false);
|
||||
})
|
||||
.delay(1)
|
||||
.call(function () {
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//清除所有太阳
|
||||
NewClass.prototype.beginClick = function () {
|
||||
for (var i = 0; i < this.ball_Array.length; i++) {
|
||||
this.ball_Array[i].getComponent("Sun").move = false;
|
||||
}
|
||||
};
|
||||
//点击开始游戏,或者点击跳过引导
|
||||
NewClass.prototype.clickBtn = function () {
|
||||
cc.director.loadScene("GameScene");
|
||||
};
|
||||
//点击下一步按钮
|
||||
NewClass.prototype.next = function () {
|
||||
var _this = this;
|
||||
var time = 0.5;
|
||||
|
@ -138,11 +105,10 @@ var NewClass = /** @class */ (function (_super) {
|
|||
.to(time, { opacity: 0 })
|
||||
.call(function () {
|
||||
_this.custom += 1;
|
||||
// if(type != 0) this.custom = 2;
|
||||
if (_this.custom == 2)
|
||||
_this.createSun1();
|
||||
_this.createSun(true);
|
||||
else if (_this.custom == 3)
|
||||
_this.createSun2();
|
||||
_this.createSun(false);
|
||||
else if (_this.custom == 4)
|
||||
_this.begin = true;
|
||||
else if (_this.custom == 5)
|
||||
|
@ -150,33 +116,53 @@ var NewClass = /** @class */ (function (_super) {
|
|||
})
|
||||
.start();
|
||||
};
|
||||
NewClass.prototype.createSun2 = function () {
|
||||
//创建太阳
|
||||
NewClass.prototype.createSun = function (type) {
|
||||
var _this = this;
|
||||
var time2 = this.calculateDistance(this.Pos_Array[0].x, this.Pos_Array[0].y, this.Pos_Array[1].x, this.Pos_Array[1].y);
|
||||
var time3 = this.calculateDistance(this.Pos_Array[1].x, this.Pos_Array[1].y, this.Pos_Array[2].x, this.Pos_Array[2].y);
|
||||
this.ball.opacity = 255;
|
||||
this.createLine(cc.v2(this.ball.x, this.ball.y), cc.v2(this.Pos_Array[1].x, this.Pos_Array[1].y), 0.5);
|
||||
cc.tween(this.ball)
|
||||
.to(time2, { position: this.Pos_Array[1] })
|
||||
.call(function () {
|
||||
_this.createBall(1, 0, 0, false);
|
||||
})
|
||||
.delay(0.5)
|
||||
.call(function () {
|
||||
_this.createLine(cc.v2(_this.ball.x, _this.ball.y), cc.v2(_this.Pos_Array[2].x, _this.Pos_Array[2].y), 0.5);
|
||||
})
|
||||
.to(time3, { position: this.Pos_Array[2] })
|
||||
.call(function () {
|
||||
_this.createBall(2, 0, 0, false);
|
||||
_this.ball.opacity = 0;
|
||||
})
|
||||
.delay(0.2)
|
||||
.call(function () {
|
||||
_this.destroyLine();
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
if (type == true) {
|
||||
this.ball_Array = [];
|
||||
this.Pos_Array.push(cc.v2(-250, -216), cc.v2(200, -115), cc.v2(-35, -500));
|
||||
var time1 = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[0].x, this.Pos_Array[0].y);
|
||||
this.ball.opacity = 0;
|
||||
cc.tween(this.ball)
|
||||
.to(time1, { position: this.Pos_Array[0] })
|
||||
.call(function () {
|
||||
_this.createBall(0, 0, 0, false);
|
||||
})
|
||||
.delay(1)
|
||||
.call(function () {
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
else {
|
||||
var time2 = this.calculateDistance(this.Pos_Array[0].x, this.Pos_Array[0].y, this.Pos_Array[1].x, this.Pos_Array[1].y);
|
||||
var time3 = this.calculateDistance(this.Pos_Array[1].x, this.Pos_Array[1].y, this.Pos_Array[2].x, this.Pos_Array[2].y);
|
||||
this.ball.opacity = 255;
|
||||
this.createLine(cc.v2(this.ball.x, this.ball.y), cc.v2(this.Pos_Array[1].x, this.Pos_Array[1].y), 0.5);
|
||||
cc.tween(this.ball)
|
||||
.to(time2, { position: this.Pos_Array[1] })
|
||||
.call(function () {
|
||||
_this.createBall(1, 0, 0, false);
|
||||
})
|
||||
.delay(0.5)
|
||||
.call(function () {
|
||||
_this.createLine(cc.v2(_this.ball.x, _this.ball.y), cc.v2(_this.Pos_Array[2].x, _this.Pos_Array[2].y), 0.5);
|
||||
})
|
||||
.to(time3, { position: this.Pos_Array[2] })
|
||||
.call(function () {
|
||||
_this.createBall(2, 0, 0, false);
|
||||
_this.ball.opacity = 0;
|
||||
})
|
||||
.delay(0.2)
|
||||
.call(function () {
|
||||
_this.destroyLine();
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
};
|
||||
//创建太阳
|
||||
NewClass.prototype.createBall = function (number, color, speed, repeat) {
|
||||
var ball = null;
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
|
@ -187,6 +173,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
ball.getComponent("Sun").move = true;
|
||||
this.ball_Array.push(ball);
|
||||
};
|
||||
//获取两点之间角度创建连线用
|
||||
NewClass.prototype.calculateDistance = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
|
@ -196,42 +183,53 @@ var NewClass = /** @class */ (function (_super) {
|
|||
var time = distance / 800 * 0.8;
|
||||
return time;
|
||||
};
|
||||
//移动创建下一个太阳
|
||||
NewClass.prototype.moveSun = function () {
|
||||
};
|
||||
//获胜
|
||||
//引导成功
|
||||
NewClass.prototype.passLevel = function () {
|
||||
var _this = this;
|
||||
this.destroyLine();
|
||||
var timeArray = [];
|
||||
var timeCount = 0;
|
||||
var ball = this.ball_Array[0];
|
||||
for (var i = 1; i < this.ball_Array.length; i++) {
|
||||
var time = this.calculateDistance(this.ball_Array[i].x, this.ball_Array[i].y, this.ball_Array[i - 1].x, this.ball_Array[i - 1].y);
|
||||
timeArray.push(time);
|
||||
}
|
||||
var _loop_1 = function (k) {
|
||||
var win = this.node.getChildByName("Win");
|
||||
win.active = true;
|
||||
win.setScale(0);
|
||||
cc.tween(win)
|
||||
.delay(0.4)
|
||||
.to(0.01, { scale: 2.5 })
|
||||
.to(0.35, { scale: 1 })
|
||||
.delay(0.6)
|
||||
.call(function () {
|
||||
win.active = false;
|
||||
setTimeout(function () {
|
||||
cc.tween(ball)
|
||||
.to(timeArray[k - 1], { x: _this.ball_Array[k].x, y: _this.ball_Array[k].y })
|
||||
.call(function () {
|
||||
_this.ball_Array[k].active = false;
|
||||
if (k == _this.ball_Array.length - 1) {
|
||||
setTimeout(function () {
|
||||
_this.ball.opacity = 255;
|
||||
_this.ball.position = cc.v3(ball.x, ball.y, 0);
|
||||
_this.ball.active = false;
|
||||
_this.startGuide(0);
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, timeCount * 1000);
|
||||
timeCount += (timeArray[k - 1] + 0.1);
|
||||
};
|
||||
for (var k = 1; k < this.ball_Array.length; k++) {
|
||||
_loop_1(k);
|
||||
}
|
||||
_this.destroyLine();
|
||||
var timeArray = [];
|
||||
var timeCount = 0;
|
||||
var ball = _this.ball_Array[0];
|
||||
for (var i = 1; i < _this.ball_Array.length; i++) {
|
||||
var time = _this.calculateDistance(_this.ball_Array[i].x, _this.ball_Array[i].y, _this.ball_Array[i - 1].x, _this.ball_Array[i - 1].y);
|
||||
timeArray.push(time);
|
||||
}
|
||||
var _loop_1 = function (k) {
|
||||
setTimeout(function () {
|
||||
cc.tween(ball)
|
||||
.to(timeArray[k - 1], { x: _this.ball_Array[k].x, y: _this.ball_Array[k].y })
|
||||
.call(function () {
|
||||
_this.ball_Array[k].active = false;
|
||||
if (k == _this.ball_Array.length - 1) {
|
||||
setTimeout(function () {
|
||||
_this.ball.opacity = 255;
|
||||
_this.ball.position = cc.v3(ball.x, ball.y, 0);
|
||||
_this.ball.active = false;
|
||||
_this.startGuide(0);
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, timeCount * 1000);
|
||||
timeCount += (timeArray[k - 1] + 0.1);
|
||||
};
|
||||
for (var k = 1; k < _this.ball_Array.length; k++) {
|
||||
_loop_1(k);
|
||||
}
|
||||
}, 400);
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//点击太阳执行方法
|
||||
NewClass.prototype.clickSun = function (data) {
|
||||
|
@ -249,42 +247,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.ball_Array[_this.clickNow - 1].getChildByName("guang").active = false;
|
||||
}, 200);
|
||||
if (this.clickNow == 3) {
|
||||
var win_1 = this.node.getChildByName("Win");
|
||||
win_1.active = true;
|
||||
win_1.setScale(0);
|
||||
cc.tween(win_1)
|
||||
.delay(0.4)
|
||||
.to(0.01, { scale: 2.5 })
|
||||
.to(0.35, { scale: 1 })
|
||||
.delay(0.6)
|
||||
.call(function () {
|
||||
win_1.active = false;
|
||||
setTimeout(function () {
|
||||
_this.passLevel();
|
||||
}, 400);
|
||||
})
|
||||
.start();
|
||||
this.passLevel();
|
||||
}
|
||||
}
|
||||
else {
|
||||
GameData_1.default._instance.AudioManager.playWarning();
|
||||
this.begin = false;
|
||||
this.loseLevel(1);
|
||||
var over = this.node.getChildByName("Over");
|
||||
cc.tween(over)
|
||||
.to(0.25, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.2, { opacity: 0 })
|
||||
.delay(0.1)
|
||||
.to(0.15, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.start();
|
||||
this.loseLevel();
|
||||
}
|
||||
}
|
||||
};
|
||||
NewClass.prototype.loseLevel = function (type) {
|
||||
//失败事件
|
||||
NewClass.prototype.loseLevel = function () {
|
||||
var _this = this;
|
||||
this.begin = false;
|
||||
GameData_1.default._instance.AudioManager.playWarning();
|
||||
this.destroyLine();
|
||||
var ball = this.ball_Array[0];
|
||||
var _loop_2 = function (k) {
|
||||
|
@ -306,7 +281,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
for (var k = 1; k < this.ball_Array.length; k++) {
|
||||
_loop_2(k);
|
||||
}
|
||||
//结束页面动画
|
||||
var over = this.node.getChildByName("Over");
|
||||
cc.tween(over)
|
||||
.to(0.25, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.2, { opacity: 0 })
|
||||
.delay(0.1)
|
||||
.to(0.15, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.start();
|
||||
};
|
||||
//点击太阳事件
|
||||
NewClass.prototype.clearSun = function () {
|
||||
for (var k = 0; k < this.ball_Array.length; k++) {
|
||||
this.ball_Array[k].removeFromParent();
|
||||
|
@ -319,15 +306,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
var timestamp = new Date().getTime();
|
||||
return timestamp;
|
||||
};
|
||||
NewClass.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
//创造连线,参数起点,终点,连线时间
|
||||
NewClass.prototype.createLine = function (start, end, time) {
|
||||
var line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
|
@ -342,6 +321,17 @@ var NewClass = /** @class */ (function (_super) {
|
|||
.to(time, { fillRange: 1 })
|
||||
.start();
|
||||
};
|
||||
//摧毁连线
|
||||
NewClass.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
//获取两个点之间的角度 用于写连线 确定连线方向
|
||||
NewClass.prototype.calculateAngle = function (x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90;
|
||||
return -angle;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -23,45 +23,37 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
|
||||
var GameData_1 = require("./GameData");
|
||||
var Storage_1 = require("./Storage");
|
||||
// import {StorageMessage} from "./StorageMessage";
|
||||
// import { apiSign } from "./crypto/sign";
|
||||
var NewClass = /** @class */ (function (_super) {
|
||||
__extends(NewClass, _super);
|
||||
function NewClass() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.label = null;
|
||||
_this.text = 'hello';
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
NewClass.prototype.start = function () {
|
||||
this.Authentication();
|
||||
};
|
||||
//鉴权,判断有无缓存userid,有的话判断是否过期,没有的话重新获取userid 并且缓存上
|
||||
NewClass.prototype.Authentication = function () {
|
||||
var userId = Storage_1.StorageMessage.getStorage("user");
|
||||
if (userId == "undifend" || userId == null) {
|
||||
this.setId();
|
||||
if (userId == "undifend" || userId == null || userId == "") {
|
||||
this.setUserId();
|
||||
}
|
||||
else {
|
||||
var data = Storage_1.StorageMessage.getStorage("user");
|
||||
data = this.getId(data);
|
||||
data = this.getUserId(data);
|
||||
var timestamp = parseInt(new Date().getTime() / 1000 + "");
|
||||
if ((timestamp - data[2]) > 86400) {
|
||||
this.setId();
|
||||
this.setUserId();
|
||||
return;
|
||||
}
|
||||
GameData_1.default._instance.GM_INFO.userId = data[1];
|
||||
GameData_1.default._instance.GM_INFO.userId = parseInt(GameData_1.default._instance.GM_INFO.userId);
|
||||
GameData_1.default._instance.GM_INFO.userId = parseInt(data[1]);
|
||||
}
|
||||
};
|
||||
NewClass.prototype.setId = function () {
|
||||
GameData_1.default._instance.GM_INFO.userId = this.getUserId();
|
||||
//设置userId,链接有获取,没有跳转授权
|
||||
NewClass.prototype.setUserId = function () {
|
||||
GameData_1.default._instance.GM_INFO.userId = this.getUserId(null);
|
||||
if (GameData_1.default._instance.GM_INFO.userId == null) {
|
||||
var url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
|
||||
window.location.href = url;
|
||||
|
@ -74,77 +66,36 @@ var NewClass = /** @class */ (function (_super) {
|
|||
GameData_1.default._instance.GM_INFO.userId = parseInt(GameData_1.default._instance.GM_INFO.userId);
|
||||
}
|
||||
};
|
||||
NewClass.prototype.createTexture = function () {
|
||||
var _this = this;
|
||||
var url = "http://static.sparkus.cn/shoot-sun/assets/resources/native/7a/7a8b41ad-9425-44e2-8f55-7740f12b0e0a.jpg";
|
||||
cc.assetManager.loadRemote(url, function (err, texture) {
|
||||
console.log(err, texture);
|
||||
if (texture) {
|
||||
var sprite = _this.node.getChildByName("icon").getComponent(cc.Sprite);
|
||||
sprite.spriteFrame = new cc.SpriteFrame(texture);
|
||||
}
|
||||
});
|
||||
};
|
||||
NewClass.prototype.getUserId = function () {
|
||||
//获取user id 有参数为获取gameid userid 时间戳, 无参数为只获取链接尾缀上的userId
|
||||
NewClass.prototype.getUserId = function (str) {
|
||||
var pathStr = window.location.search;
|
||||
var arr = pathStr.split("&");
|
||||
if (str != null)
|
||||
arr = pathStr.split("?");
|
||||
if (pathStr.length >= 0 && arr.length > 0) {
|
||||
var arr2_1 = [];
|
||||
arr.map(function (item) {
|
||||
arr2_1.push(item.split("=")[1]);
|
||||
});
|
||||
// GameData._instance.GM_INFO.userId = arr2[0] + "";
|
||||
return arr2_1[0];
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
NewClass.prototype.getId = function (str) {
|
||||
var pathStr = str;
|
||||
var arr = pathStr.split("?");
|
||||
if (pathStr.length >= 0 && arr.length > 0) {
|
||||
var arr2_2 = [];
|
||||
arr.map(function (item) {
|
||||
arr2_2.push(item.split("=")[1]);
|
||||
});
|
||||
// GameData._instance.GM_INFO.userId = arr2[1] + "";
|
||||
return arr2_2;
|
||||
return str == null ? arr2_1[0] : arr2_1;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
//开始游戏,跳转至引导页面
|
||||
NewClass.prototype.startGame = function () {
|
||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
||||
cc.director.loadScene("GuideScene");
|
||||
};
|
||||
//备用,用来测试跳转 指定关卡
|
||||
NewClass.prototype.clickBtn = function (event, data) {
|
||||
GameData_1.default._instance.GM_INFO.custom = parseInt(data);
|
||||
cc.director.loadScene("GameScene");
|
||||
};
|
||||
NewClass.prototype.openLevel = function () {
|
||||
this.node.getChildByName("Level").active = true;
|
||||
};
|
||||
NewClass.prototype.closeBtn = function () {
|
||||
this.node.getChildByName("Level").active = false;
|
||||
};
|
||||
NewClass.prototype.back = function (data) {
|
||||
// debugger;
|
||||
};
|
||||
NewClass.prototype.openBtn = function () {
|
||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
||||
cc.director.loadScene("GuideScene");
|
||||
};
|
||||
//打开排行榜
|
||||
NewClass.prototype.openRank = function () {
|
||||
cc.director.loadScene("RankScene");
|
||||
};
|
||||
__decorate([
|
||||
property(cc.Label)
|
||||
], NewClass.prototype, "label", void 0);
|
||||
__decorate([
|
||||
property
|
||||
], NewClass.prototype, "text", void 0);
|
||||
NewClass = __decorate([
|
||||
ccclass
|
||||
], NewClass);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -58,7 +58,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "4b9c5a7e-c645-48a4-9aca-5df381ce4ef5"
|
||||
},
|
||||
{
|
||||
|
@ -1412,7 +1412,7 @@
|
|||
},
|
||||
"component": "",
|
||||
"_componentId": "805c6nf399HWZeuWnNB9CTH",
|
||||
"handler": "back",
|
||||
"handler": "openRank",
|
||||
"customEventData": ""
|
||||
},
|
||||
{
|
||||
|
|
|
@ -36,15 +36,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
function NewClass() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
// onLoad () {}
|
||||
NewClass.prototype.start = function () {
|
||||
};
|
||||
//初始化数据
|
||||
NewClass.prototype.init = function (_id, color, speed, repeat) {
|
||||
this.touch = true;
|
||||
this.move = false;
|
||||
this._color = 0;
|
||||
this._speed = 0;
|
||||
var shan = this.node.getChildByName("shan");
|
||||
cc.tween(shan)
|
||||
this.id_Number = _id;
|
||||
this._color = color;
|
||||
this._speed = speed;
|
||||
this._repeat = repeat;
|
||||
//太阳动画
|
||||
cc.tween(this.node.getChildByName("shan"))
|
||||
.repeatForever(cc.tween()
|
||||
.to(1, { opacity: 0, scale: 0.5, })
|
||||
.delay(0.2)
|
||||
|
@ -52,51 +56,45 @@ var NewClass = /** @class */ (function (_super) {
|
|||
.delay(0.5))
|
||||
.start();
|
||||
};
|
||||
NewClass.prototype.init = function (_id, color, speed, repeat) {
|
||||
this.id_Number = _id;
|
||||
this._color = color;
|
||||
this._speed = speed;
|
||||
this._repeat = repeat;
|
||||
};
|
||||
//用于作弊 测试
|
||||
NewClass.prototype.showNumber = function (type) {
|
||||
this.node.getChildByName("number").active = type;
|
||||
if (type == true)
|
||||
this.node.getChildByName("number").getComponent(cc.Label).string = this.id_Number + "";
|
||||
};
|
||||
NewClass.prototype.clickBtn = function () {
|
||||
var temp = this.node.parent.parent.name;
|
||||
// console.log(temp,this.move,this.touch);
|
||||
if (this.move == false && this.touch == true) {
|
||||
if (this.node.parent.parent.name == "GameNode") {
|
||||
if (this.node.parent.parent.getComponent("GameManager").begin == true) {
|
||||
cc.tween(this.node.getChildByName("action"))
|
||||
.to(0.5, { opacity: 0, scale: 1.8 })
|
||||
.start();
|
||||
cc.tween(this.node)
|
||||
.to(0.3, { scale: 1.3 })
|
||||
.to(0.3, { scale: 1 })
|
||||
.start();
|
||||
//点击事件
|
||||
NewClass.prototype.clickBtn = function (event, data) {
|
||||
if (data === "1") {
|
||||
if (this.move == false && this.touch == true) {
|
||||
if (this.node.parent.parent.name == "GameNode") {
|
||||
if (this.node.parent.parent.getComponent("GameManager").begin == true) {
|
||||
cc.tween(this.node.getChildByName("action"))
|
||||
.to(0.5, { opacity: 0, scale: 1.8 })
|
||||
.start();
|
||||
cc.tween(this.node)
|
||||
.to(0.3, { scale: 1.3 })
|
||||
.to(0.3, { scale: 1 })
|
||||
.start();
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification_1.Notification.emit("clickSun", this.id_Number);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification_1.Notification.emit("clickSun", this.id_Number);
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
if (this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true) {
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification_1.Notification.emit("clickSun", this.id_Number);
|
||||
}
|
||||
}
|
||||
};
|
||||
NewClass.prototype.clickBtn2 = function () {
|
||||
if (this.touch == true && this.node.parent.parent.getComponent("GuideManager").begin == true) {
|
||||
this.touch = false;
|
||||
this.node.zIndex = -1;
|
||||
Notification_1.Notification.emit("clickSun", this.id_Number);
|
||||
}
|
||||
};
|
||||
NewClass.prototype.update = function (dt) {
|
||||
};
|
||||
NewClass = __decorate([
|
||||
ccclass
|
||||
], NewClass);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,428 +0,0 @@
|
|||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "RankListItem",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "RankListItem",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "bg",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 164,
|
||||
"g": 118,
|
||||
"b": 239,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "6eyN1+nK5HT7svNqUsa2/+",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "rankLab",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 16,
|
||||
"g": 1,
|
||||
"b": 1,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 97.87,
|
||||
"height": 50.4
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-46.832,
|
||||
22.301,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "Label",
|
||||
"_N$string": "Label",
|
||||
"_fontSize": 40,
|
||||
"_lineHeight": 40,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 0,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "de4HHWkIhExrJq1+nHHMA6",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "nameLab",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 9
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 13,
|
||||
"g": 1,
|
||||
"b": 1,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100.06,
|
||||
"height": 50.4
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-45.717,
|
||||
-24.531,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_useOriginalSize": false,
|
||||
"_string": "name",
|
||||
"_N$string": "name",
|
||||
"_fontSize": 40,
|
||||
"_lineHeight": 40,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 0,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "05c46heZhJV4sYMqYyxlB5",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "ca0f9k0oBVDbpQC+OMNTF3m",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "5aca560f-66b4-413d-95bd-73669c0bca6b"
|
||||
},
|
||||
"fileId": "55FH2q1HJAyK0hrjxGH/+q",
|
||||
"sync": false
|
||||
}
|
||||
]
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "774829bb-123e-48b6-930e-6b3e02491506"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -5,8 +5,7 @@ cc._RF.push(module, '7cf8cMT5zJA0ZU4Gp0JcL8v', 'Storage');
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StorageMessage = void 0;
|
||||
// var jequry = require("jquery");
|
||||
// var coinManager = require("coinManager");
|
||||
//缓存浏览器数据
|
||||
var StorageMessage = {
|
||||
getStorage: function (key) {
|
||||
var result = null;
|
||||
|
@ -22,9 +21,6 @@ var StorageMessage = {
|
|||
//主动拉起分享接口
|
||||
var temp = JSON.stringify(value);
|
||||
cc.sys.localStorage.setItem(key, temp);
|
||||
// debugger;
|
||||
// var temp = cc.sys.localStorage.getItem(key);
|
||||
// debugger;
|
||||
},
|
||||
removeStorage: function (key) {
|
||||
//主动删除消息接口
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["assets\\Script\\Storage.ts"],"names":[],"mappings":";;;;;;;AACA,kCAAkC;AAClC,4CAA4C;AAC5C,IAAI,cAAc,GAAG;IACjB,UAAU,EAAG,UAAS,GAAG;QACrB,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAC;YAClC,IAAI,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SAC/C;QAED,IAAG,MAAM,EAAC;YACR,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,UAAU,EAAG,UAAS,GAAG,EAAC,KAAK;QAC3B,UAAU;QACV,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACtC,YAAY;QACZ,+CAA+C;QAC/C,YAAY;IAChB,CAAC;IACD,aAAa,EAAG,UAAS,GAAG;QAC1B,UAAU;QACV,IAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAC;YAClC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;SACpC;IACH,CAAC;CACJ,CAAC;AAEO,wCAAc","file":"","sourceRoot":"/","sourcesContent":["\n// var jequry = require(\"jquery\");\n// var coinManager = require(\"coinManager\");\nvar StorageMessage = {\n getStorage : function(key){\n var result = null;\n if(cc.sys.localStorage.getItem(key)){\n var result = cc.sys.localStorage.getItem(key);\n }\n \n if(result){\n result = JSON.parse(result);\n }\n return result;\n },\n setStorage : function(key,value){\n //主动拉起分享接口\n var temp = JSON.stringify(value);\n cc.sys.localStorage.setItem(key, temp)\n // debugger;\n // var temp = cc.sys.localStorage.getItem(key);\n // debugger;\n },\n removeStorage : function(key){\n //主动删除消息接口\n if(cc.sys.localStorage.getItem(key)){\n cc.sys.localStorage.removeItem(key)\n }\n },\n};\n\nexport { StorageMessage };"]}
|
||||
{"version":3,"sources":["assets\\Script\\Storage.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAS;AACT,IAAI,cAAc,GAAG;IACjB,UAAU,EAAG,UAAS,GAAG;QACrB,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAC;YAClC,IAAI,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SAC/C;QAED,IAAG,MAAM,EAAC;YACR,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,UAAU,EAAG,UAAS,GAAG,EAAC,KAAK;QAC3B,UAAU;QACV,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC;IACD,aAAa,EAAG,UAAS,GAAG;QAC1B,UAAU;QACV,IAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAC;YAClC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;SACpC;IACH,CAAC;CACJ,CAAC;AAEO,wCAAc","file":"","sourceRoot":"/","sourcesContent":["//缓存浏览器数据\nvar StorageMessage = {\n getStorage : function(key){\n var result = null;\n if(cc.sys.localStorage.getItem(key)){\n var result = cc.sys.localStorage.getItem(key);\n }\n \n if(result){\n result = JSON.parse(result);\n }\n return result;\n },\n setStorage : function(key,value){\n //主动拉起分享接口\n var temp = JSON.stringify(value);\n cc.sys.localStorage.setItem(key, temp)\n },\n removeStorage : function(key){\n //主动删除消息接口\n if(cc.sys.localStorage.getItem(key)){\n cc.sys.localStorage.removeItem(key)\n }\n },\n};\n\nexport { StorageMessage };"]}
|
|
@ -45,9 +45,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.four = null;
|
||||
_this.five = null;
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
}
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
// onLoad () {}
|
||||
NewClass.prototype.start = function () {
|
||||
this.count.string = GameData_1.default._instance.GM_INFO.total;
|
||||
|
@ -55,6 +53,10 @@ var NewClass = /** @class */ (function (_super) {
|
|||
GameData_1.default._instance.GM_INFO.mean_Time = (parseInt(Math.random() * 10 + "") + 5) / 10;
|
||||
}
|
||||
this.time.string = GameData_1.default._instance.GM_INFO.mean_Time + "s";
|
||||
this.init();
|
||||
};
|
||||
//初始化数据
|
||||
NewClass.prototype.init = function () {
|
||||
this.listData = [];
|
||||
this.selfData = null;
|
||||
this.one.active = false;
|
||||
|
@ -62,17 +64,17 @@ var NewClass = /** @class */ (function (_super) {
|
|||
this.three.active = false;
|
||||
this.four.active = false;
|
||||
this.five.active = false;
|
||||
// this.setData();
|
||||
this.getRank();
|
||||
};
|
||||
NewClass.prototype.success = function (data) {
|
||||
};
|
||||
NewClass.prototype.back = function () {
|
||||
//打开排行榜
|
||||
NewClass.prototype.openRank = function () {
|
||||
cc.director.loadScene("RankScene");
|
||||
};
|
||||
//重新开始玩
|
||||
NewClass.prototype.again = function () {
|
||||
cc.director.loadScene("GameScene");
|
||||
};
|
||||
//获取排行榜
|
||||
NewClass.prototype.getRank = function () {
|
||||
var postData = {
|
||||
"page": 1,
|
||||
|
@ -80,6 +82,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
};
|
||||
serverAPI_1.default.rankData(2, this.getRankData.bind(this), postData);
|
||||
};
|
||||
//设置排行信息
|
||||
NewClass.prototype.getRankData = function (data) {
|
||||
if (data) {
|
||||
this.listData = data.data.list;
|
||||
|
@ -106,6 +109,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
};
|
||||
//根据内容填充排行榜
|
||||
NewClass.prototype.setRank = function (num, data) {
|
||||
var hitNode = null;
|
||||
if (num == 0) {
|
||||
|
@ -133,6 +137,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
this.setPic(hitNode.getChildByName("pic").getChildByName("icon"), data.pic);
|
||||
}
|
||||
};
|
||||
//设置头像
|
||||
NewClass.prototype.setPic = function (node, pic) {
|
||||
node.active = false;
|
||||
var url = pic;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
cc._RF.push(module, 'bd9f78XOD5PmLTjk2rLYBiz', 'BallAudioManager');
|
||||
// Script/BallAudioManager.js
|
||||
cc._RF.push(module, '971c4vub4BJpqrSCLPJ8g1V', 'AudioManager');
|
||||
// Script/AudioManager.js
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -59,8 +59,7 @@ cc.Class({
|
|||
cc.audioEngine.setFinishCallback(context, function () {
|
||||
callback.call(this);
|
||||
}.bind(this));
|
||||
} // cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src);
|
||||
|
||||
}
|
||||
|
||||
this.mAudioMap[audioSource] = context;
|
||||
return audioSource;
|
||||
|
@ -82,8 +81,7 @@ cc.Class({
|
|||
|
||||
context.src = audioSource.nativeUrl;
|
||||
context.play();
|
||||
this.mAudioMap[audioSource] = context; // cc.wwx.OutPut.log('play audio effect wx: ' + audioSource.nativeUrl);
|
||||
|
||||
this.mAudioMap[audioSource] = context;
|
||||
return audioSource;
|
||||
}
|
||||
},
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -3,12 +3,6 @@ cc._RF.push(module, 'b0432BA295DjIOcuitdGKO1', 'GameManager');
|
|||
// Script/GameManager.ts
|
||||
|
||||
"use strict";
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
|
@ -29,6 +23,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// 主游戏控制类
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||
var GameData_1 = require("./GameData");
|
||||
var Notification_1 = require("./Notification");
|
||||
|
@ -46,7 +41,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
_this.bg1 = null;
|
||||
_this.bg2 = null;
|
||||
_this.time = null;
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
_this.begin = false;
|
||||
_this.fuhuo = false;
|
||||
_this.over = false;
|
||||
|
@ -54,38 +48,11 @@ var GameManager = /** @class */ (function (_super) {
|
|||
_this.levelLabel = null;
|
||||
return _this;
|
||||
}
|
||||
GameManager.prototype.onLoad = function () {
|
||||
};
|
||||
GameManager.prototype.onLoad = function () { };
|
||||
GameManager.prototype.start = function () {
|
||||
this.fit();
|
||||
this.init();
|
||||
};
|
||||
GameManager.prototype.fit = function () {
|
||||
this.fitTop = 450; //600
|
||||
this.fitBot = -600; //-700
|
||||
var jg = this.setFit();
|
||||
if (!jg) {
|
||||
this.fitTop = 600;
|
||||
this.fitBot = -700;
|
||||
}
|
||||
};
|
||||
GameManager.prototype.getSetScreenResolutionFlag = function () {
|
||||
var size = cc.winSize;
|
||||
var width = size.width;
|
||||
var height = size.height;
|
||||
if ((height / width) > (16.2 / 9))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
//判断全面屏适配
|
||||
GameManager.prototype.setFit = function () {
|
||||
var flag = this.getSetScreenResolutionFlag();
|
||||
if (flag) {
|
||||
}
|
||||
else {
|
||||
}
|
||||
return flag;
|
||||
};
|
||||
//初始化数据
|
||||
GameManager.prototype.init = function () {
|
||||
this.node.getChildByName("GameOver").zIndex = 100;
|
||||
|
@ -133,6 +100,35 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.schedule(this.updateCountDownTime, 1);
|
||||
this.startGame();
|
||||
};
|
||||
//根据是否全面屏,做独立适配方面
|
||||
GameManager.prototype.fit = function () {
|
||||
this.fitTop = 450; //600
|
||||
this.fitBot = -600; //-700
|
||||
var jg = this.setFit();
|
||||
if (!jg) {
|
||||
this.fitTop = 600;
|
||||
this.fitBot = -700;
|
||||
}
|
||||
};
|
||||
//判断全面屏
|
||||
GameManager.prototype.getSetScreenResolutionFlag = function () {
|
||||
var size = cc.winSize;
|
||||
var width = size.width;
|
||||
var height = size.height;
|
||||
if ((height / width) > (16.2 / 9))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
//判断全面屏适配
|
||||
GameManager.prototype.setFit = function () {
|
||||
var flag = this.getSetScreenResolutionFlag();
|
||||
if (flag) {
|
||||
}
|
||||
else {
|
||||
}
|
||||
return flag;
|
||||
};
|
||||
//返回首页
|
||||
GameManager.prototype.backScene = function () {
|
||||
cc.director.loadScene("LoadScene");
|
||||
};
|
||||
|
@ -167,8 +163,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.bgMove(-1);
|
||||
}
|
||||
};
|
||||
GameManager.prototype.begin_Guide = function () {
|
||||
};
|
||||
//获取时间戳
|
||||
GameManager.prototype.getTime = function () {
|
||||
var timestamp = new Date().getTime();
|
||||
|
@ -183,7 +177,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
var timeCount = 0;
|
||||
var ball_1 = this.ball_Array[0];
|
||||
for (var i = 1; i < this.ball_Array.length; i++) {
|
||||
var time = this.calculateDistance2(this.ball_Array[i].x, this.ball_Array[i].y, this.ball_Array[i - 1].x, this.ball_Array[i - 1].y);
|
||||
var time = this.calculateDistance(this.ball_Array[i].x, this.ball_Array[i].y, this.ball_Array[i - 1].x, this.ball_Array[i - 1].y, 2);
|
||||
timeArray_1.push(time);
|
||||
}
|
||||
var _loop_1 = function (k) {
|
||||
|
@ -237,6 +231,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
};
|
||||
//清理太阳
|
||||
GameManager.prototype.clearSun = function () {
|
||||
for (var k = 0; k < this.ball_Array.length; k++) {
|
||||
this.ball_Array[k].removeFromParent();
|
||||
|
@ -257,11 +252,8 @@ var GameManager = /** @class */ (function (_super) {
|
|||
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;
|
||||
// GameData._instance.GM_INFO.total += 1;
|
||||
if (this.ball_Array[this.clickNow - 1])
|
||||
this.ball_Array[this.clickNow - 1].getChildByName("guang").active = false;
|
||||
// setTimeout(() => {
|
||||
// }, 200);
|
||||
if (this.clickNow == this.now_Array.length) {
|
||||
this.pause = true;
|
||||
GameData_1.default._instance.GM_INFO.total += this.clickNow;
|
||||
|
@ -269,12 +261,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
if (this.startTime > 0 && this.overTime > 0) {
|
||||
GameData_1.default._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||
}
|
||||
// console.log("成功",GameData._instance.GM_INFO.mean_Time,this.overTime,this.startTime);
|
||||
// console.log(GameData._instance.GM_INFO.mean_Time);
|
||||
var finish_time = parseInt((this.overTime - this.startTime) / 100 + "");
|
||||
this.startTime = 0;
|
||||
this.overTime = 0;
|
||||
// console.log("33333333");
|
||||
var color = "y";
|
||||
if (this.level < 4 && this.level > 1)
|
||||
color = "yr";
|
||||
|
@ -319,7 +308,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
stepTimeList: this.time_Array,
|
||||
remainder: this.countTime
|
||||
};
|
||||
this.outPut();
|
||||
this.setData();
|
||||
cc.tween(win_1)
|
||||
.delay(0.4)
|
||||
|
@ -351,9 +339,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
else {
|
||||
this.setLoss();
|
||||
}
|
||||
// this.hitAction(data)
|
||||
}
|
||||
};
|
||||
//执行失败
|
||||
GameManager.prototype.setLoss = function () {
|
||||
GameData_1.default._instance.AudioManager.playWarning();
|
||||
this.begin = false;
|
||||
|
@ -404,7 +392,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
stepTimeList: this.time_Array,
|
||||
remainder: this.countTime
|
||||
};
|
||||
this.outPut();
|
||||
this.setData();
|
||||
if (this.fuhuo == true) {
|
||||
this.fuhuo = false;
|
||||
|
@ -433,22 +420,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
.to(0.1, { opacity: 0 })
|
||||
.start();
|
||||
};
|
||||
GameManager.prototype.hitAction = function (data) {
|
||||
var _this = this;
|
||||
this.hit.active = true;
|
||||
this.hit.opacity = 0;
|
||||
this.hit.setPosition;
|
||||
this.hit.setPosition(this.ball_Array[data].x + 35, this.ball_Array[data].y + 35);
|
||||
cc.tween(this.hit)
|
||||
.to(0, { opacity: 255 })
|
||||
.to(0.2, { position: cc.v3(this.hit.x - 35, this.hit.y - 35, 0) })
|
||||
.delay(0.2)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.call(function () {
|
||||
_this.hit.active = false;
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//开始游戏
|
||||
GameManager.prototype.startGame = function () {
|
||||
if (this.over == false && this.countTime > 0) {
|
||||
|
@ -458,9 +429,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
cc.tween(this.ball)
|
||||
.to(0.5, { opacity: 255, scale: 1.3 })
|
||||
.start();
|
||||
// this.runGame()
|
||||
}
|
||||
};
|
||||
//执行太阳运行动画,以及后面移动动画
|
||||
GameManager.prototype.runGame = function () {
|
||||
var _this = this;
|
||||
var time = -650;
|
||||
|
@ -504,6 +475,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
_loop_3(i);
|
||||
}
|
||||
};
|
||||
//设置移动重叠数据
|
||||
GameManager.prototype.createMove = function () {
|
||||
var _this = this;
|
||||
if (this.over == false) {
|
||||
|
@ -573,10 +545,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// debugger;
|
||||
//设置重叠
|
||||
// this.repeat = -1;
|
||||
// this.numberRepeat = -1;
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
for (var k = 0; k < this.moveArray.length; k++) {
|
||||
if (this.moveArray[k] == 1 && (k == this.repeat || k == this.numberRepeat)) {
|
||||
|
@ -626,9 +594,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
if (info.moveNumber > 0) {
|
||||
//0 1 2 3 4 5 6 7 8 9
|
||||
//可移动区分
|
||||
var pos = cc.v2(0, 0);
|
||||
// this.repeat = -1;
|
||||
// this.numberRepeat = -1;
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
for (var k = 0; k < this.moveArray.length; k++) {
|
||||
if (this.moveArray[k] == 1 && (k == this.repeat || k == this.numberRepeat)) {
|
||||
|
@ -651,7 +616,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
var _loop_5 = function (i) {
|
||||
if (moveArray[i] == 1) {
|
||||
if (i != lastNumber) { //如果不是最后一个移动的
|
||||
var time = speed * this_4.calculateDistance3(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y);
|
||||
var time = speed * this_4.calculateDistance(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y, 3);
|
||||
this_4.ball_Array[i].getComponent("Sun").move = true;
|
||||
cc.tween(this_4.ball_Array[i])
|
||||
.to(time, { position: this_4.Pos_Array[i] })
|
||||
|
@ -662,7 +627,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
//如果是最后一个
|
||||
else {
|
||||
var time = speed * this_4.calculateDistance3(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y);
|
||||
var time = speed * this_4.calculateDistance(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y, 3);
|
||||
this_4.ball_Array[i].getComponent("Sun").move = true;
|
||||
cc.tween(this_4.ball_Array[i])
|
||||
.to(time, { position: this_4.Pos_Array[i] })
|
||||
|
@ -679,6 +644,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
};
|
||||
//每次重新开始新一轮儿游戏
|
||||
GameManager.prototype.beginGame = function () {
|
||||
this.begin = true;
|
||||
this.startTime = this.getTime();
|
||||
|
@ -686,19 +652,20 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.pause = false;
|
||||
// this.node.getChildByName("showBtn").active = true;
|
||||
};
|
||||
GameManager.prototype.getRandomArray = function (lastNumber) {
|
||||
var num = parseInt(Math.random() * 8 - 4 + "");
|
||||
var 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;
|
||||
};
|
||||
//暂时作废
|
||||
// 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 () {
|
||||
var _this = this;
|
||||
|
@ -720,8 +687,8 @@ var GameManager = /** @class */ (function (_super) {
|
|||
for (var l = 0; l < levelData.number; l++) {
|
||||
_loop_6(l);
|
||||
}
|
||||
// 0 0 0 0 0 0 0 0 0 0 0
|
||||
};
|
||||
//创建太阳位置,颜色信息等数据
|
||||
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 levelData = GameData_1.default._instance.LEVEL_INFO[this.level - 1];
|
||||
|
@ -738,9 +705,10 @@ var GameManager = /** @class */ (function (_super) {
|
|||
if (levelData.number == 4)
|
||||
colorArray = [0, 0, 0, 0];
|
||||
this.color_Array = colorArray;
|
||||
//存储太阳数据
|
||||
for (var i = 0; i < levelData.number; i++) {
|
||||
var timeCount = this.timeCount + (0.6 - this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y));
|
||||
var time = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y) + timeCount;
|
||||
var timeCount = this.timeCount + (0.6 - this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y, 1));
|
||||
var time = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y, 1) + timeCount;
|
||||
data = { x: this.Pos_Array[i].x, y: this.Pos_Array[i].y, time: time, timeCount: timeCount, color: colorArray[i], speed: levelData.moveSpeed, repeat: false };
|
||||
if (this.repeat == i) {
|
||||
data.repeat = true;
|
||||
|
@ -752,6 +720,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
this.runGame();
|
||||
};
|
||||
//获取,N个太阳位置的方法,和POS2分开两个方法,防止递归溢出
|
||||
GameManager.prototype.getPos = function (type, num) {
|
||||
var posX = Math.random() * 620 - 310;
|
||||
var posY = Math.random() * (this.fitTop - this.fitBot) + this.fitBot;
|
||||
|
@ -774,6 +743,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return point;
|
||||
};
|
||||
//获取,N个太阳可移动位置的方法,和POS分开算防止递归溢出
|
||||
GameManager.prototype.getPos2 = function (type, num) {
|
||||
var posX = Math.random() * 620 - 310;
|
||||
var posY = Math.random() * (this.fitTop - this.fitBot) + this.fitBot;
|
||||
|
@ -796,6 +766,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return point;
|
||||
};
|
||||
//获取两点之间距离,返回判断是否在一定范围内 将来提出到工具类
|
||||
GameManager.prototype.getDistance = function (x1, y1, x2, y2, num) {
|
||||
var jg = false;
|
||||
var dx = x2 - x1;
|
||||
|
@ -819,6 +790,92 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return jg;
|
||||
};
|
||||
//命中动画
|
||||
GameManager.prototype.hitAction = function (data) {
|
||||
var _this = this;
|
||||
this.hit.active = true;
|
||||
this.hit.opacity = 0;
|
||||
this.hit.setPosition;
|
||||
this.hit.setPosition(this.ball_Array[data].x + 35, this.ball_Array[data].y + 35);
|
||||
cc.tween(this.hit)
|
||||
.to(0, { opacity: 255 })
|
||||
.to(0.2, { position: cc.v3(this.hit.x - 35, this.hit.y - 35, 0) })
|
||||
.delay(0.2)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.call(function () {
|
||||
_this.hit.active = false;
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//创造太阳
|
||||
GameManager.prototype.createBall = function (number, color, speed, repeat) {
|
||||
var ball = null;
|
||||
if (color == 0)
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
else if (color == 1)
|
||||
ball = cc.instantiate(this.qiu2);
|
||||
else if (color == 2)
|
||||
ball = cc.instantiate(this.qiu3);
|
||||
ball.parent = this.node.getChildByName("Sun");
|
||||
ball.zIndex = this.now_Array.length - number;
|
||||
ball.setPosition(this.ball.x, this.ball.y);
|
||||
ball.getComponent("Sun").init(number, color, speed, repeat);
|
||||
this.ball_Array.push(ball);
|
||||
};
|
||||
//销毁连线
|
||||
GameManager.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
//创建连线
|
||||
GameManager.prototype.createLine = function (start, end, time) {
|
||||
var line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
line.setPosition(start.x, start.y);
|
||||
var dx = end.x - start.x;
|
||||
var dy = end.y - start.y;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
line.height = distance;
|
||||
line.getComponent(cc.Sprite).fillRange = 0;
|
||||
line.angle = -this.calculateAngle(start.x, start.y, end.x, end.y);
|
||||
cc.tween(line.getComponent(cc.Sprite))
|
||||
.to(time, { fillRange: 1 })
|
||||
.start();
|
||||
};
|
||||
//获取两点之间的角度,将来都可放工具类
|
||||
GameManager.prototype.calculateAngle = function (x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90;
|
||||
return -angle;
|
||||
};
|
||||
//获取两点之间的距离 返回对应时间
|
||||
GameManager.prototype.calculateDistance = function (x1, y1, x2, y2, num) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var time = 0;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (num == 1) {
|
||||
if (distance > 800)
|
||||
distance = 800;
|
||||
time = distance / 800 * 0.6;
|
||||
}
|
||||
else if (num == 2) {
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
time = distance / 1200 * 1;
|
||||
}
|
||||
else if (num == 3) {
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
time = distance / 1200 * 1.5;
|
||||
}
|
||||
return time;
|
||||
};
|
||||
//获取两点之间距离 返回距离判断
|
||||
GameManager.prototype.getDistance2 = function (x1, y1, x2, y2, num) {
|
||||
var jg = false;
|
||||
var dx = x2 - x1;
|
||||
|
@ -837,81 +894,12 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return jg;
|
||||
};
|
||||
GameManager.prototype.createBall = function (number, color, speed, repeat) {
|
||||
var ball = null;
|
||||
if (color == 0)
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
else if (color == 1)
|
||||
ball = cc.instantiate(this.qiu2);
|
||||
else if (color == 2)
|
||||
ball = cc.instantiate(this.qiu3);
|
||||
ball.parent = this.node.getChildByName("Sun");
|
||||
ball.zIndex = this.now_Array.length - number;
|
||||
ball.setPosition(this.ball.x, this.ball.y);
|
||||
ball.getComponent("Sun").init(number, color, speed, repeat);
|
||||
this.ball_Array.push(ball);
|
||||
};
|
||||
GameManager.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
GameManager.prototype.createLine = function (start, end, time) {
|
||||
var line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
line.setPosition(start.x, start.y);
|
||||
var dx = end.x - start.x;
|
||||
var dy = end.y - start.y;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
line.height = distance;
|
||||
line.getComponent(cc.Sprite).fillRange = 0;
|
||||
line.angle = -this.calculateAngle(start.x, start.y, end.x, end.y);
|
||||
cc.tween(line.getComponent(cc.Sprite))
|
||||
.to(time, { fillRange: 1 })
|
||||
.start();
|
||||
};
|
||||
GameManager.prototype.calculateAngle = function (x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90;
|
||||
return -angle;
|
||||
};
|
||||
GameManager.prototype.calculateDistance = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (distance > 800)
|
||||
distance = 800;
|
||||
var time = distance / 800 * 0.6;
|
||||
return time;
|
||||
};
|
||||
GameManager.prototype.calculateDistance2 = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
var time = distance / 1200 * 1;
|
||||
return time;
|
||||
};
|
||||
GameManager.prototype.calculateDistance3 = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
var time = distance / 1200 * 1.5;
|
||||
return time;
|
||||
};
|
||||
//背景移动
|
||||
GameManager.prototype.bgMove = function (type) {
|
||||
var _this = this;
|
||||
var random = Math.random() * 300 + 300;
|
||||
var posX = Math.random() * 600 - 300;
|
||||
var y1 = this.bg1.y - random * type;
|
||||
// let y2 = this.bg2.y - random*type;
|
||||
var time1 = 0.7 * (random / 400);
|
||||
cc.tween(this.ball)
|
||||
.to(0.3, { scale: 1.3 })
|
||||
|
@ -921,17 +909,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
.delay(0.3)
|
||||
.to(time1, { y: y1 })
|
||||
.start();
|
||||
// cc.tween(this.bg2)
|
||||
// .delay(0.3)
|
||||
// .to(time1,{y:y2})
|
||||
// .start();
|
||||
setTimeout(function () {
|
||||
// if(this.over == false && GameData._instance.GM_INFO.custom == 0){
|
||||
// this.startGame();
|
||||
// }
|
||||
if (_this.over == false) {
|
||||
if (_this.over == false)
|
||||
_this.startGame();
|
||||
}
|
||||
}, time1 * 1500);
|
||||
};
|
||||
//时间格式转换
|
||||
|
@ -974,20 +954,21 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.unschedule(this.updateCountDownTime);
|
||||
this.setLoss();
|
||||
var time = 0;
|
||||
// console.log(GameData._instance.GM_INFO.mean_Time,this.clickCount);
|
||||
if (this.clickCount > 0)
|
||||
time = parseInt(GameData_1.default._instance.GM_INFO.mean_Time / this.clickCount + "");
|
||||
GameData_1.default._instance.GM_INFO.mean_Time = parseInt(time / 100 + "");
|
||||
GameData_1.default._instance.GM_INFO.mean_Time = GameData_1.default._instance.GM_INFO.mean_Time / 10;
|
||||
// console.log( GameData._instance.GM_INFO.mean_Time,time);
|
||||
// debugger;
|
||||
if (time > 10000)
|
||||
time = (Math.random() * 10 + 5) * 100;
|
||||
this.setRank(time);
|
||||
}
|
||||
}
|
||||
};
|
||||
//上传每次操作数据
|
||||
GameManager.prototype.setData = function () {
|
||||
GameData_1.default._instance.GAME_DATA = [];
|
||||
GameData_1.default._instance.GAME_DATA.push(GameData_1.default._instance.CLICK_DATA);
|
||||
GameData_1.default._instance.CLICK_init();
|
||||
var data = GameData_1.default._instance.GAME_DATA;
|
||||
var matchId = this.getMatchId();
|
||||
console.log(matchId);
|
||||
|
@ -998,6 +979,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
console.log("上传数据:");
|
||||
serverAPI_1.default.uploadUserLogData(postData, function () { });
|
||||
};
|
||||
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
||||
GameManager.prototype.getMatchId = function () {
|
||||
var matchId = cc.sys.localStorage.getItem("matchId");
|
||||
if (matchId == "undifend" || matchId == null) {
|
||||
|
@ -1019,9 +1001,11 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return matchId;
|
||||
};
|
||||
//检测matchId 如果有缓存以前的nanana数据清除
|
||||
GameManager.prototype.containsNanana = function (str) {
|
||||
return /na/i.test(str);
|
||||
};
|
||||
//重新设置MatchId
|
||||
GameManager.prototype.setMatchId = function () {
|
||||
// 定义包含可用字符的字符集
|
||||
var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
|
@ -1042,6 +1026,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
GameData_1.default._instance.GM_INFO.matchId = data;
|
||||
return data;
|
||||
};
|
||||
//上传排行榜数据
|
||||
GameManager.prototype.setRank = function (time) {
|
||||
var postData = {
|
||||
"type": 1,
|
||||
|
@ -1049,7 +1034,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
"totalSunCount": GameData_1.default._instance.GM_INFO.total,
|
||||
"success": GameData_1.default._instance.GM_INFO.success
|
||||
};
|
||||
// console.log(postData);
|
||||
serverAPI_1.default.rankData(1, function () { }, postData);
|
||||
this.node.getChildByName("GameOver").active = true;
|
||||
this.node.getChildByName("GameOver").opacity = 0;
|
||||
|
@ -1062,12 +1046,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
})
|
||||
.start();
|
||||
};
|
||||
GameManager.prototype.outPut = function () {
|
||||
var data = GameData_1.default._instance.CLICK_DATA;
|
||||
GameData_1.default._instance.GAME_DATA = [];
|
||||
GameData_1.default._instance.GAME_DATA.push(GameData_1.default._instance.CLICK_DATA);
|
||||
GameData_1.default._instance.CLICK_init();
|
||||
};
|
||||
//作弊,测试用
|
||||
GameManager.prototype.showNumber = function () {
|
||||
if (this.show == false)
|
||||
this.show = true;
|
||||
|
@ -1079,10 +1058,8 @@ var GameManager = /** @class */ (function (_super) {
|
|||
};
|
||||
GameManager.prototype.onEnable = function () {
|
||||
Notification_1.Notification.on("clickSun", this.clickSun, this);
|
||||
// Notification.on("HammerPlay", this.HammerPlay, this);
|
||||
};
|
||||
GameManager.prototype.onDisable = function () {
|
||||
// Notification.off("rightAnswers", this.rightAnswers);
|
||||
Notification_1.Notification.off("clickSun", this.clickSun);
|
||||
};
|
||||
GameManager.prototype.update = function (dt) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,96 +0,0 @@
|
|||
"use strict";
|
||||
cc._RF.push(module, 'b48a2ukFF1FlJGSkUcHUIET', 'CtrlFluxayTexture');
|
||||
// Script/CtrlFluxayTexture.js
|
||||
|
||||
"use strict";
|
||||
|
||||
cc.Class({
|
||||
"extends": cc.Component,
|
||||
properties: {
|
||||
m_delayTime: {
|
||||
"default": 0
|
||||
},
|
||||
m_fluxayTime: {
|
||||
"default": 1
|
||||
},
|
||||
m_intervalTime: {
|
||||
"default": 1
|
||||
},
|
||||
m_scale: {
|
||||
"default": 1
|
||||
},
|
||||
m_angle: {
|
||||
"default": 0
|
||||
},
|
||||
m_reviseStartTime: {
|
||||
"default": 0
|
||||
},
|
||||
m_reviseTimeScale: {
|
||||
"default": 1
|
||||
}
|
||||
},
|
||||
ctor: function ctor() {
|
||||
this._time = 0;
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
this._time -= this.m_delayTime;
|
||||
var sprite = this.node.getComponent(cc.Sprite);
|
||||
this._material = sprite.getMaterial(0);
|
||||
|
||||
this._material.setProperty("u_scale", this.m_scale);
|
||||
|
||||
this._material.setProperty("u_angle", this.m_angle);
|
||||
|
||||
this.refreshSpriteFrameData();
|
||||
},
|
||||
update: function update(dt) {
|
||||
if (this._time > this.m_fluxayTime + this.m_intervalTime) {
|
||||
this._time = 0;
|
||||
}
|
||||
|
||||
var u_time = this._time / this.m_fluxayTime;
|
||||
|
||||
if (this._time > this.m_fluxayTime) {
|
||||
u_time = 1 + (this._time - this.m_fluxayTime) / this.m_intervalTime;
|
||||
}
|
||||
|
||||
if (this.m_reviseTimeScale != null && this.m_reviseStartTime != null) {
|
||||
u_time = u_time / this.m_reviseTimeScale;
|
||||
u_time -= this.m_reviseStartTime;
|
||||
}
|
||||
|
||||
this._material.setProperty("u_time", u_time);
|
||||
|
||||
this._time += dt;
|
||||
},
|
||||
refreshSpriteFrameData: function refreshSpriteFrameData() {
|
||||
var sprite = this.node.getComponent(cc.Sprite);
|
||||
var material = sprite.getMaterial(0);
|
||||
var frame = sprite.spriteFrame;
|
||||
|
||||
if (frame != null) {
|
||||
// xMin
|
||||
var l = frame.uv[0]; // xMax
|
||||
|
||||
var r = frame.uv[6]; // yMax
|
||||
|
||||
var b = frame.uv[3]; // yMin
|
||||
|
||||
var t = frame.uv[5]; // 纹理在合图中的四个边界 uv 坐标
|
||||
|
||||
var u_uvOffset = new cc.Vec4(l, t, r, b); // 纹理是否旋转
|
||||
|
||||
var u_uvRotated = frame.isRotated() ? 1.0 : 0.0; // 设置材质的属性
|
||||
|
||||
if (material.getProperty("u_uvOffset") !== undefined) {
|
||||
material.setProperty("u_uvOffset", u_uvOffset);
|
||||
}
|
||||
|
||||
if (material.getProperty("u_uvRotated") !== undefined) {
|
||||
material.setProperty("u_uvRotated", u_uvRotated);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cc._RF.pop();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -856,8 +856,8 @@
|
|||
},
|
||||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn2",
|
||||
"customEventData": ""
|
||||
"handler": "clickBtn",
|
||||
"customEventData": "2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
cc._RF.push(module, 'e1b90/rohdEk4SdmmEZANaD', 'Helloworld');
|
||||
// Script/Helloworld.ts
|
||||
cc._RF.push(module, 'e74a999IDFOabyymZgXQIiy', 'RankManager');
|
||||
// Script/RankManager.ts
|
||||
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
|
@ -26,33 +26,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
var GameData_1 = require("./GameData");
|
||||
var List_1 = require("./ListView/List");
|
||||
var serverAPI_1 = require("./crypto/serverAPI");
|
||||
// import { apiSign } from "./crypto/sign";
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||
var Helloworld = /** @class */ (function (_super) {
|
||||
__extends(Helloworld, _super);
|
||||
function Helloworld() {
|
||||
//排行榜
|
||||
var RankManager = /** @class */ (function (_super) {
|
||||
__extends(RankManager, _super);
|
||||
function RankManager() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.Player = null;
|
||||
_this.selfNode = null;
|
||||
_this.phone = null;
|
||||
return _this;
|
||||
}
|
||||
Helloworld.prototype.onLoad = function () {
|
||||
this.Player.getChildByName("rank").active = false;
|
||||
RankManager.prototype.onLoad = function () {
|
||||
this.init();
|
||||
};
|
||||
//初始化数据
|
||||
RankManager.prototype.init = function () {
|
||||
this.rankList = cc.find("ScrollView", this.node).getComponent(List_1.default);
|
||||
this.Player.getChildByName("rank").active = false;
|
||||
this.listData = [];
|
||||
this.selfData = null;
|
||||
this.rankNumber = 100;
|
||||
this.rankTotal = 100;
|
||||
this.selfNode.opacity = 0;
|
||||
};
|
||||
Helloworld.prototype.start = function () {
|
||||
RankManager.prototype.start = function () {
|
||||
this.Player.active = false;
|
||||
this.getRank();
|
||||
};
|
||||
Helloworld.prototype.getRankData = function (data) {
|
||||
//调用获取排行榜接口
|
||||
RankManager.prototype.getRank = function () {
|
||||
var postData = {
|
||||
"page": 1,
|
||||
"pageSize": 100
|
||||
};
|
||||
//回调进getRankData
|
||||
serverAPI_1.default.rankData(2, this.getRankData.bind(this), postData);
|
||||
};
|
||||
//实际设置排行数据
|
||||
RankManager.prototype.getRankData = function (data) {
|
||||
if (data) {
|
||||
// console.log(data);
|
||||
console.log(data);
|
||||
this.listData = data.data.list;
|
||||
this.selfData = data.data.info;
|
||||
var rankData = [];
|
||||
|
@ -76,7 +90,6 @@ var Helloworld = /** @class */ (function (_super) {
|
|||
this.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = this.selfData.nickName;
|
||||
this.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = this.selfData.totalSunCount;
|
||||
this.setPic(this.selfData.pic);
|
||||
this.setPic2(this.selfData.pic);
|
||||
if (this.selfNode.getChildByName("rankLab").getComponent(cc.Label).string == "1") {
|
||||
this.selfNode.getChildByName("rank").getChildByName("one").active = true;
|
||||
}
|
||||
|
@ -94,10 +107,12 @@ var Helloworld = /** @class */ (function (_super) {
|
|||
this.selfNode.opacity = 0;
|
||||
}
|
||||
};
|
||||
Helloworld.prototype.backClick = function () {
|
||||
//返回按钮
|
||||
RankManager.prototype.backClick = function () {
|
||||
cc.director.loadScene("LoadScene");
|
||||
};
|
||||
Helloworld.prototype.playerAction = function () {
|
||||
//最上方用户动画
|
||||
RankManager.prototype.playerAction = function () {
|
||||
var _this = this;
|
||||
//-254 377 210 453
|
||||
this.Player.getChildByName("rank").active = false;
|
||||
|
@ -120,8 +135,6 @@ var Helloworld = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
setTimeout(function () {
|
||||
if (_this.tween)
|
||||
_this.tween.stop();
|
||||
|
@ -130,54 +143,22 @@ var Helloworld = /** @class */ (function (_super) {
|
|||
.getComponent(cc.Label).string = parseInt(time * 100 + "") + "%";
|
||||
}, time * 2000);
|
||||
};
|
||||
Helloworld.prototype.getRank = function () {
|
||||
var postData = {
|
||||
"page": 1,
|
||||
"pageSize": 100
|
||||
};
|
||||
serverAPI_1.default.rankData(2, this.getRankData.bind(this), postData);
|
||||
};
|
||||
Helloworld.prototype.setPic = function (pic) {
|
||||
//设置头像
|
||||
RankManager.prototype.setPic = function (pic) {
|
||||
var _this = this;
|
||||
this.phone.node.parent.getChildByName("icon").active = false;
|
||||
this.phone.node.active = false;
|
||||
var url = pic;
|
||||
fetch(url)
|
||||
this.Player.active = true;
|
||||
this.Player.opacity = 0;
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
this.Player.getChildByName("mask").getChildByName("phone").active = false;
|
||||
fetch(pic)
|
||||
.then(function (response) {
|
||||
return response.headers.get('Content-Length');
|
||||
})
|
||||
.then(function (errNo) {
|
||||
if (errNo == "5093") {
|
||||
_this.phone.node.parent.getChildByName("icon").active = true;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error('Error fetching X-Info:', error);
|
||||
});
|
||||
var self = this;
|
||||
cc.assetManager.loadRemote(url, { ext: '.jpg' }, function (err, texture) {
|
||||
if (texture) {
|
||||
_this.phone.node.active = true;
|
||||
self.phone.spriteFrame = new cc.SpriteFrame(texture);
|
||||
}
|
||||
else {
|
||||
console.log(err, texture);
|
||||
}
|
||||
});
|
||||
};
|
||||
Helloworld.prototype.setPic2 = function (pic) {
|
||||
var _this = this;
|
||||
this.Player.active = true;
|
||||
this.Player.opacity = 0;
|
||||
this.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
this.Player.getChildByName("mask").getChildByName("phone").active = false;
|
||||
var url = pic;
|
||||
fetch(url)
|
||||
.then(function (response) {
|
||||
return response.headers.get('Content-Length');
|
||||
})
|
||||
.then(function (errNo) {
|
||||
if (errNo == "5093") {
|
||||
_this.Player.getChildByName("mask").getChildByName("icon").active = true;
|
||||
}
|
||||
})
|
||||
|
@ -185,43 +166,41 @@ var Helloworld = /** @class */ (function (_super) {
|
|||
console.error('Error fetching X-Info:', error);
|
||||
});
|
||||
var self = this;
|
||||
cc.assetManager.loadRemote(url, { ext: '.jpg' }, function (err, texture) {
|
||||
cc.assetManager.loadRemote(pic, { ext: '.jpg' }, function (err, texture) {
|
||||
self.Player.opacity = 255;
|
||||
if (texture) {
|
||||
_this.Player.opacity = 255;
|
||||
_this.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
_this.Player.getChildByName("mask").getChildByName("phone").active = true;
|
||||
_this.Player.getChildByName("mask").getChildByName("phone").getComponent(cc.Sprite)
|
||||
self.phone.node.active = true;
|
||||
self.phone.spriteFrame = new cc.SpriteFrame(texture);
|
||||
self.Player.getChildByName("mask").getChildByName("icon").active = false;
|
||||
self.Player.getChildByName("mask").getChildByName("phone").active = true;
|
||||
self.Player.getChildByName("mask").getChildByName("phone").getComponent(cc.Sprite)
|
||||
.spriteFrame = new cc.SpriteFrame(texture);
|
||||
setTimeout(function () {
|
||||
_this.playerAction();
|
||||
self.playerAction();
|
||||
}, 500);
|
||||
// console.log("设置头像成功",err);
|
||||
}
|
||||
else {
|
||||
_this.Player.opacity = 255;
|
||||
// console.log("设置头像失败",url);
|
||||
_this.Player.getChildByName("mask").getChildByName("icon").active = true;
|
||||
console.log(err, texture);
|
||||
self.Player.getChildByName("mask").getChildByName("icon").active = true;
|
||||
setTimeout(function () {
|
||||
_this.playerAction();
|
||||
self.playerAction();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
property(cc.Node)
|
||||
], Helloworld.prototype, "Player", void 0);
|
||||
property(cc.Node) //用户上方头像
|
||||
], RankManager.prototype, "Player", void 0);
|
||||
__decorate([
|
||||
property(cc.Node)
|
||||
], Helloworld.prototype, "selfNode", void 0);
|
||||
property(cc.Node) //用户最下方个人信息
|
||||
], RankManager.prototype, "selfNode", void 0);
|
||||
__decorate([
|
||||
property(cc.Sprite)
|
||||
], Helloworld.prototype, "phone", void 0);
|
||||
Helloworld = __decorate([
|
||||
property(cc.Sprite) //用户头像换图
|
||||
], RankManager.prototype, "phone", void 0);
|
||||
RankManager = __decorate([
|
||||
ccclass
|
||||
], Helloworld);
|
||||
return Helloworld;
|
||||
], RankManager);
|
||||
return RankManager;
|
||||
}(cc.Component));
|
||||
exports.default = Helloworld;
|
||||
exports.default = RankManager;
|
||||
|
||||
cc._RF.pop();
|
File diff suppressed because one or more lines are too long
|
@ -3,12 +3,6 @@ cc._RF.push(module, 'f2f0bI5PsVI+o18xF6G+KVa', 'GameData');
|
|||
// Script/GameData.ts
|
||||
|
||||
"use strict";
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
|
@ -33,21 +27,15 @@ var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
|||
var GameData = /** @class */ (function (_super) {
|
||||
__extends(GameData, _super);
|
||||
function GameData() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.label = null;
|
||||
_this.text = 'hello';
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
GameData_1 = GameData;
|
||||
// LEVEL_INFO: { number: number; }[];
|
||||
// LEVEL_INFO:[];
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
GameData.prototype.onLoad = function () {
|
||||
if (GameData_1._instance == null) {
|
||||
GameData_1._instance = this;
|
||||
cc.game.addPersistRootNode(this.node);
|
||||
this.AudioManager = this.node.getComponent('BallAudioManager');
|
||||
//设置为常驻,绑定音频以及游戏各类信息
|
||||
this.AudioManager = this.node.getComponent('AudioManager');
|
||||
}
|
||||
else {
|
||||
this.node.destroy();
|
||||
|
@ -55,6 +43,13 @@ var GameData = /** @class */ (function (_super) {
|
|||
}
|
||||
};
|
||||
GameData.prototype.start = function () {
|
||||
this.GM_INFO_init();
|
||||
this.CLICK_init();
|
||||
this.LEVEL_INFO_init();
|
||||
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
||||
this.GAME_DATA = [];
|
||||
};
|
||||
GameData.prototype.GM_INFO_init = function () {
|
||||
this.GM_INFO = {
|
||||
// isEnd: false,
|
||||
mean_Time: 0,
|
||||
|
@ -68,6 +63,26 @@ var GameData = /** @class */ (function (_super) {
|
|||
matchId: null,
|
||||
custom: 0
|
||||
};
|
||||
};
|
||||
GameData.prototype.CLICK_init = function () {
|
||||
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
|
||||
};
|
||||
};
|
||||
GameData.prototype.LEVEL_INFO_init = function () {
|
||||
this.LEVEL_INFO = [
|
||||
{
|
||||
number: 3,
|
||||
|
@ -268,251 +283,10 @@ var GameData = /** @class */ (function (_super) {
|
|||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 5,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 5,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
moveNumber: 5,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 10,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
}
|
||||
];
|
||||
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
|
||||
};
|
||||
this.GAME_DATA = [];
|
||||
};
|
||||
GameData.prototype.CLICK_init = function () {
|
||||
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
|
||||
};
|
||||
};
|
||||
var GameData_1;
|
||||
__decorate([
|
||||
property(cc.Label)
|
||||
], GameData.prototype, "label", void 0);
|
||||
__decorate([
|
||||
property
|
||||
], GameData.prototype, "text", void 0);
|
||||
GameData = GameData_1 = __decorate([
|
||||
ccclass
|
||||
], GameData);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,29 +0,0 @@
|
|||
"use strict";
|
||||
cc._RF.push(module, 'f7f5dfmKidObZiMLtuBdAiq', 'test');
|
||||
// Script/test.ts
|
||||
|
||||
if (this.level == 1) {
|
||||
var data = { x: -200, y: -380, time: 0, timeCount: 0 };
|
||||
var timeCount = this.timeCount + (0.8 - this.calculateDistance(this.ball.x, this.ball.y, -200, -380));
|
||||
var time = this.calculateDistance(this.ball.x, this.ball.y, -200, -380) + timeCount;
|
||||
data = { x: -200, y: -380, time: time, timeCount: timeCount };
|
||||
this.now_Array.push(data);
|
||||
timeCount = this.timeCount + (0.8 - this.calculateDistance(this.ball.x, this.ball.y, -250, -300));
|
||||
time = this.calculateDistance(this.now_Array[this.now_Array.length - 1].x, this.now_Array[this.now_Array.length - 1].y, -250, -300) + timeCount;
|
||||
data = { x: -250, y: -300, time: time, timeCount: timeCount };
|
||||
this.now_Array.push(data);
|
||||
timeCount = this.timeCount + (0.8 - this.calculateDistance(this.ball.x, this.ball.y, -300, 500));
|
||||
time = this.calculateDistance(this.now_Array[this.now_Array.length - 1].x, this.now_Array[this.now_Array.length - 1].y, -300, 500) + timeCount;
|
||||
data = { x: -300, y: 500, time: time, timeCount: timeCount };
|
||||
this.now_Array.push(data);
|
||||
timeCount = this.timeCount + (0.8 - this.calculateDistance(this.ball.x, this.ball.y, 208, 280));
|
||||
time = this.calculateDistance(this.now_Array[this.now_Array.length - 1].x, this.now_Array[this.now_Array.length - 1].y, 208, 280) + timeCount;
|
||||
data = { x: 208, y: 280, time: time, timeCount: timeCount };
|
||||
this.now_Array.push(data);
|
||||
timeCount = this.timeCount + (0.8 - this.calculateDistance(this.ball.x, this.ball.y, 208, -280));
|
||||
time = this.calculateDistance(this.now_Array[this.now_Array.length - 1].x, this.now_Array[this.now_Array.length - 1].y, 208, -280) + timeCount;
|
||||
data = { x: 208, y: -280, time: time, timeCount: timeCount };
|
||||
this.now_Array.push(data);
|
||||
}
|
||||
|
||||
cc._RF.pop();
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["assets\\Script\\test.ts"],"names":[],"mappings":";;;;AAAA,IAAG,IAAI,CAAC,KAAK,IAAI,CAAC,EAAC;IACf,IAAI,IAAI,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,IAAI,EAAC,CAAC,EAAC,SAAS,EAAC,CAAC,EAAC,CAAC;IAC9C,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjG,IAAI,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,GAAG,CAAC,GAAC,SAAS,CAAC;IAC/E,IAAI,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,CAAC;IACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1B,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7F,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,GAAG,CAAC,GAAC,SAAS,CAAC;IACnE,IAAI,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,CAAC;IACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1B,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,CAAC,GAAG,EAAC,GAAG,CAAC,CAAC,CAAC;IAC5F,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,GAAG,EAAC,GAAG,CAAC,GAAC,SAAS,CAAC;IAClE,IAAI,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,CAAC;IACpD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1B,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,GAAG,EAAC,GAAG,CAAC,CAAC,CAAC;IAC3F,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EAAC,GAAG,EAAC,GAAG,CAAC,GAAC,SAAS,CAAC;IACjE,IAAI,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,CAAC;IACnD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1B,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAC,GAAG,EAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5F,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EACnE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC,EAAC,GAAG,EAAC,CAAC,GAAG,CAAC,GAAC,SAAS,CAAC;IAClE,IAAI,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,CAAC;IACpD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAC7B","file":"","sourceRoot":"/","sourcesContent":["if(this.level == 1){\r\n let data = {x:-200,y:-380,time:0,timeCount:0};\r\n let timeCount = this.timeCount + (0.8-this.calculateDistance(this.ball.x,this.ball.y,-200,-380));\r\n let time = this.calculateDistance(this.ball.x,this.ball.y,-200,-380)+timeCount;\r\n data = {x:-200,y:-380,time:time,timeCount:timeCount};\r\n this.now_Array.push(data);\r\n\r\n timeCount = this.timeCount + (0.8-this.calculateDistance(this.ball.x,this.ball.y,-250,-300));\r\n time = this.calculateDistance(this.now_Array[this.now_Array.length-1].x,\r\n this.now_Array[this.now_Array.length-1].y,-250,-300)+timeCount;\r\n data = {x:-250,y:-300,time:time,timeCount:timeCount};\r\n this.now_Array.push(data);\r\n\r\n timeCount = this.timeCount + (0.8-this.calculateDistance(this.ball.x,this.ball.y,-300,500));\r\n time = this.calculateDistance(this.now_Array[this.now_Array.length-1].x,\r\n this.now_Array[this.now_Array.length-1].y,-300,500)+timeCount;\r\n data = {x:-300,y:500,time:time,timeCount:timeCount};\r\n this.now_Array.push(data);\r\n\r\n timeCount = this.timeCount + (0.8-this.calculateDistance(this.ball.x,this.ball.y,208,280));\r\n time = this.calculateDistance(this.now_Array[this.now_Array.length-1].x,\r\n this.now_Array[this.now_Array.length-1].y,208,280)+timeCount;\r\n data = {x:208,y:280,time:time,timeCount:timeCount};\r\n this.now_Array.push(data);\r\n\r\n timeCount = this.timeCount + (0.8-this.calculateDistance(this.ball.x,this.ball.y,208,-280));\r\n time = this.calculateDistance(this.now_Array[this.now_Array.length-1].x,\r\n this.now_Array[this.now_Array.length-1].y,208,-280)+timeCount;\r\n data = {x:208,y:-280,time:time,timeCount:timeCount};\r\n this.now_Array.push(data);\r\n}"]}
|
|
@ -10,8 +10,8 @@
|
|||
"relativePath": "Scene"
|
||||
},
|
||||
"4734c20c-0db8-4eb2-92ea-e692f4d70934": {
|
||||
"asset": 1716867446329,
|
||||
"meta": 1716868891162,
|
||||
"asset": 1717063292222,
|
||||
"meta": 1717124730916,
|
||||
"relativePath": "Script"
|
||||
},
|
||||
"7b81d4e8-ec84-4716-968d-500ac1d78a54": {
|
||||
|
@ -29,14 +29,9 @@
|
|||
"meta": 1716868891166,
|
||||
"relativePath": "Script\\ListView"
|
||||
},
|
||||
"5aca560f-66b4-413d-95bd-73669c0bca6b": {
|
||||
"asset": 1715324805802,
|
||||
"meta": 1715325875063,
|
||||
"relativePath": "Script\\RankListItem.prefab"
|
||||
},
|
||||
"2d2f792f-a40c-49bb-a189-ed176a246e49": {
|
||||
"asset": 1717067787704,
|
||||
"meta": 1717067787709,
|
||||
"meta": 1717125013258,
|
||||
"relativePath": "Scene\\RankScene.fire"
|
||||
},
|
||||
"a8027877-d8d6-4645-97a0-52d4a0123dba": {
|
||||
|
@ -80,23 +75,23 @@
|
|||
"relativePath": "prefab\\line.prefab"
|
||||
},
|
||||
"3a232388-d8dc-4f79-a1ea-82f6385b7ce2": {
|
||||
"asset": 1716891674004,
|
||||
"meta": 1716891674007,
|
||||
"asset": 1717128436645,
|
||||
"meta": 1717128436653,
|
||||
"relativePath": "prefab\\qiu1.prefab"
|
||||
},
|
||||
"5e515837-650e-4584-a089-e2a025e36c39": {
|
||||
"asset": 1716549473930,
|
||||
"meta": 1716549473937,
|
||||
"asset": 1717128441079,
|
||||
"meta": 1717128441084,
|
||||
"relativePath": "prefab\\qiu2.prefab"
|
||||
},
|
||||
"13110e4f-3587-4e6b-8811-0ca16cac8149": {
|
||||
"asset": 1716549486295,
|
||||
"meta": 1716549486301,
|
||||
"asset": 1717128444872,
|
||||
"meta": 1717128444877,
|
||||
"relativePath": "prefab\\qiu3.prefab"
|
||||
},
|
||||
"d1323772-4ab2-4527-bd20-501fe4fb9723": {
|
||||
"asset": 1716549499840,
|
||||
"meta": 1716549499845,
|
||||
"asset": 1717128451209,
|
||||
"meta": 1717128451214,
|
||||
"relativePath": "prefab\\qiu4.prefab"
|
||||
},
|
||||
"32254f37-ac95-4912-a787-b8e0429ba0f1": {
|
||||
|
@ -104,19 +99,14 @@
|
|||
"meta": 1715325498665,
|
||||
"relativePath": "prefab\\RankListItem.prefab"
|
||||
},
|
||||
"b48a2ba4-145d-4594-9192-914707508113": {
|
||||
"asset": 1644307132000,
|
||||
"meta": 1715325498792,
|
||||
"relativePath": "Script\\CtrlFluxayTexture.js"
|
||||
},
|
||||
"4b9c5a7e-c645-48a4-9aca-5df381ce4ef5": {
|
||||
"asset": 1716862065811,
|
||||
"meta": 1716862065817,
|
||||
"asset": 1717134890847,
|
||||
"meta": 1717134890854,
|
||||
"relativePath": "Scene\\OverScene.fire"
|
||||
},
|
||||
"774829bb-123e-48b6-930e-6b3e02491506": {
|
||||
"asset": 1716778615382,
|
||||
"meta": 1716778615387,
|
||||
"asset": 1717126108332,
|
||||
"meta": 1717126108338,
|
||||
"relativePath": "Scene\\GuideScene.fire"
|
||||
},
|
||||
"f2518fb4-2074-4639-8fae-788846b44780": {
|
||||
|
@ -124,11 +114,6 @@
|
|||
"meta": 1715325499067,
|
||||
"relativePath": "Script\\Notification.ts"
|
||||
},
|
||||
"f7f5d7e6-2a27-4e6d-988c-2edb817408aa": {
|
||||
"asset": 1714377434000,
|
||||
"meta": 1715325499104,
|
||||
"relativePath": "Script\\test.ts"
|
||||
},
|
||||
"4bff6e01-b411-48f4-867a-5d841f9e400f": {
|
||||
"asset": 1716867446333,
|
||||
"meta": 1716868891166,
|
||||
|
@ -256,502 +241,502 @@
|
|||
},
|
||||
"9836134e-b892-4283-b6b2-78b5acf3ed45": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584341,
|
||||
"meta": 1717124728023,
|
||||
"relativePath": "effects"
|
||||
},
|
||||
"f6e6dd15-71d1-4ffe-ace7-24fd39942c05": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062584347,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "obsolete"
|
||||
},
|
||||
"f743d2b6-b7ea-4c14-a55b-547ed4d0a045": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062584347,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "particle"
|
||||
},
|
||||
"ae6c6c98-11e4-452f-8758-75f5c6a56e83": {
|
||||
"asset": 1714966328831,
|
||||
"meta": 1717062584347,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "prefab"
|
||||
},
|
||||
"897ef7a1-4860-4f64-968d-f5924b18668a": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062584663,
|
||||
"meta": 1717124728371,
|
||||
"relativePath": "prefab\\2d-camera.prefab"
|
||||
},
|
||||
"70d7cdb0-04cd-41bb-9480-c06a4785f386": {
|
||||
"asset": 1714966328768,
|
||||
"meta": 1717062584665,
|
||||
"meta": 1717124728372,
|
||||
"relativePath": "prefab\\3d-camera.prefab"
|
||||
},
|
||||
"a3ee0214-b432-4865-9666-4a3211814282": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584666,
|
||||
"meta": 1717124728374,
|
||||
"relativePath": "prefab\\light"
|
||||
},
|
||||
"972b9a4d-47ee-4c74-b5c3-61d8a69bc29f": {
|
||||
"asset": 1714966328768,
|
||||
"meta": 1717062584671,
|
||||
"meta": 1717124728384,
|
||||
"relativePath": "prefab\\button.prefab"
|
||||
},
|
||||
"ed88f13d-fcad-4848-aa35-65a2cb973584": {
|
||||
"asset": 1714966328768,
|
||||
"meta": 1717062584669,
|
||||
"meta": 1717124728375,
|
||||
"relativePath": "prefab\\3d-stage.prefab"
|
||||
},
|
||||
"70bbeb73-6dc2-4ee4-8faf-76b3a0e34ec4": {
|
||||
"asset": 1714966328768,
|
||||
"meta": 1717062584667,
|
||||
"meta": 1717124728377,
|
||||
"relativePath": "prefab\\3d-particle.prefab"
|
||||
},
|
||||
"2c937608-2562-40ea-b264-7395df6f0cea": {
|
||||
"asset": 1714966328768,
|
||||
"meta": 1717062584672,
|
||||
"meta": 1717124728380,
|
||||
"relativePath": "prefab\\canvas.prefab"
|
||||
},
|
||||
"61aeb05b-3b32-452b-8eed-2b76deeed554": {
|
||||
"asset": 1714966328783,
|
||||
"meta": 1717062584673,
|
||||
"meta": 1717124728382,
|
||||
"relativePath": "prefab\\editbox.prefab"
|
||||
},
|
||||
"27756ebb-3d33-44b0-9b96-e858fadd4dd4": {
|
||||
"asset": 1714966328783,
|
||||
"meta": 1717062584677,
|
||||
"meta": 1717124728390,
|
||||
"relativePath": "prefab\\label.prefab"
|
||||
},
|
||||
"785a442c-3ceb-45be-a46e-7317f625f3b9": {
|
||||
"asset": 1714966328783,
|
||||
"meta": 1717062584679,
|
||||
"meta": 1717124728392,
|
||||
"relativePath": "prefab\\layout.prefab"
|
||||
},
|
||||
"cd33edea-55f5-46c2-958d-357a01384a36": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584684,
|
||||
"meta": 1717124728394,
|
||||
"relativePath": "prefab\\particlesystem.prefab"
|
||||
},
|
||||
"5965ffac-69da-4b55-bcde-9225d0613c28": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584687,
|
||||
"meta": 1717124728397,
|
||||
"relativePath": "prefab\\progressBar.prefab"
|
||||
},
|
||||
"ca8401fe-ad6e-41a8-bd46-8e3e4e9945be": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584681,
|
||||
"meta": 1717124728395,
|
||||
"relativePath": "prefab\\pageview.prefab"
|
||||
},
|
||||
"4a37dd57-78cd-4cec-aad4-f11a73d12b63": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584685,
|
||||
"meta": 1717124728402,
|
||||
"relativePath": "prefab\\richtext.prefab"
|
||||
},
|
||||
"0004d1cf-a0ad-47d8-ab17-34d3db9d35a3": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584690,
|
||||
"meta": 1717124728406,
|
||||
"relativePath": "prefab\\slider.prefab"
|
||||
},
|
||||
"32044bd2-481f-4cf1-a656-e2b2fb1594eb": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584688,
|
||||
"meta": 1717124728401,
|
||||
"relativePath": "prefab\\scrollview.prefab"
|
||||
},
|
||||
"96083d03-c332-4a3f-9386-d03e2d19e8ee": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584698,
|
||||
"meta": 1717124728423,
|
||||
"relativePath": "prefab\\sprite.prefab"
|
||||
},
|
||||
"d8afc78c-4eac-4a9f-83dd-67bc70344d33": {
|
||||
"asset": 1714966328862,
|
||||
"meta": 1717062584348,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "resources"
|
||||
},
|
||||
"294c1663-4adf-4a1e-a795-53808011a38a": {
|
||||
"asset": 1714966328862,
|
||||
"meta": 1717062584711,
|
||||
"meta": 1717124728424,
|
||||
"relativePath": "resources\\effects"
|
||||
},
|
||||
"bbee2217-c261-49bd-a8ce-708d6bcc3500": {
|
||||
"asset": 1714966328893,
|
||||
"meta": 1717062584714,
|
||||
"meta": 1717124728426,
|
||||
"relativePath": "resources\\materials"
|
||||
},
|
||||
"7de03a80-4457-438d-95a7-3e7cdffd6086": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584718,
|
||||
"meta": 1717124728433,
|
||||
"relativePath": "prefab\\tiledmap.prefab"
|
||||
},
|
||||
"30682f87-9f0d-4f17-8a44-72863791461b": {
|
||||
"asset": 1714966328831,
|
||||
"meta": 1717062584736,
|
||||
"meta": 1717124728455,
|
||||
"relativePath": "resources\\effects\\builtin-2d-graphics.effect"
|
||||
},
|
||||
"1f55e3be-b89b-4b79-88de-47fd31018044": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584715,
|
||||
"meta": 1717124728430,
|
||||
"relativePath": "prefab\\sprite_splash.prefab"
|
||||
},
|
||||
"144c3297-af63-49e8-b8ef-1cfa29b3be28": {
|
||||
"asset": 1714966328831,
|
||||
"meta": 1717062584743,
|
||||
"meta": 1717124728464,
|
||||
"relativePath": "resources\\effects\\builtin-2d-gray-sprite.effect"
|
||||
},
|
||||
"0d784963-d024-4ea6-a7db-03be0ad63010": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584721,
|
||||
"meta": 1717124728439,
|
||||
"relativePath": "prefab\\toggle.prefab"
|
||||
},
|
||||
"f18742d7-56d2-4eb5-ae49-2d9d710b37c8": {
|
||||
"asset": 1714966328831,
|
||||
"meta": 1717062584755,
|
||||
"meta": 1717124728472,
|
||||
"relativePath": "resources\\effects\\builtin-2d-label.effect"
|
||||
},
|
||||
"0e42ba95-1fa1-46aa-b2cf-143cd1bcee2c": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584719,
|
||||
"meta": 1717124728434,
|
||||
"relativePath": "prefab\\tiledtile.prefab"
|
||||
},
|
||||
"0e93aeaa-0b53-4e40-b8e0-6268b4e07bd7": {
|
||||
"asset": 1714966328831,
|
||||
"meta": 1717062584763,
|
||||
"meta": 1717124728479,
|
||||
"relativePath": "resources\\effects\\builtin-2d-spine.effect"
|
||||
},
|
||||
"2874f8dd-416c-4440-81b7-555975426e93": {
|
||||
"asset": 1714966328846,
|
||||
"meta": 1717062584769,
|
||||
"meta": 1717124728487,
|
||||
"relativePath": "resources\\effects\\builtin-2d-sprite.effect"
|
||||
},
|
||||
"829a282c-b049-4019-bd38-5ace8d8a6417": {
|
||||
"asset": 1714966328846,
|
||||
"meta": 1717062584815,
|
||||
"meta": 1717124728531,
|
||||
"relativePath": "resources\\effects\\builtin-3d-particle.effect"
|
||||
},
|
||||
"2a7c0036-e0b3-4fe1-8998-89a54b8a2bec": {
|
||||
"asset": 1714966328846,
|
||||
"meta": 1717062584829,
|
||||
"meta": 1717124728548,
|
||||
"relativePath": "resources\\effects\\builtin-3d-trail.effect"
|
||||
},
|
||||
"c0040c95-c57f-49cd-9cbc-12316b73d0d4": {
|
||||
"asset": 1714966328846,
|
||||
"meta": 1717062584943,
|
||||
"meta": 1717124728553,
|
||||
"relativePath": "resources\\effects\\builtin-clear-stencil.effect"
|
||||
},
|
||||
"6d91e591-4ce0-465c-809f-610ec95019c6": {
|
||||
"asset": 1714966328862,
|
||||
"meta": 1717062584956,
|
||||
"meta": 1717124728566,
|
||||
"relativePath": "resources\\effects\\builtin-unlit.effect"
|
||||
},
|
||||
"bf0a434c-84dd-4a8e-a08a-7a36f180cc75": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584723,
|
||||
"meta": 1717124728444,
|
||||
"relativePath": "prefab\\toggleContainer.prefab"
|
||||
},
|
||||
"232d2782-c4bd-4bb4-9e01-909f03d6d3b9": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584725,
|
||||
"meta": 1717124728457,
|
||||
"relativePath": "prefab\\videoplayer.prefab"
|
||||
},
|
||||
"d1b8be49-b0a0-435c-83b7-552bed4bbe35": {
|
||||
"asset": 1714966328815,
|
||||
"meta": 1717062584724,
|
||||
"meta": 1717124728446,
|
||||
"relativePath": "prefab\\toggleGroup.prefab"
|
||||
},
|
||||
"8c5001fd-07ee-4a4b-a8a0-63e15195e94d": {
|
||||
"asset": 1714966328831,
|
||||
"meta": 1717062584936,
|
||||
"meta": 1717124728535,
|
||||
"relativePath": "prefab\\webview.prefab"
|
||||
},
|
||||
"ddb99b39-7004-47cd-9705-751905c43c46": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584979,
|
||||
"meta": 1717124728585,
|
||||
"relativePath": "prefab\\light\\directional.prefab"
|
||||
},
|
||||
"0cf30284-9073-46bc-9eba-e62b69dbbff3": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584971,
|
||||
"meta": 1717124728587,
|
||||
"relativePath": "prefab\\light\\point.prefab"
|
||||
},
|
||||
"61906da3-7003-4bda-9abc-5769c76faee4": {
|
||||
"asset": 1714966328783,
|
||||
"meta": 1717062584968,
|
||||
"meta": 1717124728585,
|
||||
"relativePath": "prefab\\light\\ambient.prefab"
|
||||
},
|
||||
"f5331fd2-bf42-4ee3-a3fd-3e1657600eff": {
|
||||
"asset": 1714966328800,
|
||||
"meta": 1717062584977,
|
||||
"meta": 1717124728588,
|
||||
"relativePath": "prefab\\light\\spot.prefab"
|
||||
},
|
||||
"a153945d-2511-4c14-be7b-05d242f47d57": {
|
||||
"asset": 1714966328862,
|
||||
"meta": 1717062585062,
|
||||
"meta": 1717124728659,
|
||||
"relativePath": "resources\\materials\\builtin-2d-graphics.mtl"
|
||||
},
|
||||
"6f801092-0c37-4f30-89ef-c8d960825b36": {
|
||||
"asset": 1714966328862,
|
||||
"meta": 1717062585060,
|
||||
"meta": 1717124728657,
|
||||
"relativePath": "resources\\materials\\builtin-2d-base.mtl"
|
||||
},
|
||||
"3a7bb79f-32fd-422e-ada2-96f518fed422": {
|
||||
"asset": 1714966328862,
|
||||
"meta": 1717062585064,
|
||||
"meta": 1717124728660,
|
||||
"relativePath": "resources\\materials\\builtin-2d-gray-sprite.mtl"
|
||||
},
|
||||
"432fa09c-cf03-4cff-a186-982604408a07": {
|
||||
"asset": 1714966328878,
|
||||
"meta": 1717062585065,
|
||||
"meta": 1717124728666,
|
||||
"relativePath": "resources\\materials\\builtin-3d-particle.mtl"
|
||||
},
|
||||
"7afd064b-113f-480e-b793-8817d19f63c3": {
|
||||
"asset": 1714966328878,
|
||||
"meta": 1717062585062,
|
||||
"meta": 1717124728663,
|
||||
"relativePath": "resources\\materials\\builtin-2d-spine.mtl"
|
||||
},
|
||||
"eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432": {
|
||||
"asset": 1714966328878,
|
||||
"meta": 1717062585063,
|
||||
"meta": 1717124728662,
|
||||
"relativePath": "resources\\materials\\builtin-2d-sprite.mtl"
|
||||
},
|
||||
"cf7e0bb8-a81c-44a9-ad79-d28d43991032": {
|
||||
"asset": 1714966328878,
|
||||
"meta": 1717062585067,
|
||||
"meta": 1717124728664,
|
||||
"relativePath": "resources\\materials\\builtin-clear-stencil.mtl"
|
||||
},
|
||||
"e02d87d4-e599-4d16-8001-e14891ac6506": {
|
||||
"asset": 1714966328878,
|
||||
"meta": 1717062585061,
|
||||
"meta": 1717124728658,
|
||||
"relativePath": "resources\\materials\\builtin-2d-label.mtl"
|
||||
},
|
||||
"466d4f9b-e5f4-4ea8-85d5-3c6e9a65658a": {
|
||||
"asset": 1714966328878,
|
||||
"meta": 1717062585066,
|
||||
"meta": 1717124728665,
|
||||
"relativePath": "resources\\materials\\builtin-3d-trail.mtl"
|
||||
},
|
||||
"d0a82d39-bede-46c4-b698-c81ff0dedfff": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062584729,
|
||||
"meta": 1717124728442,
|
||||
"relativePath": "particle\\atom.png"
|
||||
},
|
||||
"2a296057-247c-4a1c-bbeb-0548b6c98650": {
|
||||
"asset": 1714966328893,
|
||||
"meta": 1717062585065,
|
||||
"meta": 1717124728666,
|
||||
"relativePath": "resources\\materials\\builtin-unlit.mtl"
|
||||
},
|
||||
"8a96b965-2dc0-4e03-aa90-3b79cb93b5b4": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062584728,
|
||||
"meta": 1717124728440,
|
||||
"relativePath": "obsolete\\atom.png"
|
||||
},
|
||||
"b8223619-7e38-47c4-841f-9160c232495a": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062585090,
|
||||
"meta": 1717124728697,
|
||||
"relativePath": "obsolete\\atom.plist"
|
||||
},
|
||||
"b2687ac4-099e-403c-a192-ff477686f4f5": {
|
||||
"asset": 1714966328752,
|
||||
"meta": 1717062585092,
|
||||
"meta": 1717124728696,
|
||||
"relativePath": "particle\\atom.plist"
|
||||
},
|
||||
"430eccbf-bf2c-4e6e-8c0c-884bbb487f32": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584516,
|
||||
"meta": 1717124728231,
|
||||
"relativePath": "effects\\__builtin-editor-gizmo-line.effect"
|
||||
},
|
||||
"6c5cf6e1-b044-4eac-9431-835644d57381": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584523,
|
||||
"meta": 1717124728238,
|
||||
"relativePath": "effects\\__builtin-editor-gizmo-unlit.effect"
|
||||
},
|
||||
"115286d1-2e10-49ee-aab4-341583f607e8": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584547,
|
||||
"meta": 1717124728269,
|
||||
"relativePath": "effects\\__builtin-editor-gizmo.effect"
|
||||
},
|
||||
"abc2cb62-7852-4525-a90d-d474487b88f2": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584454,
|
||||
"meta": 1717124728158,
|
||||
"relativePath": "effects\\builtin-phong.effect"
|
||||
},
|
||||
"e2f00085-c597-422d-9759-52c360279106": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584505,
|
||||
"meta": 1717124728215,
|
||||
"relativePath": "effects\\builtin-toon.effect"
|
||||
},
|
||||
"f8e6b000-5643-4b86-9080-aa680ce1f599": {
|
||||
"asset": 1714966328706,
|
||||
"meta": 1717062584343,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "image"
|
||||
},
|
||||
"5c3eedba-6c41-4c0c-9ba7-d91f813cbd1c": {
|
||||
"asset": 1714966328721,
|
||||
"meta": 1717062584344,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "materials"
|
||||
},
|
||||
"fc09f9bd-2cce-4605-b630-8145ef809ed6": {
|
||||
"asset": 1714966328721,
|
||||
"meta": 1717062584344,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "misc"
|
||||
},
|
||||
"99170b0b-d210-46f1-b213-7d9e3f23098a": {
|
||||
"asset": 1714966328673,
|
||||
"meta": 1717062584610,
|
||||
"meta": 1717124728318,
|
||||
"relativePath": "image\\default_progressbar_bg.png"
|
||||
},
|
||||
"cfef78f1-c8df-49b7-8ed0-4c953ace2621": {
|
||||
"asset": 1714966328673,
|
||||
"meta": 1717062584598,
|
||||
"meta": 1717124728320,
|
||||
"relativePath": "image\\default_progressbar.png"
|
||||
},
|
||||
"db019bf7-f71c-4111-98cf-918ea180cb48": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584346,
|
||||
"meta": 1717124728038,
|
||||
"relativePath": "model"
|
||||
},
|
||||
"e39e96e6-6f6e-413f-bcf1-ac7679bb648a": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584615,
|
||||
"meta": 1717124728325,
|
||||
"relativePath": "model\\prefab"
|
||||
},
|
||||
"b43ff3c2-02bb-4874-81f7-f2dea6970f18": {
|
||||
"asset": 1714966328658,
|
||||
"meta": 1717062584644,
|
||||
"meta": 1717124728308,
|
||||
"relativePath": "image\\default_btn_pressed.png"
|
||||
},
|
||||
"edd215b9-2796-4a05-aaf5-81f96c9281ce": {
|
||||
"asset": 1714966328658,
|
||||
"meta": 1717062584614,
|
||||
"meta": 1717124728310,
|
||||
"relativePath": "image\\default_editbox_bg.png"
|
||||
},
|
||||
"617323dd-11f4-4dd3-8eec-0caf6b3b45b9": {
|
||||
"asset": 1714966328689,
|
||||
"meta": 1717062584653,
|
||||
"meta": 1717124728357,
|
||||
"relativePath": "image\\default_scrollbar_vertical_bg.png"
|
||||
},
|
||||
"6e056173-d285-473c-b206-40a7fff5386e": {
|
||||
"asset": 1714966328689,
|
||||
"meta": 1717062584656,
|
||||
"meta": 1717124728354,
|
||||
"relativePath": "image\\default_sprite.png"
|
||||
},
|
||||
"4bab67cb-18e6-4099-b840-355f0473f890": {
|
||||
"asset": 1714966328689,
|
||||
"meta": 1717062584648,
|
||||
"meta": 1717124728355,
|
||||
"relativePath": "image\\default_scrollbar_bg.png"
|
||||
},
|
||||
"e851e89b-faa2-4484-bea6-5c01dd9f06e2": {
|
||||
"asset": 1714966328658,
|
||||
"meta": 1717062584612,
|
||||
"meta": 1717124728351,
|
||||
"relativePath": "image\\default_btn_normal.png"
|
||||
},
|
||||
"c4480a0a-6ac5-443f-8b40-361a14257fc8": {
|
||||
"asset": 1714966328706,
|
||||
"meta": 1717062585041,
|
||||
"meta": 1717124728634,
|
||||
"relativePath": "materials\\builtin-phong.mtl"
|
||||
},
|
||||
"a87cc147-01b2-43f8-8e42-a7ca90b0c757": {
|
||||
"asset": 1714966328721,
|
||||
"meta": 1717062584945,
|
||||
"meta": 1717124728574,
|
||||
"relativePath": "model\\prefab\\box.prefab"
|
||||
},
|
||||
"d81ec8ad-247c-4e62-aa3c-d35c4193c7af": {
|
||||
"asset": 1714966328673,
|
||||
"meta": 1717062584600,
|
||||
"meta": 1717124728352,
|
||||
"relativePath": "image\\default_panel.png"
|
||||
},
|
||||
"b5fc2cf2-7942-483d-be1f-bbeadc4714ad": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584959,
|
||||
"meta": 1717124728570,
|
||||
"relativePath": "model\\prefab\\cone.prefab"
|
||||
},
|
||||
"fe1417b6-fe6b-46a4-ae7c-9fd331f33a2a": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584957,
|
||||
"meta": 1717124728571,
|
||||
"relativePath": "model\\prefab\\capsule.prefab"
|
||||
},
|
||||
"71561142-4c83-4933-afca-cb7a17f67053": {
|
||||
"asset": 1714966328658,
|
||||
"meta": 1717062584602,
|
||||
"meta": 1717124728304,
|
||||
"relativePath": "image\\default_btn_disabled.png"
|
||||
},
|
||||
"567dcd80-8bf4-4535-8a5a-313f1caf078a": {
|
||||
"asset": 1714966328673,
|
||||
"meta": 1717062584646,
|
||||
"meta": 1717124728316,
|
||||
"relativePath": "image\\default_radio_button_off.png"
|
||||
},
|
||||
"3f376125-a699-40ca-ad05-04d662eaa1f2": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584969,
|
||||
"meta": 1717124728576,
|
||||
"relativePath": "model\\prefab\\plane.prefab"
|
||||
},
|
||||
"6c9ef10d-b479-420b-bfe6-39cdda6a8ae0": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584975,
|
||||
"meta": 1717124728578,
|
||||
"relativePath": "model\\prefab\\quad.prefab"
|
||||
},
|
||||
"600301aa-3357-4a10-b086-84f011fa32ba": {
|
||||
"asset": 1714966328642,
|
||||
"meta": 1717062584605,
|
||||
"meta": 1717124728322,
|
||||
"relativePath": "image\\default-particle.png"
|
||||
},
|
||||
"2d9a4b85-b0ab-4c46-84c5-18f393ab2058": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584966,
|
||||
"meta": 1717124728581,
|
||||
"relativePath": "model\\prefab\\sphere.prefab"
|
||||
},
|
||||
"1c5e4038-953a-44c2-b620-0bbfc6170477": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584964,
|
||||
"meta": 1717124728579,
|
||||
"relativePath": "model\\prefab\\cylinder.prefab"
|
||||
},
|
||||
"9d60001f-b5f4-4726-a629-2659e3ded0b8": {
|
||||
"asset": 1714966328673,
|
||||
"meta": 1717062584642,
|
||||
"meta": 1717124728364,
|
||||
"relativePath": "image\\default_radio_button_on.png"
|
||||
},
|
||||
"de510076-056b-484f-b94c-83bef217d0e1": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062584971,
|
||||
"meta": 1717124728583,
|
||||
"relativePath": "model\\prefab\\torus.prefab"
|
||||
},
|
||||
"2be36297-9abb-4fee-8049-9ed5e271da8a": {
|
||||
"asset": 1714966328721,
|
||||
"meta": 1717062584747,
|
||||
"meta": 1717124728436,
|
||||
"relativePath": "misc\\default_video.mp4"
|
||||
},
|
||||
"0291c134-b3da-4098-b7b5-e397edbe947f": {
|
||||
"asset": 1714966328689,
|
||||
"meta": 1717062584649,
|
||||
"meta": 1717124728359,
|
||||
"relativePath": "image\\default_scrollbar.png"
|
||||
},
|
||||
"d6d3ca85-4681-47c1-b5dd-d036a9d39ea2": {
|
||||
"asset": 1714966328689,
|
||||
"meta": 1717062584652,
|
||||
"meta": 1717124728361,
|
||||
"relativePath": "image\\default_scrollbar_vertical.png"
|
||||
},
|
||||
"0275e94c-56a7-410f-bd1a-fc7483f7d14a": {
|
||||
"asset": 1714966328705,
|
||||
"meta": 1717062584650,
|
||||
"meta": 1717124728360,
|
||||
"relativePath": "image\\default_sprite_splash.png"
|
||||
},
|
||||
"73a0903d-d80e-4e3c-aa67-f999543c08f5": {
|
||||
"asset": 1714966328706,
|
||||
"meta": 1717062584710,
|
||||
"meta": 1717124728429,
|
||||
"relativePath": "image\\default_toggle_checkmark.png"
|
||||
},
|
||||
"d29077ba-1627-4a72-9579-7b56a235340c": {
|
||||
"asset": 1714966328706,
|
||||
"meta": 1717062584717,
|
||||
"meta": 1717124728421,
|
||||
"relativePath": "image\\default_toggle_normal.png"
|
||||
},
|
||||
"b181c1e4-0a72-4a91-bfb0-ae6f36ca60bd": {
|
||||
"asset": 1714966328706,
|
||||
"meta": 1717062584713,
|
||||
"meta": 1717124728432,
|
||||
"relativePath": "image\\default_toggle_pressed.png"
|
||||
},
|
||||
"c25b9d50-c8fc-4d27-beeb-6e7c1f2e5c0f": {
|
||||
"asset": 1714966328706,
|
||||
"meta": 1717062584727,
|
||||
"meta": 1717124728427,
|
||||
"relativePath": "image\\default_toggle_disabled.png"
|
||||
},
|
||||
"954fec8b-cd16-4bb9-a3b7-7719660e7558": {
|
||||
"asset": 1714966328737,
|
||||
"meta": 1717062586635,
|
||||
"meta": 1717124730833,
|
||||
"relativePath": "model\\primitives.fbx"
|
||||
},
|
||||
"41ff2622-6092-4155-95fb-636454d00701": {
|
||||
|
@ -769,11 +754,6 @@
|
|||
"meta": 1716457544852,
|
||||
"relativePath": "music\\score.mp3"
|
||||
},
|
||||
"bd9f7f17-383e-4f98-b4e3-936acb6018b3": {
|
||||
"asset": 1716457626335,
|
||||
"meta": 1716457657657,
|
||||
"relativePath": "Script\\BallAudioManager.js"
|
||||
},
|
||||
"ca0f9934-a015-436e-9402-f8e30d4c5de6": {
|
||||
"asset": 1716539551895,
|
||||
"meta": 1716539556737,
|
||||
|
@ -804,11 +784,6 @@
|
|||
"meta": 1716541793471,
|
||||
"relativePath": "resources\\guang.png"
|
||||
},
|
||||
"3fd2f87a-bc73-4978-8494-8b35b4f716ad": {
|
||||
"asset": 1716542146221,
|
||||
"meta": 1716542146893,
|
||||
"relativePath": "Script\\GuideManager.ts"
|
||||
},
|
||||
"1936101e-d078-4d98-ad65-0861a6427b1b": {
|
||||
"asset": 1716543810607,
|
||||
"meta": 1716543818542,
|
||||
|
@ -820,15 +795,10 @@
|
|||
"relativePath": "resources\\20240524-174503.png"
|
||||
},
|
||||
"4eaf518b-35ec-4262-928d-4d497c3f2830": {
|
||||
"asset": 1716777194504,
|
||||
"meta": 1716777194515,
|
||||
"asset": 1717136309187,
|
||||
"meta": 1717136309194,
|
||||
"relativePath": "Scene\\GameScene.fire"
|
||||
},
|
||||
"4be67b1d-91ec-42ca-a2e5-d0d1ddf4dd5f": {
|
||||
"asset": 1716548120488,
|
||||
"meta": 1716548185857,
|
||||
"relativePath": "Script\\Sun.ts"
|
||||
},
|
||||
"1fc00204-78cd-4d9f-b8bb-d393dd8392f9": {
|
||||
"asset": 1714979879932,
|
||||
"meta": 1716549444559,
|
||||
|
@ -864,44 +834,59 @@
|
|||
"meta": 1716861900659,
|
||||
"relativePath": "res\\jiantou.png"
|
||||
},
|
||||
"805c69df-dfdf-4759-97ae-5a7341f424c7": {
|
||||
"asset": 1716889782212,
|
||||
"meta": 1716889783917,
|
||||
"relativePath": "Script\\GameOver.ts"
|
||||
},
|
||||
"9830733c-b94b-4b60-a687-5cf98680259f": {
|
||||
"asset": 1716953892989,
|
||||
"meta": 1716953893911,
|
||||
"relativePath": "Script\\crypto\\serverAPI.ts"
|
||||
},
|
||||
"9c08062d-4cf1-4b6e-a8ba-4a3881cc7e7d": {
|
||||
"asset": 1717066356585,
|
||||
"meta": 1717066356596,
|
||||
"asset": 1717128045682,
|
||||
"meta": 1717128045692,
|
||||
"relativePath": "Scene\\LoadScene.fire"
|
||||
},
|
||||
"454ad829-851a-40ea-8ab9-941e828357ca": {
|
||||
"asset": 1717124810504,
|
||||
"meta": 1717124814356,
|
||||
"relativePath": "Script\\Load.ts"
|
||||
},
|
||||
"f2f0b239-3ec5-48fa-8d7c-c45e86f8a55a": {
|
||||
"asset": 1717058398467,
|
||||
"meta": 1717058398807,
|
||||
"asset": 1717125474791,
|
||||
"meta": 1717125955856,
|
||||
"relativePath": "Script\\GameData.ts"
|
||||
},
|
||||
"b0432040-dbde-438c-839c-ba2b5d18a3b5": {
|
||||
"asset": 1717058598513,
|
||||
"meta": 1717058605737,
|
||||
"relativePath": "Script\\GameManager.ts"
|
||||
"971c4bee-6f80-49a6-aad2-08b3c9f20d55": {
|
||||
"asset": 1717125204129,
|
||||
"meta": 1717125956254,
|
||||
"relativePath": "Script\\tool\\AudioManager.js"
|
||||
},
|
||||
"3fd2f87a-bc73-4978-8494-8b35b4f716ad": {
|
||||
"asset": 1717126472351,
|
||||
"meta": 1717127950261,
|
||||
"relativePath": "Script\\GuideManager.ts"
|
||||
},
|
||||
"e74a9f7d-2031-4e69-bcb2-9998174088b2": {
|
||||
"asset": 1717128095376,
|
||||
"meta": 1717128178176,
|
||||
"relativePath": "Script\\RankManager.ts"
|
||||
},
|
||||
"7cf8c313-e732-40d1-9538-1a9d0970bf2f": {
|
||||
"asset": 1717063208498,
|
||||
"meta": 1717063292263,
|
||||
"asset": 1717128110405,
|
||||
"meta": 1717128178182,
|
||||
"relativePath": "Script\\Storage.ts"
|
||||
},
|
||||
"e1b90feb-a217-4493-849d-9a611900d683": {
|
||||
"asset": 1717066714803,
|
||||
"meta": 1717066715703,
|
||||
"relativePath": "Script\\Helloworld.ts"
|
||||
"4be67b1d-91ec-42ca-a2e5-d0d1ddf4dd5f": {
|
||||
"asset": 1717128516299,
|
||||
"meta": 1717134862309,
|
||||
"relativePath": "Script\\Sun.ts"
|
||||
},
|
||||
"454ad829-851a-40ea-8ab9-941e828357ca": {
|
||||
"asset": 1717067786572,
|
||||
"meta": 1717067786922,
|
||||
"relativePath": "Script\\Load.ts"
|
||||
"805c69df-dfdf-4759-97ae-5a7341f424c7": {
|
||||
"asset": 1717135054805,
|
||||
"meta": 1717136248368,
|
||||
"relativePath": "Script\\GameOver.ts"
|
||||
},
|
||||
"b0432040-dbde-438c-839c-ba2b5d18a3b5": {
|
||||
"asset": 1717137078225,
|
||||
"meta": 1717137094166,
|
||||
"relativePath": "Script\\GameManager.ts"
|
||||
}
|
||||
}
|
|
@ -13,13 +13,13 @@
|
|||
"type": "dock-h",
|
||||
"children": [
|
||||
{
|
||||
"width": 207.28125,
|
||||
"width": 207.1666717529297,
|
||||
"height": 571,
|
||||
"type": "dock-v",
|
||||
"children": [
|
||||
{
|
||||
"width": 207.28125,
|
||||
"height": 308.13543701171875,
|
||||
"width": 207.1666717529297,
|
||||
"height": 307.9895935058594,
|
||||
"type": "panel",
|
||||
"active": 0,
|
||||
"children": [
|
||||
|
@ -27,8 +27,8 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"width": 207.28125,
|
||||
"height": 259.8645935058594,
|
||||
"width": 207.1666717529297,
|
||||
"height": 260,
|
||||
"type": "panel",
|
||||
"active": 0,
|
||||
"children": [
|
||||
|
@ -38,7 +38,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"width": 759.3333740234375,
|
||||
"width": 759.59375,
|
||||
"height": 571,
|
||||
"type": "panel",
|
||||
"active": 0,
|
||||
|
@ -47,7 +47,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"width": 307.375,
|
||||
"width": 307.2395935058594,
|
||||
"height": 571,
|
||||
"type": "panel",
|
||||
"active": 0,
|
||||
|
@ -85,7 +85,7 @@
|
|||
"x": 258,
|
||||
"y": 192,
|
||||
"width": 834,
|
||||
"height": 352
|
||||
"height": 350
|
||||
},
|
||||
"store": {
|
||||
"x": 124,
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"last-edit": "2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"last-edit": "4eaf518b-35ec-4262-928d-4d497c3f2830",
|
||||
"recent-items": [
|
||||
"40ba7e70-1826-4aa1-92f3-aa63ae39294b",
|
||||
"32254f37-ac95-4912-a787-b8e0429ba0f1",
|
||||
"2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"774829bb-123e-48b6-930e-6b3e02491506",
|
||||
"9c08062d-4cf1-4b6e-a8ba-4a3881cc7e7d",
|
||||
"3a232388-d8dc-4f79-a1ea-82f6385b7ce2",
|
||||
"5e515837-650e-4584-a089-e2a025e36c39",
|
||||
"13110e4f-3587-4e6b-8811-0ca16cac8149",
|
||||
"d1323772-4ab2-4527-bd20-501fe4fb9723",
|
||||
"4eaf518b-35ec-4262-928d-4d497c3f2830",
|
||||
"774829bb-123e-48b6-930e-6b3e02491506",
|
||||
"4b9c5a7e-c645-48a4-9aca-5df381ce4ef5",
|
||||
"3a232388-d8dc-4f79-a1ea-82f6385b7ce2",
|
||||
"9c08062d-4cf1-4b6e-a8ba-4a3881cc7e7d",
|
||||
"2d2f792f-a40c-49bb-a189-ed176a246e49"
|
||||
"4eaf518b-35ec-4262-928d-4d497c3f2830"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
"1b6UU0rTRNtIJigj5zDpnO",
|
||||
"92Bxdq/nxJrKbyHZwa4jwm",
|
||||
"eahu5Qi+RGYbJveL2sjd9E",
|
||||
"a5esZu+45LA5mBpvttspPD",
|
||||
"c8+DIo6iBFRoHHuMStaRmg",
|
||||
"83fdXjJEdM1rCZghbgf9lv",
|
||||
"ddR9GXKuBKg5J0qSoBz++j",
|
||||
|
@ -181,14 +180,27 @@
|
|||
"a2FE/ArDJMvYxCIXp+aJNs",
|
||||
"d7Go7VAudBuoLS0+DrZ3M2",
|
||||
"5ed3tKYdxCPJ51e/i3ecou",
|
||||
"beOm6xY9JGcpUIgHepr4za",
|
||||
"78Sk802p9L/Ip+ZPEFbJnp",
|
||||
"cfD+6eekJE44Ilk2xG5ORu",
|
||||
"6bCpWS8ktAfIpBUoWywuvF",
|
||||
"e2e0crkOLxGrpMxpbC4iQg1",
|
||||
"cf4fwLe4hJXLYT5vY7WfC9",
|
||||
"a9Y/TP/QhAdq9i2KGsTC0d",
|
||||
"a1BRwywGFMT6iJxK+nijOf",
|
||||
"7aHA1K+7hE8YNbYjVirEih"
|
||||
"7aHA1K+7hE8YNbYjVirEih",
|
||||
"8ak5WlHVBELqSzRzcpZa3P",
|
||||
"a2Zfykcl1GPqJhA7ixiKd3",
|
||||
"10unPSfi1NUb30N1EjhieB",
|
||||
"791LpnRkFNkqdfpCoJ3Pqk",
|
||||
"fe7qLOC0RM9qPt+IfQpa5W",
|
||||
"8fIUbpCjhI5r01JqiMBRub",
|
||||
"78pYT7vxBK7YbD2aVkC4Kw",
|
||||
"a5NTB6LZBO4a2Z6RkeebsY",
|
||||
"a5esZu+45LA5mBpvttspPD",
|
||||
"411Nmuus1J2b6okQS3uSCm",
|
||||
"c1+P7wcW9K3oQyAJA29gUv",
|
||||
"aaIQpgppxE1Lw8V2w48d1u",
|
||||
"43d8C6FvFMF48NKdshSvDB",
|
||||
"a5O+jG/8JF/bXXMh61VbrP",
|
||||
"ecZU+ZNaxJvovWhjTwolW3",
|
||||
"1eUcABlmZJH62rOyXieYFR",
|
||||
"9ah+lyxSVO6Jf1EY5aebLK"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "774829bb-123e-48b6-930e-6b3e02491506"
|
||||
},
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,7 @@
|
|||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"autoReleaseAssets": true,
|
||||
"_id": "4b9c5a7e-c645-48a4-9aca-5df381ce4ef5"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -504,7 +504,7 @@
|
|||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "ef727dee-a0c6-4dad-b1d5-66f42b7d5ee1"
|
||||
"__uuid__": "281a0d00-f17d-491e-9627-6c7f6f648cd5"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
|
@ -517,9 +517,7 @@
|
|||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": {
|
||||
"__uuid__": "f683b01d-4d4a-4b64-a054-741e0785d512"
|
||||
},
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
@ -742,7 +740,7 @@
|
|||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "ef727dee-a0c6-4dad-b1d5-66f42b7d5ee1"
|
||||
"__uuid__": "281a0d00-f17d-491e-9627-6c7f6f648cd5"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
|
@ -755,9 +753,7 @@
|
|||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": {
|
||||
"__uuid__": "f683b01d-4d4a-4b64-a054-741e0785d512"
|
||||
},
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
@ -971,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -967,7 +967,7 @@
|
|||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn",
|
||||
"customEventData": ""
|
||||
"customEventData": "1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -856,8 +856,8 @@
|
|||
},
|
||||
"component": "",
|
||||
"_componentId": "4be67sdkexCyqLl0NHd9N1f",
|
||||
"handler": "clickBtn2",
|
||||
"customEventData": ""
|
||||
"handler": "clickBtn",
|
||||
"customEventData": "2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":"1.0.8","stats":{"C:/Work/Project/Sun_moves/temp/quick-scripts/src/__qc_index__.js":"2024-05-30T10:01:32.316Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/ListView/ItemRender.js":"2024-05-30T09:49:46.892Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GuideManager.js":"2024-05-30T09:49:46.876Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js":"2024-05-30T09:49:46.883Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameOver.js":"2024-05-30T09:49:46.884Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/crypto/serverAPI.js":"2024-05-30T09:49:46.885Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/DynamicAtlasManager.js":"2024-05-30T09:49:46.878Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Storage.js":"2024-05-30T10:01:32.291Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/test.js":"2024-05-30T09:49:46.898Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Sun.js":"2024-05-30T09:49:46.880Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Helloworld.js":"2024-05-30T09:49:46.894Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/BallAudioManager.js":"2024-05-30T09:49:46.890Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameData.js":"2024-05-30T09:49:46.897Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/ListView/List.js":"2024-05-30T09:49:46.893Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/Shake.js":"2024-05-30T09:49:46.881Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameManager.js":"2024-05-30T09:49:46.887Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Load.js":"2024-05-30T10:01:32.265Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Notification.js":"2024-05-30T09:49:46.896Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/GameTool.js":"2024-05-30T09:49:46.886Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/CtrlFluxayTexture.js":"2024-05-30T09:49:46.888Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/crypto/crypto-js.min.js":"2024-05-30T09:49:46.895Z"}}
|
||||
{"version":"1.0.8","stats":{"C:/Work/Project/Sun_moves/temp/quick-scripts/src/__qc_index__.js":"2024-05-31T04:01:01.151Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/ListView/ItemRender.js":"2024-05-31T03:05:31.347Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameOver.js":"2024-05-31T03:05:31.338Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/crypto/serverAPI.js":"2024-05-31T03:05:31.340Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js":"2024-05-31T03:05:31.336Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GuideManager.js":"2024-05-31T03:59:10.293Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/DynamicAtlasManager.js":"2024-05-31T03:05:31.327Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Helloworld.js":"2024-05-31T03:05:31.350Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameData.js":"2024-05-31T03:25:56.295Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Load.js":"2024-05-31T03:06:54.359Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Notification.js":"2024-05-31T03:05:31.353Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/BallAudioManager.js":"2024-05-31T03:05:31.346Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameManager.js":"2024-05-31T03:25:56.329Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/CtrlFluxayTexture.js":"2024-05-31T03:05:31.344Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/Shake.js":"2024-05-31T03:05:31.334Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/test.js":"2024-05-31T03:05:31.356Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Sun.js":"2024-05-31T03:05:31.333Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Storage.js":"2024-05-31T03:05:31.337Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/GameTool.js":"2024-05-31T03:05:31.341Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/ListView/List.js":"2024-05-31T03:05:31.348Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/crypto/crypto-js.min.js":"2024-05-31T03:05:31.351Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/RankManager.js":"2024-05-31T03:59:10.309Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/AudioManager.js":"2024-05-31T03:25:56.512Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/tool/AudioManager.js":"2024-05-31T03:29:13.491Z"}}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10,22 +10,20 @@
|
|||
};
|
||||
function __define (exports, require, module) {
|
||||
if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}
|
||||
require('./assets/Script/BallAudioManager');
|
||||
require('./assets/Script/CtrlFluxayTexture');
|
||||
require('./assets/Script/GameData');
|
||||
require('./assets/Script/GameManager');
|
||||
require('./assets/Script/GameOver');
|
||||
require('./assets/Script/GuideManager');
|
||||
require('./assets/Script/Helloworld');
|
||||
require('./assets/Script/ListView/ItemRender');
|
||||
require('./assets/Script/ListView/List');
|
||||
require('./assets/Script/Load');
|
||||
require('./assets/Script/Notification');
|
||||
require('./assets/Script/RankManager');
|
||||
require('./assets/Script/Storage');
|
||||
require('./assets/Script/Sun');
|
||||
require('./assets/Script/crypto/crypto-js.min');
|
||||
require('./assets/Script/crypto/serverAPI');
|
||||
require('./assets/Script/test');
|
||||
require('./assets/Script/tool/AudioManager');
|
||||
require('./assets/Script/tool/DynamicAtlasManager');
|
||||
require('./assets/Script/tool/GameTool');
|
||||
require('./assets/Script/tool/Shake');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
(function () {
|
||||
var scripts = [{"deps":{"./assets/Script/GameData":11,"./assets/Script/GameManager":14,"./assets/Script/GameOver":4,"./assets/Script/GuideManager":2,"./assets/Script/Helloworld":9,"./assets/Script/Load":15,"./assets/Script/Notification":16,"./assets/Script/Storage":20,"./assets/Script/Sun":8,"./assets/Script/test":7,"./assets/Script/BallAudioManager":10,"./assets/Script/ListView/List":12,"./assets/Script/ListView/ItemRender":1,"./assets/Script/crypto/serverAPI":5,"./assets/Script/crypto/crypto-js.min":19,"./assets/Script/tool/GameTool":17,"./assets/Script/tool/Shake":13,"./assets/Script/tool/DynamicAtlasManager":6,"./assets/migration/use_v2.1-2.2.1_cc.Toggle_event":3,"./assets/Script/CtrlFluxayTexture":18},"path":"preview-scripts/__qc_index__.js"},{"deps":{},"path":"preview-scripts/assets/Script/ListView/ItemRender.js"},{"deps":{"./GameData":11,"./Notification":16},"path":"preview-scripts/assets/Script/GuideManager.js"},{"deps":{},"path":"preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js"},{"deps":{"./GameData":11,"./crypto/serverAPI":5},"path":"preview-scripts/assets/Script/GameOver.js"},{"deps":{"../GameData":11,"./crypto-js.min.js":19},"path":"preview-scripts/assets/Script/crypto/serverAPI.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/DynamicAtlasManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/test.js"},{"deps":{"./Notification":16},"path":"preview-scripts/assets/Script/Sun.js"},{"deps":{"./GameData":11,"./ListView/List":12,"./crypto/serverAPI":5},"path":"preview-scripts/assets/Script/Helloworld.js"},{"deps":{},"path":"preview-scripts/assets/Script/BallAudioManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameData.js"},{"deps":{"./ItemRender":1},"path":"preview-scripts/assets/Script/ListView/List.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/Shake.js"},{"deps":{"./GameData":11,"./Notification":16,"./crypto/serverAPI":5},"path":"preview-scripts/assets/Script/GameManager.js"},{"deps":{"./GameData":11,"./Storage":20},"path":"preview-scripts/assets/Script/Load.js"},{"deps":{},"path":"preview-scripts/assets/Script/Notification.js"},{"deps":{"Storage":20},"path":"preview-scripts/assets/Script/tool/GameTool.js"},{"deps":{},"path":"preview-scripts/assets/Script/CtrlFluxayTexture.js"},{"deps":{},"path":"preview-scripts/assets/Script/crypto/crypto-js.min.js"},{"deps":{},"path":"preview-scripts/assets/Script/Storage.js"}];
|
||||
var scripts = [{"deps":{"./assets/Script/GameOver":2,"./assets/Script/GuideManager":5,"./assets/Script/Load":8,"./assets/Script/Notification":9,"./assets/Script/RankManager":17,"./assets/Script/Storage":13,"./assets/Script/Sun":12,"./assets/Script/GameData":7,"./assets/Script/ListView/List":15,"./assets/Script/ListView/ItemRender":1,"./assets/Script/crypto/serverAPI":3,"./assets/Script/crypto/crypto-js.min":16,"./assets/Script/tool/DynamicAtlasManager":6,"./assets/Script/tool/GameTool":14,"./assets/Script/tool/Shake":11,"./assets/Script/tool/AudioManager":18,"./assets/migration/use_v2.1-2.2.1_cc.Toggle_event":4,"./assets/Script/GameManager":10},"path":"preview-scripts/__qc_index__.js"},{"deps":{},"path":"preview-scripts/assets/Script/ListView/ItemRender.js"},{"deps":{"./GameData":7,"./crypto/serverAPI":3},"path":"preview-scripts/assets/Script/GameOver.js"},{"deps":{"../GameData":7,"./crypto-js.min.js":16},"path":"preview-scripts/assets/Script/crypto/serverAPI.js"},{"deps":{},"path":"preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js"},{"deps":{"./GameData":7,"./Notification":9},"path":"preview-scripts/assets/Script/GuideManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/DynamicAtlasManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameData.js"},{"deps":{"./GameData":7,"./Storage":13},"path":"preview-scripts/assets/Script/Load.js"},{"deps":{},"path":"preview-scripts/assets/Script/Notification.js"},{"deps":{"./GameData":7,"./Notification":9,"./crypto/serverAPI":3},"path":"preview-scripts/assets/Script/GameManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/Shake.js"},{"deps":{"./Notification":9},"path":"preview-scripts/assets/Script/Sun.js"},{"deps":{},"path":"preview-scripts/assets/Script/Storage.js"},{"deps":{"Storage":13},"path":"preview-scripts/assets/Script/tool/GameTool.js"},{"deps":{"./ItemRender":1},"path":"preview-scripts/assets/Script/ListView/List.js"},{"deps":{},"path":"preview-scripts/assets/Script/crypto/crypto-js.min.js"},{"deps":{"./GameData":7,"./ListView/List":15,"./crypto/serverAPI":3},"path":"preview-scripts/assets/Script/RankManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/AudioManager.js"}];
|
||||
var entries = ["preview-scripts/__qc_index__.js"];
|
||||
var bundleScript = 'preview-scripts/__qc_bundle__.js';
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
228
temp/quick-scripts/dst/assets/Script/RankManager.js
Normal file
228
temp/quick-scripts/dst/assets/Script/RankManager.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -16,8 +16,7 @@ cc._RF.push(module, '7cf8cMT5zJA0ZU4Gp0JcL8v', 'Storage');
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StorageMessage = void 0;
|
||||
// var jequry = require("jquery");
|
||||
// var coinManager = require("coinManager");
|
||||
//缓存浏览器数据
|
||||
var StorageMessage = {
|
||||
getStorage: function (key) {
|
||||
var result = null;
|
||||
|
@ -33,9 +32,6 @@ var StorageMessage = {
|
|||
//主动拉起分享接口
|
||||
var temp = JSON.stringify(value);
|
||||
cc.sys.localStorage.setItem(key, temp);
|
||||
// debugger;
|
||||
// var temp = cc.sys.localStorage.getItem(key);
|
||||
// debugger;
|
||||
},
|
||||
removeStorage: function (key) {
|
||||
//主动删除消息接口
|
||||
|
@ -57,4 +53,4 @@ cc._RF.pop();
|
|||
});
|
||||
}
|
||||
})();
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxTdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLGtDQUFrQztBQUNsQyw0Q0FBNEM7QUFDNUMsSUFBSSxjQUFjLEdBQUc7SUFDakIsVUFBVSxFQUFHLFVBQVMsR0FBRztRQUNyQixJQUFJLE1BQU0sR0FBRyxJQUFJLENBQUM7UUFDbEIsSUFBRyxFQUFFLENBQUMsR0FBRyxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUM7WUFDbEMsSUFBSSxNQUFNLEdBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQy9DO1FBRUQsSUFBRyxNQUFNLEVBQUM7WUFDUixNQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztTQUM3QjtRQUNELE9BQU8sTUFBTSxDQUFDO0lBQ2xCLENBQUM7SUFDRCxVQUFVLEVBQUcsVUFBUyxHQUFHLEVBQUMsS0FBSztRQUMzQixVQUFVO1FBQ1YsSUFBSSxJQUFJLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUNqQyxFQUFFLENBQUMsR0FBRyxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksQ0FBQyxDQUFBO1FBQ3RDLFlBQVk7UUFDWiwrQ0FBK0M7UUFDL0MsWUFBWTtJQUNoQixDQUFDO0lBQ0QsYUFBYSxFQUFHLFVBQVMsR0FBRztRQUMxQixVQUFVO1FBQ1YsSUFBRyxFQUFFLENBQUMsR0FBRyxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUM7WUFDbEMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFBO1NBQ3BDO0lBQ0gsQ0FBQztDQUNKLENBQUM7QUFFTyx3Q0FBYyIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIlxuLy8gdmFyIGplcXVyeSA9IHJlcXVpcmUoXCJqcXVlcnlcIik7XG4vLyB2YXIgY29pbk1hbmFnZXIgPSByZXF1aXJlKFwiY29pbk1hbmFnZXJcIik7XG52YXIgU3RvcmFnZU1lc3NhZ2UgPSB7XG4gICAgZ2V0U3RvcmFnZSA6IGZ1bmN0aW9uKGtleSl7XG4gICAgICAgIHZhciByZXN1bHQgPSBudWxsO1xuICAgICAgICBpZihjYy5zeXMubG9jYWxTdG9yYWdlLmdldEl0ZW0oa2V5KSl7XG4gICAgICAgICAgdmFyIHJlc3VsdCA9IGNjLnN5cy5sb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBpZihyZXN1bHQpe1xuICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH0sXG4gICAgc2V0U3RvcmFnZSA6IGZ1bmN0aW9uKGtleSx2YWx1ZSl7XG4gICAgICAgIC8v5Li75Yqo5ouJ6LW35YiG5Lqr5o6l5Y+jXG4gICAgICAgIHZhciB0ZW1wID0gSlNPTi5zdHJpbmdpZnkodmFsdWUpO1xuICAgICAgICBjYy5zeXMubG9jYWxTdG9yYWdlLnNldEl0ZW0oa2V5LCB0ZW1wKVxuICAgICAgICAvLyBkZWJ1Z2dlcjtcbiAgICAgICAgLy8gdmFyIHRlbXAgPSBjYy5zeXMubG9jYWxTdG9yYWdlLmdldEl0ZW0oa2V5KTtcbiAgICAgICAgLy8gZGVidWdnZXI7XG4gICAgfSxcbiAgICByZW1vdmVTdG9yYWdlIDogZnVuY3Rpb24oa2V5KXtcbiAgICAgIC8v5Li75Yqo5Yig6Zmk5raI5oGv5o6l5Y+jXG4gICAgICBpZihjYy5zeXMubG9jYWxTdG9yYWdlLmdldEl0ZW0oa2V5KSl7XG4gICAgICAgIGNjLnN5cy5sb2NhbFN0b3JhZ2UucmVtb3ZlSXRlbShrZXkpXG4gICAgICB9XG4gICAgfSxcbn07XG5cbmV4cG9ydCB7IFN0b3JhZ2VNZXNzYWdlIH07Il19
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxTdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLFNBQVM7QUFDVCxJQUFJLGNBQWMsR0FBRztJQUNqQixVQUFVLEVBQUcsVUFBUyxHQUFHO1FBQ3JCLElBQUksTUFBTSxHQUFHLElBQUksQ0FBQztRQUNsQixJQUFHLEVBQUUsQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBQztZQUNsQyxJQUFJLE1BQU0sR0FBRyxFQUFFLENBQUMsR0FBRyxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7U0FDL0M7UUFFRCxJQUFHLE1BQU0sRUFBQztZQUNSLE1BQU0sR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1NBQzdCO1FBQ0QsT0FBTyxNQUFNLENBQUM7SUFDbEIsQ0FBQztJQUNELFVBQVUsRUFBRyxVQUFTLEdBQUcsRUFBQyxLQUFLO1FBQzNCLFVBQVU7UUFDVixJQUFJLElBQUksR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ2pDLEVBQUUsQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUE7SUFDMUMsQ0FBQztJQUNELGFBQWEsRUFBRyxVQUFTLEdBQUc7UUFDMUIsVUFBVTtRQUNWLElBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFDO1lBQ2xDLEVBQUUsQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQTtTQUNwQztJQUNILENBQUM7Q0FDSixDQUFDO0FBRU8sd0NBQWMiLCJmaWxlIjoiIiwic291cmNlUm9vdCI6Ii8iLCJzb3VyY2VzQ29udGVudCI6WyIvL+e8k+WtmOa1j+iniOWZqOaVsOaNrlxudmFyIFN0b3JhZ2VNZXNzYWdlID0ge1xuICAgIGdldFN0b3JhZ2UgOiBmdW5jdGlvbihrZXkpe1xuICAgICAgICB2YXIgcmVzdWx0ID0gbnVsbDtcbiAgICAgICAgaWYoY2Muc3lzLmxvY2FsU3RvcmFnZS5nZXRJdGVtKGtleSkpe1xuICAgICAgICAgIHZhciByZXN1bHQgPSBjYy5zeXMubG9jYWxTdG9yYWdlLmdldEl0ZW0oa2V5KTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYocmVzdWx0KXtcbiAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9LFxuICAgIHNldFN0b3JhZ2UgOiBmdW5jdGlvbihrZXksdmFsdWUpe1xuICAgICAgICAvL+S4u+WKqOaLiei1t+WIhuS6q+aOpeWPo1xuICAgICAgICB2YXIgdGVtcCA9IEpTT04uc3RyaW5naWZ5KHZhbHVlKTtcbiAgICAgICAgY2Muc3lzLmxvY2FsU3RvcmFnZS5zZXRJdGVtKGtleSwgdGVtcClcbiAgICB9LFxuICAgIHJlbW92ZVN0b3JhZ2UgOiBmdW5jdGlvbihrZXkpe1xuICAgICAgLy/kuLvliqjliKDpmaTmtojmga/mjqXlj6NcbiAgICAgIGlmKGNjLnN5cy5sb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpKXtcbiAgICAgICAgY2Muc3lzLmxvY2FsU3RvcmFnZS5yZW1vdmVJdGVtKGtleSlcbiAgICAgIH1cbiAgICB9LFxufTtcblxuZXhwb3J0IHsgU3RvcmFnZU1lc3NhZ2UgfTsiXX0=
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
305
temp/quick-scripts/dst/assets/Script/tool/AudioManager.js
Normal file
305
temp/quick-scripts/dst/assets/Script/tool/AudioManager.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,20 +1,18 @@
|
|||
|
||||
require('./assets/Script/BallAudioManager');
|
||||
require('./assets/Script/CtrlFluxayTexture');
|
||||
require('./assets/Script/GameData');
|
||||
require('./assets/Script/GameManager');
|
||||
require('./assets/Script/GameOver');
|
||||
require('./assets/Script/GuideManager');
|
||||
require('./assets/Script/Helloworld');
|
||||
require('./assets/Script/ListView/ItemRender');
|
||||
require('./assets/Script/ListView/List');
|
||||
require('./assets/Script/Load');
|
||||
require('./assets/Script/Notification');
|
||||
require('./assets/Script/RankManager');
|
||||
require('./assets/Script/Storage');
|
||||
require('./assets/Script/Sun');
|
||||
require('./assets/Script/crypto/crypto-js.min');
|
||||
require('./assets/Script/crypto/serverAPI');
|
||||
require('./assets/Script/test');
|
||||
require('./assets/Script/tool/AudioManager');
|
||||
require('./assets/Script/tool/DynamicAtlasManager');
|
||||
require('./assets/Script/tool/GameTool');
|
||||
require('./assets/Script/tool/Shake');
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
"use strict";
|
||||
cc._RF.push(module, 'b48a2ukFF1FlJGSkUcHUIET', 'CtrlFluxayTexture');
|
||||
// Script/CtrlFluxayTexture.js
|
||||
|
||||
"use strict";
|
||||
|
||||
cc.Class({
|
||||
"extends": cc.Component,
|
||||
properties: {
|
||||
m_delayTime: {
|
||||
"default": 0
|
||||
},
|
||||
m_fluxayTime: {
|
||||
"default": 1
|
||||
},
|
||||
m_intervalTime: {
|
||||
"default": 1
|
||||
},
|
||||
m_scale: {
|
||||
"default": 1
|
||||
},
|
||||
m_angle: {
|
||||
"default": 0
|
||||
},
|
||||
m_reviseStartTime: {
|
||||
"default": 0
|
||||
},
|
||||
m_reviseTimeScale: {
|
||||
"default": 1
|
||||
}
|
||||
},
|
||||
ctor: function ctor() {
|
||||
this._time = 0;
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
this._time -= this.m_delayTime;
|
||||
var sprite = this.node.getComponent(cc.Sprite);
|
||||
this._material = sprite.getMaterial(0);
|
||||
|
||||
this._material.setProperty("u_scale", this.m_scale);
|
||||
|
||||
this._material.setProperty("u_angle", this.m_angle);
|
||||
|
||||
this.refreshSpriteFrameData();
|
||||
},
|
||||
update: function update(dt) {
|
||||
if (this._time > this.m_fluxayTime + this.m_intervalTime) {
|
||||
this._time = 0;
|
||||
}
|
||||
|
||||
var u_time = this._time / this.m_fluxayTime;
|
||||
|
||||
if (this._time > this.m_fluxayTime) {
|
||||
u_time = 1 + (this._time - this.m_fluxayTime) / this.m_intervalTime;
|
||||
}
|
||||
|
||||
if (this.m_reviseTimeScale != null && this.m_reviseStartTime != null) {
|
||||
u_time = u_time / this.m_reviseTimeScale;
|
||||
u_time -= this.m_reviseStartTime;
|
||||
}
|
||||
|
||||
this._material.setProperty("u_time", u_time);
|
||||
|
||||
this._time += dt;
|
||||
},
|
||||
refreshSpriteFrameData: function refreshSpriteFrameData() {
|
||||
var sprite = this.node.getComponent(cc.Sprite);
|
||||
var material = sprite.getMaterial(0);
|
||||
var frame = sprite.spriteFrame;
|
||||
|
||||
if (frame != null) {
|
||||
// xMin
|
||||
var l = frame.uv[0]; // xMax
|
||||
|
||||
var r = frame.uv[6]; // yMax
|
||||
|
||||
var b = frame.uv[3]; // yMin
|
||||
|
||||
var t = frame.uv[5]; // 纹理在合图中的四个边界 uv 坐标
|
||||
|
||||
var u_uvOffset = new cc.Vec4(l, t, r, b); // 纹理是否旋转
|
||||
|
||||
var u_uvRotated = frame.isRotated() ? 1.0 : 0.0; // 设置材质的属性
|
||||
|
||||
if (material.getProperty("u_uvOffset") !== undefined) {
|
||||
material.setProperty("u_uvOffset", u_uvOffset);
|
||||
}
|
||||
|
||||
if (material.getProperty("u_uvRotated") !== undefined) {
|
||||
material.setProperty("u_uvRotated", u_uvRotated);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cc._RF.pop();
|
|
@ -3,12 +3,6 @@ cc._RF.push(module, 'f2f0bI5PsVI+o18xF6G+KVa', 'GameData');
|
|||
// Script/GameData.ts
|
||||
|
||||
"use strict";
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
|
@ -33,21 +27,15 @@ var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
|||
var GameData = /** @class */ (function (_super) {
|
||||
__extends(GameData, _super);
|
||||
function GameData() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.label = null;
|
||||
_this.text = 'hello';
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
GameData_1 = GameData;
|
||||
// LEVEL_INFO: { number: number; }[];
|
||||
// LEVEL_INFO:[];
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
GameData.prototype.onLoad = function () {
|
||||
if (GameData_1._instance == null) {
|
||||
GameData_1._instance = this;
|
||||
cc.game.addPersistRootNode(this.node);
|
||||
this.AudioManager = this.node.getComponent('BallAudioManager');
|
||||
//设置为常驻,绑定音频以及游戏各类信息
|
||||
this.AudioManager = this.node.getComponent('AudioManager');
|
||||
}
|
||||
else {
|
||||
this.node.destroy();
|
||||
|
@ -55,6 +43,13 @@ var GameData = /** @class */ (function (_super) {
|
|||
}
|
||||
};
|
||||
GameData.prototype.start = function () {
|
||||
this.GM_INFO_init();
|
||||
this.CLICK_init();
|
||||
this.LEVEL_INFO_init();
|
||||
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
||||
this.GAME_DATA = [];
|
||||
};
|
||||
GameData.prototype.GM_INFO_init = function () {
|
||||
this.GM_INFO = {
|
||||
// isEnd: false,
|
||||
mean_Time: 0,
|
||||
|
@ -68,6 +63,26 @@ var GameData = /** @class */ (function (_super) {
|
|||
matchId: null,
|
||||
custom: 0
|
||||
};
|
||||
};
|
||||
GameData.prototype.CLICK_init = function () {
|
||||
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
|
||||
};
|
||||
};
|
||||
GameData.prototype.LEVEL_INFO_init = function () {
|
||||
this.LEVEL_INFO = [
|
||||
{
|
||||
number: 3,
|
||||
|
@ -268,251 +283,10 @@ var GameData = /** @class */ (function (_super) {
|
|||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 5,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 5,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 7,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 2,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
moveNumber: 4,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
moveNumber: 5,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 1
|
||||
},
|
||||
{
|
||||
number: 10,
|
||||
moveNumber: 0,
|
||||
moveSpeed: 6,
|
||||
maxDistance: 200,
|
||||
maxMove: 1200,
|
||||
repeat: 0
|
||||
},
|
||||
}
|
||||
];
|
||||
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
|
||||
};
|
||||
this.GAME_DATA = [];
|
||||
};
|
||||
GameData.prototype.CLICK_init = function () {
|
||||
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
|
||||
};
|
||||
};
|
||||
var GameData_1;
|
||||
__decorate([
|
||||
property(cc.Label)
|
||||
], GameData.prototype, "label", void 0);
|
||||
__decorate([
|
||||
property
|
||||
], GameData.prototype, "text", void 0);
|
||||
GameData = GameData_1 = __decorate([
|
||||
ccclass
|
||||
], GameData);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,12 +3,6 @@ cc._RF.push(module, 'b0432BA295DjIOcuitdGKO1', 'GameManager');
|
|||
// Script/GameManager.ts
|
||||
|
||||
"use strict";
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
|
@ -29,6 +23,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// 主游戏控制类
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||
var GameData_1 = require("./GameData");
|
||||
var Notification_1 = require("./Notification");
|
||||
|
@ -46,7 +41,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
_this.bg1 = null;
|
||||
_this.bg2 = null;
|
||||
_this.time = null;
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
_this.begin = false;
|
||||
_this.fuhuo = false;
|
||||
_this.over = false;
|
||||
|
@ -54,38 +48,11 @@ var GameManager = /** @class */ (function (_super) {
|
|||
_this.levelLabel = null;
|
||||
return _this;
|
||||
}
|
||||
GameManager.prototype.onLoad = function () {
|
||||
};
|
||||
GameManager.prototype.onLoad = function () { };
|
||||
GameManager.prototype.start = function () {
|
||||
this.fit();
|
||||
this.init();
|
||||
};
|
||||
GameManager.prototype.fit = function () {
|
||||
this.fitTop = 450; //600
|
||||
this.fitBot = -600; //-700
|
||||
var jg = this.setFit();
|
||||
if (!jg) {
|
||||
this.fitTop = 600;
|
||||
this.fitBot = -700;
|
||||
}
|
||||
};
|
||||
GameManager.prototype.getSetScreenResolutionFlag = function () {
|
||||
var size = cc.winSize;
|
||||
var width = size.width;
|
||||
var height = size.height;
|
||||
if ((height / width) > (16.2 / 9))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
//判断全面屏适配
|
||||
GameManager.prototype.setFit = function () {
|
||||
var flag = this.getSetScreenResolutionFlag();
|
||||
if (flag) {
|
||||
}
|
||||
else {
|
||||
}
|
||||
return flag;
|
||||
};
|
||||
//初始化数据
|
||||
GameManager.prototype.init = function () {
|
||||
this.node.getChildByName("GameOver").zIndex = 100;
|
||||
|
@ -133,6 +100,35 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.schedule(this.updateCountDownTime, 1);
|
||||
this.startGame();
|
||||
};
|
||||
//根据是否全面屏,做独立适配方面
|
||||
GameManager.prototype.fit = function () {
|
||||
this.fitTop = 450; //600
|
||||
this.fitBot = -600; //-700
|
||||
var jg = this.setFit();
|
||||
if (!jg) {
|
||||
this.fitTop = 600;
|
||||
this.fitBot = -700;
|
||||
}
|
||||
};
|
||||
//判断全面屏
|
||||
GameManager.prototype.getSetScreenResolutionFlag = function () {
|
||||
var size = cc.winSize;
|
||||
var width = size.width;
|
||||
var height = size.height;
|
||||
if ((height / width) > (16.2 / 9))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
//判断全面屏适配
|
||||
GameManager.prototype.setFit = function () {
|
||||
var flag = this.getSetScreenResolutionFlag();
|
||||
if (flag) {
|
||||
}
|
||||
else {
|
||||
}
|
||||
return flag;
|
||||
};
|
||||
//返回首页
|
||||
GameManager.prototype.backScene = function () {
|
||||
cc.director.loadScene("LoadScene");
|
||||
};
|
||||
|
@ -167,8 +163,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.bgMove(-1);
|
||||
}
|
||||
};
|
||||
GameManager.prototype.begin_Guide = function () {
|
||||
};
|
||||
//获取时间戳
|
||||
GameManager.prototype.getTime = function () {
|
||||
var timestamp = new Date().getTime();
|
||||
|
@ -183,7 +177,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
var timeCount = 0;
|
||||
var ball_1 = this.ball_Array[0];
|
||||
for (var i = 1; i < this.ball_Array.length; i++) {
|
||||
var time = this.calculateDistance2(this.ball_Array[i].x, this.ball_Array[i].y, this.ball_Array[i - 1].x, this.ball_Array[i - 1].y);
|
||||
var time = this.calculateDistance(this.ball_Array[i].x, this.ball_Array[i].y, this.ball_Array[i - 1].x, this.ball_Array[i - 1].y, 2);
|
||||
timeArray_1.push(time);
|
||||
}
|
||||
var _loop_1 = function (k) {
|
||||
|
@ -237,6 +231,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
};
|
||||
//清理太阳
|
||||
GameManager.prototype.clearSun = function () {
|
||||
for (var k = 0; k < this.ball_Array.length; k++) {
|
||||
this.ball_Array[k].removeFromParent();
|
||||
|
@ -257,11 +252,8 @@ var GameManager = /** @class */ (function (_super) {
|
|||
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;
|
||||
// GameData._instance.GM_INFO.total += 1;
|
||||
if (this.ball_Array[this.clickNow - 1])
|
||||
this.ball_Array[this.clickNow - 1].getChildByName("guang").active = false;
|
||||
// setTimeout(() => {
|
||||
// }, 200);
|
||||
if (this.clickNow == this.now_Array.length) {
|
||||
this.pause = true;
|
||||
GameData_1.default._instance.GM_INFO.total += this.clickNow;
|
||||
|
@ -269,12 +261,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
if (this.startTime > 0 && this.overTime > 0) {
|
||||
GameData_1.default._instance.GM_INFO.mean_Time += (this.overTime - this.startTime);
|
||||
}
|
||||
// console.log("成功",GameData._instance.GM_INFO.mean_Time,this.overTime,this.startTime);
|
||||
// console.log(GameData._instance.GM_INFO.mean_Time);
|
||||
var finish_time = parseInt((this.overTime - this.startTime) / 100 + "");
|
||||
this.startTime = 0;
|
||||
this.overTime = 0;
|
||||
// console.log("33333333");
|
||||
var color = "y";
|
||||
if (this.level < 4 && this.level > 1)
|
||||
color = "yr";
|
||||
|
@ -319,7 +308,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
stepTimeList: this.time_Array,
|
||||
remainder: this.countTime
|
||||
};
|
||||
this.outPut();
|
||||
this.setData();
|
||||
cc.tween(win_1)
|
||||
.delay(0.4)
|
||||
|
@ -351,9 +339,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
else {
|
||||
this.setLoss();
|
||||
}
|
||||
// this.hitAction(data)
|
||||
}
|
||||
};
|
||||
//执行失败
|
||||
GameManager.prototype.setLoss = function () {
|
||||
GameData_1.default._instance.AudioManager.playWarning();
|
||||
this.begin = false;
|
||||
|
@ -404,7 +392,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
stepTimeList: this.time_Array,
|
||||
remainder: this.countTime
|
||||
};
|
||||
this.outPut();
|
||||
this.setData();
|
||||
if (this.fuhuo == true) {
|
||||
this.fuhuo = false;
|
||||
|
@ -433,22 +420,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
.to(0.1, { opacity: 0 })
|
||||
.start();
|
||||
};
|
||||
GameManager.prototype.hitAction = function (data) {
|
||||
var _this = this;
|
||||
this.hit.active = true;
|
||||
this.hit.opacity = 0;
|
||||
this.hit.setPosition;
|
||||
this.hit.setPosition(this.ball_Array[data].x + 35, this.ball_Array[data].y + 35);
|
||||
cc.tween(this.hit)
|
||||
.to(0, { opacity: 255 })
|
||||
.to(0.2, { position: cc.v3(this.hit.x - 35, this.hit.y - 35, 0) })
|
||||
.delay(0.2)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.call(function () {
|
||||
_this.hit.active = false;
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//开始游戏
|
||||
GameManager.prototype.startGame = function () {
|
||||
if (this.over == false && this.countTime > 0) {
|
||||
|
@ -458,9 +429,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
cc.tween(this.ball)
|
||||
.to(0.5, { opacity: 255, scale: 1.3 })
|
||||
.start();
|
||||
// this.runGame()
|
||||
}
|
||||
};
|
||||
//执行太阳运行动画,以及后面移动动画
|
||||
GameManager.prototype.runGame = function () {
|
||||
var _this = this;
|
||||
var time = -650;
|
||||
|
@ -504,6 +475,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
_loop_3(i);
|
||||
}
|
||||
};
|
||||
//设置移动重叠数据
|
||||
GameManager.prototype.createMove = function () {
|
||||
var _this = this;
|
||||
if (this.over == false) {
|
||||
|
@ -573,10 +545,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// debugger;
|
||||
//设置重叠
|
||||
// this.repeat = -1;
|
||||
// this.numberRepeat = -1;
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
for (var k = 0; k < this.moveArray.length; k++) {
|
||||
if (this.moveArray[k] == 1 && (k == this.repeat || k == this.numberRepeat)) {
|
||||
|
@ -626,9 +594,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
if (info.moveNumber > 0) {
|
||||
//0 1 2 3 4 5 6 7 8 9
|
||||
//可移动区分
|
||||
var pos = cc.v2(0, 0);
|
||||
// this.repeat = -1;
|
||||
// this.numberRepeat = -1;
|
||||
//将重叠的设置为不可移动 1 1 1 1 0 0 1 0 0 0 / 2 7
|
||||
for (var k = 0; k < this.moveArray.length; k++) {
|
||||
if (this.moveArray[k] == 1 && (k == this.repeat || k == this.numberRepeat)) {
|
||||
|
@ -651,7 +616,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
var _loop_5 = function (i) {
|
||||
if (moveArray[i] == 1) {
|
||||
if (i != lastNumber) { //如果不是最后一个移动的
|
||||
var time = speed * this_4.calculateDistance3(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y);
|
||||
var time = speed * this_4.calculateDistance(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y, 3);
|
||||
this_4.ball_Array[i].getComponent("Sun").move = true;
|
||||
cc.tween(this_4.ball_Array[i])
|
||||
.to(time, { position: this_4.Pos_Array[i] })
|
||||
|
@ -662,7 +627,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
//如果是最后一个
|
||||
else {
|
||||
var time = speed * this_4.calculateDistance3(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y);
|
||||
var time = speed * this_4.calculateDistance(this_4.ball_Array[i].x, this_4.ball_Array[i].y, this_4.Pos_Array[i].x, this_4.Pos_Array[i].y, 3);
|
||||
this_4.ball_Array[i].getComponent("Sun").move = true;
|
||||
cc.tween(this_4.ball_Array[i])
|
||||
.to(time, { position: this_4.Pos_Array[i] })
|
||||
|
@ -679,6 +644,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
};
|
||||
//每次重新开始新一轮儿游戏
|
||||
GameManager.prototype.beginGame = function () {
|
||||
this.begin = true;
|
||||
this.startTime = this.getTime();
|
||||
|
@ -686,19 +652,20 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.pause = false;
|
||||
// this.node.getChildByName("showBtn").active = true;
|
||||
};
|
||||
GameManager.prototype.getRandomArray = function (lastNumber) {
|
||||
var num = parseInt(Math.random() * 8 - 4 + "");
|
||||
var 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;
|
||||
};
|
||||
//暂时作废
|
||||
// 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 () {
|
||||
var _this = this;
|
||||
|
@ -720,8 +687,8 @@ var GameManager = /** @class */ (function (_super) {
|
|||
for (var l = 0; l < levelData.number; l++) {
|
||||
_loop_6(l);
|
||||
}
|
||||
// 0 0 0 0 0 0 0 0 0 0 0
|
||||
};
|
||||
//创建太阳位置,颜色信息等数据
|
||||
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 levelData = GameData_1.default._instance.LEVEL_INFO[this.level - 1];
|
||||
|
@ -738,9 +705,10 @@ var GameManager = /** @class */ (function (_super) {
|
|||
if (levelData.number == 4)
|
||||
colorArray = [0, 0, 0, 0];
|
||||
this.color_Array = colorArray;
|
||||
//存储太阳数据
|
||||
for (var i = 0; i < levelData.number; i++) {
|
||||
var timeCount = this.timeCount + (0.6 - this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y));
|
||||
var time = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y) + timeCount;
|
||||
var timeCount = this.timeCount + (0.6 - this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y, 1));
|
||||
var time = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[i].x, this.Pos_Array[i].y, 1) + timeCount;
|
||||
data = { x: this.Pos_Array[i].x, y: this.Pos_Array[i].y, time: time, timeCount: timeCount, color: colorArray[i], speed: levelData.moveSpeed, repeat: false };
|
||||
if (this.repeat == i) {
|
||||
data.repeat = true;
|
||||
|
@ -752,6 +720,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
this.runGame();
|
||||
};
|
||||
//获取,N个太阳位置的方法,和POS2分开两个方法,防止递归溢出
|
||||
GameManager.prototype.getPos = function (type, num) {
|
||||
var posX = Math.random() * 620 - 310;
|
||||
var posY = Math.random() * (this.fitTop - this.fitBot) + this.fitBot;
|
||||
|
@ -774,6 +743,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return point;
|
||||
};
|
||||
//获取,N个太阳可移动位置的方法,和POS分开算防止递归溢出
|
||||
GameManager.prototype.getPos2 = function (type, num) {
|
||||
var posX = Math.random() * 620 - 310;
|
||||
var posY = Math.random() * (this.fitTop - this.fitBot) + this.fitBot;
|
||||
|
@ -796,6 +766,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return point;
|
||||
};
|
||||
//获取两点之间距离,返回判断是否在一定范围内 将来提出到工具类
|
||||
GameManager.prototype.getDistance = function (x1, y1, x2, y2, num) {
|
||||
var jg = false;
|
||||
var dx = x2 - x1;
|
||||
|
@ -819,6 +790,92 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return jg;
|
||||
};
|
||||
//命中动画
|
||||
GameManager.prototype.hitAction = function (data) {
|
||||
var _this = this;
|
||||
this.hit.active = true;
|
||||
this.hit.opacity = 0;
|
||||
this.hit.setPosition;
|
||||
this.hit.setPosition(this.ball_Array[data].x + 35, this.ball_Array[data].y + 35);
|
||||
cc.tween(this.hit)
|
||||
.to(0, { opacity: 255 })
|
||||
.to(0.2, { position: cc.v3(this.hit.x - 35, this.hit.y - 35, 0) })
|
||||
.delay(0.2)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.call(function () {
|
||||
_this.hit.active = false;
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//创造太阳
|
||||
GameManager.prototype.createBall = function (number, color, speed, repeat) {
|
||||
var ball = null;
|
||||
if (color == 0)
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
else if (color == 1)
|
||||
ball = cc.instantiate(this.qiu2);
|
||||
else if (color == 2)
|
||||
ball = cc.instantiate(this.qiu3);
|
||||
ball.parent = this.node.getChildByName("Sun");
|
||||
ball.zIndex = this.now_Array.length - number;
|
||||
ball.setPosition(this.ball.x, this.ball.y);
|
||||
ball.getComponent("Sun").init(number, color, speed, repeat);
|
||||
this.ball_Array.push(ball);
|
||||
};
|
||||
//销毁连线
|
||||
GameManager.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
//创建连线
|
||||
GameManager.prototype.createLine = function (start, end, time) {
|
||||
var line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
line.setPosition(start.x, start.y);
|
||||
var dx = end.x - start.x;
|
||||
var dy = end.y - start.y;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
line.height = distance;
|
||||
line.getComponent(cc.Sprite).fillRange = 0;
|
||||
line.angle = -this.calculateAngle(start.x, start.y, end.x, end.y);
|
||||
cc.tween(line.getComponent(cc.Sprite))
|
||||
.to(time, { fillRange: 1 })
|
||||
.start();
|
||||
};
|
||||
//获取两点之间的角度,将来都可放工具类
|
||||
GameManager.prototype.calculateAngle = function (x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90;
|
||||
return -angle;
|
||||
};
|
||||
//获取两点之间的距离 返回对应时间
|
||||
GameManager.prototype.calculateDistance = function (x1, y1, x2, y2, num) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var time = 0;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (num == 1) {
|
||||
if (distance > 800)
|
||||
distance = 800;
|
||||
time = distance / 800 * 0.6;
|
||||
}
|
||||
else if (num == 2) {
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
time = distance / 1200 * 1;
|
||||
}
|
||||
else if (num == 3) {
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
time = distance / 1200 * 1.5;
|
||||
}
|
||||
return time;
|
||||
};
|
||||
//获取两点之间距离 返回距离判断
|
||||
GameManager.prototype.getDistance2 = function (x1, y1, x2, y2, num) {
|
||||
var jg = false;
|
||||
var dx = x2 - x1;
|
||||
|
@ -837,81 +894,12 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return jg;
|
||||
};
|
||||
GameManager.prototype.createBall = function (number, color, speed, repeat) {
|
||||
var ball = null;
|
||||
if (color == 0)
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
else if (color == 1)
|
||||
ball = cc.instantiate(this.qiu2);
|
||||
else if (color == 2)
|
||||
ball = cc.instantiate(this.qiu3);
|
||||
ball.parent = this.node.getChildByName("Sun");
|
||||
ball.zIndex = this.now_Array.length - number;
|
||||
ball.setPosition(this.ball.x, this.ball.y);
|
||||
ball.getComponent("Sun").init(number, color, speed, repeat);
|
||||
this.ball_Array.push(ball);
|
||||
};
|
||||
GameManager.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
GameManager.prototype.createLine = function (start, end, time) {
|
||||
var line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
line.setPosition(start.x, start.y);
|
||||
var dx = end.x - start.x;
|
||||
var dy = end.y - start.y;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
line.height = distance;
|
||||
line.getComponent(cc.Sprite).fillRange = 0;
|
||||
line.angle = -this.calculateAngle(start.x, start.y, end.x, end.y);
|
||||
cc.tween(line.getComponent(cc.Sprite))
|
||||
.to(time, { fillRange: 1 })
|
||||
.start();
|
||||
};
|
||||
GameManager.prototype.calculateAngle = function (x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90;
|
||||
return -angle;
|
||||
};
|
||||
GameManager.prototype.calculateDistance = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (distance > 800)
|
||||
distance = 800;
|
||||
var time = distance / 800 * 0.6;
|
||||
return time;
|
||||
};
|
||||
GameManager.prototype.calculateDistance2 = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
var time = distance / 1200 * 1;
|
||||
return time;
|
||||
};
|
||||
GameManager.prototype.calculateDistance3 = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||
if (distance > 1200)
|
||||
distance = 1200;
|
||||
var time = distance / 1200 * 1.5;
|
||||
return time;
|
||||
};
|
||||
//背景移动
|
||||
GameManager.prototype.bgMove = function (type) {
|
||||
var _this = this;
|
||||
var random = Math.random() * 300 + 300;
|
||||
var posX = Math.random() * 600 - 300;
|
||||
var y1 = this.bg1.y - random * type;
|
||||
// let y2 = this.bg2.y - random*type;
|
||||
var time1 = 0.7 * (random / 400);
|
||||
cc.tween(this.ball)
|
||||
.to(0.3, { scale: 1.3 })
|
||||
|
@ -921,17 +909,9 @@ var GameManager = /** @class */ (function (_super) {
|
|||
.delay(0.3)
|
||||
.to(time1, { y: y1 })
|
||||
.start();
|
||||
// cc.tween(this.bg2)
|
||||
// .delay(0.3)
|
||||
// .to(time1,{y:y2})
|
||||
// .start();
|
||||
setTimeout(function () {
|
||||
// if(this.over == false && GameData._instance.GM_INFO.custom == 0){
|
||||
// this.startGame();
|
||||
// }
|
||||
if (_this.over == false) {
|
||||
if (_this.over == false)
|
||||
_this.startGame();
|
||||
}
|
||||
}, time1 * 1500);
|
||||
};
|
||||
//时间格式转换
|
||||
|
@ -974,20 +954,21 @@ var GameManager = /** @class */ (function (_super) {
|
|||
this.unschedule(this.updateCountDownTime);
|
||||
this.setLoss();
|
||||
var time = 0;
|
||||
// console.log(GameData._instance.GM_INFO.mean_Time,this.clickCount);
|
||||
if (this.clickCount > 0)
|
||||
time = parseInt(GameData_1.default._instance.GM_INFO.mean_Time / this.clickCount + "");
|
||||
GameData_1.default._instance.GM_INFO.mean_Time = parseInt(time / 100 + "");
|
||||
GameData_1.default._instance.GM_INFO.mean_Time = GameData_1.default._instance.GM_INFO.mean_Time / 10;
|
||||
// console.log( GameData._instance.GM_INFO.mean_Time,time);
|
||||
// debugger;
|
||||
if (time > 10000)
|
||||
time = (Math.random() * 10 + 5) * 100;
|
||||
this.setRank(time);
|
||||
}
|
||||
}
|
||||
};
|
||||
//上传每次操作数据
|
||||
GameManager.prototype.setData = function () {
|
||||
GameData_1.default._instance.GAME_DATA = [];
|
||||
GameData_1.default._instance.GAME_DATA.push(GameData_1.default._instance.CLICK_DATA);
|
||||
GameData_1.default._instance.CLICK_init();
|
||||
var data = GameData_1.default._instance.GAME_DATA;
|
||||
var matchId = this.getMatchId();
|
||||
console.log(matchId);
|
||||
|
@ -998,6 +979,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
console.log("上传数据:");
|
||||
serverAPI_1.default.uploadUserLogData(postData, function () { });
|
||||
};
|
||||
//获取matchId 用于上传每次点击数据里面记录id方便查询
|
||||
GameManager.prototype.getMatchId = function () {
|
||||
var matchId = cc.sys.localStorage.getItem("matchId");
|
||||
if (matchId == "undifend" || matchId == null) {
|
||||
|
@ -1019,9 +1001,11 @@ var GameManager = /** @class */ (function (_super) {
|
|||
}
|
||||
return matchId;
|
||||
};
|
||||
//检测matchId 如果有缓存以前的nanana数据清除
|
||||
GameManager.prototype.containsNanana = function (str) {
|
||||
return /na/i.test(str);
|
||||
};
|
||||
//重新设置MatchId
|
||||
GameManager.prototype.setMatchId = function () {
|
||||
// 定义包含可用字符的字符集
|
||||
var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
|
@ -1042,6 +1026,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
GameData_1.default._instance.GM_INFO.matchId = data;
|
||||
return data;
|
||||
};
|
||||
//上传排行榜数据
|
||||
GameManager.prototype.setRank = function (time) {
|
||||
var postData = {
|
||||
"type": 1,
|
||||
|
@ -1049,7 +1034,6 @@ var GameManager = /** @class */ (function (_super) {
|
|||
"totalSunCount": GameData_1.default._instance.GM_INFO.total,
|
||||
"success": GameData_1.default._instance.GM_INFO.success
|
||||
};
|
||||
// console.log(postData);
|
||||
serverAPI_1.default.rankData(1, function () { }, postData);
|
||||
this.node.getChildByName("GameOver").active = true;
|
||||
this.node.getChildByName("GameOver").opacity = 0;
|
||||
|
@ -1062,12 +1046,7 @@ var GameManager = /** @class */ (function (_super) {
|
|||
})
|
||||
.start();
|
||||
};
|
||||
GameManager.prototype.outPut = function () {
|
||||
var data = GameData_1.default._instance.CLICK_DATA;
|
||||
GameData_1.default._instance.GAME_DATA = [];
|
||||
GameData_1.default._instance.GAME_DATA.push(GameData_1.default._instance.CLICK_DATA);
|
||||
GameData_1.default._instance.CLICK_init();
|
||||
};
|
||||
//作弊,测试用
|
||||
GameManager.prototype.showNumber = function () {
|
||||
if (this.show == false)
|
||||
this.show = true;
|
||||
|
@ -1079,10 +1058,8 @@ var GameManager = /** @class */ (function (_super) {
|
|||
};
|
||||
GameManager.prototype.onEnable = function () {
|
||||
Notification_1.Notification.on("clickSun", this.clickSun, this);
|
||||
// Notification.on("HammerPlay", this.HammerPlay, this);
|
||||
};
|
||||
GameManager.prototype.onDisable = function () {
|
||||
// Notification.off("rightAnswers", this.rightAnswers);
|
||||
Notification_1.Notification.off("clickSun", this.clickSun);
|
||||
};
|
||||
GameManager.prototype.update = function (dt) {
|
||||
|
|
|
@ -45,9 +45,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.four = null;
|
||||
_this.five = null;
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
}
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
// onLoad () {}
|
||||
NewClass.prototype.start = function () {
|
||||
this.count.string = GameData_1.default._instance.GM_INFO.total;
|
||||
|
@ -55,6 +53,10 @@ var NewClass = /** @class */ (function (_super) {
|
|||
GameData_1.default._instance.GM_INFO.mean_Time = (parseInt(Math.random() * 10 + "") + 5) / 10;
|
||||
}
|
||||
this.time.string = GameData_1.default._instance.GM_INFO.mean_Time + "s";
|
||||
this.init();
|
||||
};
|
||||
//初始化数据
|
||||
NewClass.prototype.init = function () {
|
||||
this.listData = [];
|
||||
this.selfData = null;
|
||||
this.one.active = false;
|
||||
|
@ -62,17 +64,17 @@ var NewClass = /** @class */ (function (_super) {
|
|||
this.three.active = false;
|
||||
this.four.active = false;
|
||||
this.five.active = false;
|
||||
// this.setData();
|
||||
this.getRank();
|
||||
};
|
||||
NewClass.prototype.success = function (data) {
|
||||
};
|
||||
NewClass.prototype.back = function () {
|
||||
//打开排行榜
|
||||
NewClass.prototype.openRank = function () {
|
||||
cc.director.loadScene("RankScene");
|
||||
};
|
||||
//重新开始玩
|
||||
NewClass.prototype.again = function () {
|
||||
cc.director.loadScene("GameScene");
|
||||
};
|
||||
//获取排行榜
|
||||
NewClass.prototype.getRank = function () {
|
||||
var postData = {
|
||||
"page": 1,
|
||||
|
@ -80,6 +82,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
};
|
||||
serverAPI_1.default.rankData(2, this.getRankData.bind(this), postData);
|
||||
};
|
||||
//设置排行信息
|
||||
NewClass.prototype.getRankData = function (data) {
|
||||
if (data) {
|
||||
this.listData = data.data.list;
|
||||
|
@ -106,6 +109,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
}
|
||||
}
|
||||
};
|
||||
//根据内容填充排行榜
|
||||
NewClass.prototype.setRank = function (num, data) {
|
||||
var hitNode = null;
|
||||
if (num == 0) {
|
||||
|
@ -133,6 +137,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
this.setPic(hitNode.getChildByName("pic").getChildByName("icon"), data.pic);
|
||||
}
|
||||
};
|
||||
//设置头像
|
||||
NewClass.prototype.setPic = function (node, pic) {
|
||||
node.active = false;
|
||||
var url = pic;
|
||||
|
|
|
@ -23,12 +23,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
//此页面为引导页面,后续更新成模板,暂时偷懒复制主游戏场景代码进来
|
||||
var GameData_1 = require("./GameData");
|
||||
var Notification_1 = require("./Notification");
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
||||
|
@ -42,15 +37,16 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.qiu1 = null;
|
||||
_this.linePrefab = null;
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
}
|
||||
// onLoad () {}
|
||||
NewClass.prototype.start = function () {
|
||||
this.custom = 1;
|
||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
||||
this.init();
|
||||
this.startGuide(0);
|
||||
};
|
||||
//初始化数据
|
||||
NewClass.prototype.init = function () {
|
||||
this.custom = 1;
|
||||
this.ball.zIndex = 100;
|
||||
this.Pos_Array = [];
|
||||
this.ball_Array = [];
|
||||
|
@ -58,11 +54,11 @@ var NewClass = /** @class */ (function (_super) {
|
|||
this.clickNow = 0;
|
||||
this.tip = null;
|
||||
};
|
||||
//开始引导方法
|
||||
NewClass.prototype.startGuide = function (type) {
|
||||
var _this = this;
|
||||
var num = this.custom;
|
||||
var time = 0.5;
|
||||
var delay = 1.5;
|
||||
var name = "tip" + num;
|
||||
if (type != 0) {
|
||||
cc.tween(this.node)
|
||||
|
@ -75,9 +71,8 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.createSun1();
|
||||
else if (_this.custom == 3)
|
||||
_this.createSun2();
|
||||
else if (_this.custom == 4) {
|
||||
else if (_this.custom == 4)
|
||||
_this.begin = true;
|
||||
}
|
||||
else if (_this.custom == 5)
|
||||
cc.director.loadScene("GameScene");
|
||||
})
|
||||
|
@ -90,47 +85,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
cc.tween(this.tip)
|
||||
.to(time, { opacity: 255 })
|
||||
.start();
|
||||
// cc.tween(tip)
|
||||
// .to(time,{opacity:255})
|
||||
// .delay(delay)
|
||||
// .to(time,{opacity:0})
|
||||
// .call(() =>{
|
||||
// this.custom += 1;
|
||||
// if(type != 0) this.custom = 2;
|
||||
// if( this.custom == 2) this.createSun1();
|
||||
// else if( this.custom == 3) this.createSun2();
|
||||
// else if( this.custom == 4) this.begin = true;
|
||||
// else if( this.custom == 5) cc.director.loadScene("GameScene");
|
||||
// })
|
||||
// .start();
|
||||
}
|
||||
};
|
||||
//创建太阳
|
||||
NewClass.prototype.createSun1 = function () {
|
||||
var _this = this;
|
||||
this.ball_Array = [];
|
||||
this.Pos_Array.push(cc.v2(-250, -216), cc.v2(200, -115), cc.v2(-35, -500));
|
||||
var time1 = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[0].x, this.Pos_Array[0].y);
|
||||
this.ball.opacity = 0;
|
||||
cc.tween(this.ball)
|
||||
.to(time1, { position: this.Pos_Array[0] })
|
||||
.call(function () {
|
||||
_this.createBall(0, 0, 0, false);
|
||||
})
|
||||
.delay(1)
|
||||
.call(function () {
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//清除所有太阳
|
||||
NewClass.prototype.beginClick = function () {
|
||||
for (var i = 0; i < this.ball_Array.length; i++) {
|
||||
this.ball_Array[i].getComponent("Sun").move = false;
|
||||
}
|
||||
};
|
||||
//点击开始游戏,或者点击跳过引导
|
||||
NewClass.prototype.clickBtn = function () {
|
||||
cc.director.loadScene("GameScene");
|
||||
};
|
||||
//点击下一步按钮
|
||||
NewClass.prototype.next = function () {
|
||||
var _this = this;
|
||||
var time = 0.5;
|
||||
|
@ -138,11 +105,10 @@ var NewClass = /** @class */ (function (_super) {
|
|||
.to(time, { opacity: 0 })
|
||||
.call(function () {
|
||||
_this.custom += 1;
|
||||
// if(type != 0) this.custom = 2;
|
||||
if (_this.custom == 2)
|
||||
_this.createSun1();
|
||||
_this.createSun(true);
|
||||
else if (_this.custom == 3)
|
||||
_this.createSun2();
|
||||
_this.createSun(false);
|
||||
else if (_this.custom == 4)
|
||||
_this.begin = true;
|
||||
else if (_this.custom == 5)
|
||||
|
@ -150,33 +116,53 @@ var NewClass = /** @class */ (function (_super) {
|
|||
})
|
||||
.start();
|
||||
};
|
||||
NewClass.prototype.createSun2 = function () {
|
||||
//创建太阳
|
||||
NewClass.prototype.createSun = function (type) {
|
||||
var _this = this;
|
||||
var time2 = this.calculateDistance(this.Pos_Array[0].x, this.Pos_Array[0].y, this.Pos_Array[1].x, this.Pos_Array[1].y);
|
||||
var time3 = this.calculateDistance(this.Pos_Array[1].x, this.Pos_Array[1].y, this.Pos_Array[2].x, this.Pos_Array[2].y);
|
||||
this.ball.opacity = 255;
|
||||
this.createLine(cc.v2(this.ball.x, this.ball.y), cc.v2(this.Pos_Array[1].x, this.Pos_Array[1].y), 0.5);
|
||||
cc.tween(this.ball)
|
||||
.to(time2, { position: this.Pos_Array[1] })
|
||||
.call(function () {
|
||||
_this.createBall(1, 0, 0, false);
|
||||
})
|
||||
.delay(0.5)
|
||||
.call(function () {
|
||||
_this.createLine(cc.v2(_this.ball.x, _this.ball.y), cc.v2(_this.Pos_Array[2].x, _this.Pos_Array[2].y), 0.5);
|
||||
})
|
||||
.to(time3, { position: this.Pos_Array[2] })
|
||||
.call(function () {
|
||||
_this.createBall(2, 0, 0, false);
|
||||
_this.ball.opacity = 0;
|
||||
})
|
||||
.delay(0.2)
|
||||
.call(function () {
|
||||
_this.destroyLine();
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
if (type == true) {
|
||||
this.ball_Array = [];
|
||||
this.Pos_Array.push(cc.v2(-250, -216), cc.v2(200, -115), cc.v2(-35, -500));
|
||||
var time1 = this.calculateDistance(this.ball.x, this.ball.y, this.Pos_Array[0].x, this.Pos_Array[0].y);
|
||||
this.ball.opacity = 0;
|
||||
cc.tween(this.ball)
|
||||
.to(time1, { position: this.Pos_Array[0] })
|
||||
.call(function () {
|
||||
_this.createBall(0, 0, 0, false);
|
||||
})
|
||||
.delay(1)
|
||||
.call(function () {
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
else {
|
||||
var time2 = this.calculateDistance(this.Pos_Array[0].x, this.Pos_Array[0].y, this.Pos_Array[1].x, this.Pos_Array[1].y);
|
||||
var time3 = this.calculateDistance(this.Pos_Array[1].x, this.Pos_Array[1].y, this.Pos_Array[2].x, this.Pos_Array[2].y);
|
||||
this.ball.opacity = 255;
|
||||
this.createLine(cc.v2(this.ball.x, this.ball.y), cc.v2(this.Pos_Array[1].x, this.Pos_Array[1].y), 0.5);
|
||||
cc.tween(this.ball)
|
||||
.to(time2, { position: this.Pos_Array[1] })
|
||||
.call(function () {
|
||||
_this.createBall(1, 0, 0, false);
|
||||
})
|
||||
.delay(0.5)
|
||||
.call(function () {
|
||||
_this.createLine(cc.v2(_this.ball.x, _this.ball.y), cc.v2(_this.Pos_Array[2].x, _this.Pos_Array[2].y), 0.5);
|
||||
})
|
||||
.to(time3, { position: this.Pos_Array[2] })
|
||||
.call(function () {
|
||||
_this.createBall(2, 0, 0, false);
|
||||
_this.ball.opacity = 0;
|
||||
})
|
||||
.delay(0.2)
|
||||
.call(function () {
|
||||
_this.destroyLine();
|
||||
_this.startGuide(0);
|
||||
})
|
||||
.start();
|
||||
}
|
||||
};
|
||||
//创建太阳
|
||||
NewClass.prototype.createBall = function (number, color, speed, repeat) {
|
||||
var ball = null;
|
||||
ball = cc.instantiate(this.qiu1);
|
||||
|
@ -187,6 +173,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
ball.getComponent("Sun").move = true;
|
||||
this.ball_Array.push(ball);
|
||||
};
|
||||
//获取两点之间角度创建连线用
|
||||
NewClass.prototype.calculateDistance = function (x1, y1, x2, y2) {
|
||||
var dx = x2 - x1;
|
||||
var dy = y2 - y1;
|
||||
|
@ -196,42 +183,53 @@ var NewClass = /** @class */ (function (_super) {
|
|||
var time = distance / 800 * 0.8;
|
||||
return time;
|
||||
};
|
||||
//移动创建下一个太阳
|
||||
NewClass.prototype.moveSun = function () {
|
||||
};
|
||||
//获胜
|
||||
//引导成功
|
||||
NewClass.prototype.passLevel = function () {
|
||||
var _this = this;
|
||||
this.destroyLine();
|
||||
var timeArray = [];
|
||||
var timeCount = 0;
|
||||
var ball = this.ball_Array[0];
|
||||
for (var i = 1; i < this.ball_Array.length; i++) {
|
||||
var time = this.calculateDistance(this.ball_Array[i].x, this.ball_Array[i].y, this.ball_Array[i - 1].x, this.ball_Array[i - 1].y);
|
||||
timeArray.push(time);
|
||||
}
|
||||
var _loop_1 = function (k) {
|
||||
var win = this.node.getChildByName("Win");
|
||||
win.active = true;
|
||||
win.setScale(0);
|
||||
cc.tween(win)
|
||||
.delay(0.4)
|
||||
.to(0.01, { scale: 2.5 })
|
||||
.to(0.35, { scale: 1 })
|
||||
.delay(0.6)
|
||||
.call(function () {
|
||||
win.active = false;
|
||||
setTimeout(function () {
|
||||
cc.tween(ball)
|
||||
.to(timeArray[k - 1], { x: _this.ball_Array[k].x, y: _this.ball_Array[k].y })
|
||||
.call(function () {
|
||||
_this.ball_Array[k].active = false;
|
||||
if (k == _this.ball_Array.length - 1) {
|
||||
setTimeout(function () {
|
||||
_this.ball.opacity = 255;
|
||||
_this.ball.position = cc.v3(ball.x, ball.y, 0);
|
||||
_this.ball.active = false;
|
||||
_this.startGuide(0);
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, timeCount * 1000);
|
||||
timeCount += (timeArray[k - 1] + 0.1);
|
||||
};
|
||||
for (var k = 1; k < this.ball_Array.length; k++) {
|
||||
_loop_1(k);
|
||||
}
|
||||
_this.destroyLine();
|
||||
var timeArray = [];
|
||||
var timeCount = 0;
|
||||
var ball = _this.ball_Array[0];
|
||||
for (var i = 1; i < _this.ball_Array.length; i++) {
|
||||
var time = _this.calculateDistance(_this.ball_Array[i].x, _this.ball_Array[i].y, _this.ball_Array[i - 1].x, _this.ball_Array[i - 1].y);
|
||||
timeArray.push(time);
|
||||
}
|
||||
var _loop_1 = function (k) {
|
||||
setTimeout(function () {
|
||||
cc.tween(ball)
|
||||
.to(timeArray[k - 1], { x: _this.ball_Array[k].x, y: _this.ball_Array[k].y })
|
||||
.call(function () {
|
||||
_this.ball_Array[k].active = false;
|
||||
if (k == _this.ball_Array.length - 1) {
|
||||
setTimeout(function () {
|
||||
_this.ball.opacity = 255;
|
||||
_this.ball.position = cc.v3(ball.x, ball.y, 0);
|
||||
_this.ball.active = false;
|
||||
_this.startGuide(0);
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}, timeCount * 1000);
|
||||
timeCount += (timeArray[k - 1] + 0.1);
|
||||
};
|
||||
for (var k = 1; k < _this.ball_Array.length; k++) {
|
||||
_loop_1(k);
|
||||
}
|
||||
}, 400);
|
||||
})
|
||||
.start();
|
||||
};
|
||||
//点击太阳执行方法
|
||||
NewClass.prototype.clickSun = function (data) {
|
||||
|
@ -249,42 +247,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
_this.ball_Array[_this.clickNow - 1].getChildByName("guang").active = false;
|
||||
}, 200);
|
||||
if (this.clickNow == 3) {
|
||||
var win_1 = this.node.getChildByName("Win");
|
||||
win_1.active = true;
|
||||
win_1.setScale(0);
|
||||
cc.tween(win_1)
|
||||
.delay(0.4)
|
||||
.to(0.01, { scale: 2.5 })
|
||||
.to(0.35, { scale: 1 })
|
||||
.delay(0.6)
|
||||
.call(function () {
|
||||
win_1.active = false;
|
||||
setTimeout(function () {
|
||||
_this.passLevel();
|
||||
}, 400);
|
||||
})
|
||||
.start();
|
||||
this.passLevel();
|
||||
}
|
||||
}
|
||||
else {
|
||||
GameData_1.default._instance.AudioManager.playWarning();
|
||||
this.begin = false;
|
||||
this.loseLevel(1);
|
||||
var over = this.node.getChildByName("Over");
|
||||
cc.tween(over)
|
||||
.to(0.25, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.2, { opacity: 0 })
|
||||
.delay(0.1)
|
||||
.to(0.15, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.start();
|
||||
this.loseLevel();
|
||||
}
|
||||
}
|
||||
};
|
||||
NewClass.prototype.loseLevel = function (type) {
|
||||
//失败事件
|
||||
NewClass.prototype.loseLevel = function () {
|
||||
var _this = this;
|
||||
this.begin = false;
|
||||
GameData_1.default._instance.AudioManager.playWarning();
|
||||
this.destroyLine();
|
||||
var ball = this.ball_Array[0];
|
||||
var _loop_2 = function (k) {
|
||||
|
@ -306,7 +281,19 @@ var NewClass = /** @class */ (function (_super) {
|
|||
for (var k = 1; k < this.ball_Array.length; k++) {
|
||||
_loop_2(k);
|
||||
}
|
||||
//结束页面动画
|
||||
var over = this.node.getChildByName("Over");
|
||||
cc.tween(over)
|
||||
.to(0.25, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.2, { opacity: 0 })
|
||||
.delay(0.1)
|
||||
.to(0.15, { opacity: 255 })
|
||||
.delay(0.1)
|
||||
.to(0.1, { opacity: 0 })
|
||||
.start();
|
||||
};
|
||||
//点击太阳事件
|
||||
NewClass.prototype.clearSun = function () {
|
||||
for (var k = 0; k < this.ball_Array.length; k++) {
|
||||
this.ball_Array[k].removeFromParent();
|
||||
|
@ -319,15 +306,7 @@ var NewClass = /** @class */ (function (_super) {
|
|||
var timestamp = new Date().getTime();
|
||||
return timestamp;
|
||||
};
|
||||
NewClass.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
//创造连线,参数起点,终点,连线时间
|
||||
NewClass.prototype.createLine = function (start, end, time) {
|
||||
var line = cc.instantiate(this.linePrefab);
|
||||
line.parent = this.node.getChildByName("Line");
|
||||
|
@ -342,6 +321,17 @@ var NewClass = /** @class */ (function (_super) {
|
|||
.to(time, { fillRange: 1 })
|
||||
.start();
|
||||
};
|
||||
//摧毁连线
|
||||
NewClass.prototype.destroyLine = function () {
|
||||
for (var i = 0; i < this.node.getChildByName("Line").children.length; i++) {
|
||||
if (this.node.getChildByName("Line").children[i]) {
|
||||
this.node.getChildByName("Line").children[i].removeFromParent();
|
||||
this.node.getChildByName("Line").children[i] = null;
|
||||
}
|
||||
}
|
||||
this.node.getChildByName("Line").removeAllChildren();
|
||||
};
|
||||
//获取两个点之间的角度 用于写连线 确定连线方向
|
||||
NewClass.prototype.calculateAngle = function (x1, y1, x2, y2) {
|
||||
var angle = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI - 90;
|
||||
return -angle;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -23,45 +23,37 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Learn TypeScript:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||||
// Learn Attribute:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||||
// Learn life-cycle callbacks:
|
||||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
|
||||
var GameData_1 = require("./GameData");
|
||||
var Storage_1 = require("./Storage");
|
||||
// import {StorageMessage} from "./StorageMessage";
|
||||
// import { apiSign } from "./crypto/sign";
|
||||
var NewClass = /** @class */ (function (_super) {
|
||||
__extends(NewClass, _super);
|
||||
function NewClass() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.label = null;
|
||||
_this.text = 'hello';
|
||||
return _this;
|
||||
// update (dt) {}
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
NewClass.prototype.start = function () {
|
||||
this.Authentication();
|
||||
};
|
||||
//鉴权,判断有无缓存userid,有的话判断是否过期,没有的话重新获取userid 并且缓存上
|
||||
NewClass.prototype.Authentication = function () {
|
||||
var userId = Storage_1.StorageMessage.getStorage("user");
|
||||
if (userId == "undifend" || userId == null) {
|
||||
this.setId();
|
||||
if (userId == "undifend" || userId == null || userId == "") {
|
||||
this.setUserId();
|
||||
}
|
||||
else {
|
||||
var data = Storage_1.StorageMessage.getStorage("user");
|
||||
data = this.getId(data);
|
||||
data = this.getUserId(data);
|
||||
var timestamp = parseInt(new Date().getTime() / 1000 + "");
|
||||
if ((timestamp - data[2]) > 86400) {
|
||||
this.setId();
|
||||
this.setUserId();
|
||||
return;
|
||||
}
|
||||
GameData_1.default._instance.GM_INFO.userId = data[1];
|
||||
GameData_1.default._instance.GM_INFO.userId = parseInt(GameData_1.default._instance.GM_INFO.userId);
|
||||
GameData_1.default._instance.GM_INFO.userId = parseInt(data[1]);
|
||||
}
|
||||
};
|
||||
NewClass.prototype.setId = function () {
|
||||
GameData_1.default._instance.GM_INFO.userId = this.getUserId();
|
||||
//设置userId,链接有获取,没有跳转授权
|
||||
NewClass.prototype.setUserId = function () {
|
||||
GameData_1.default._instance.GM_INFO.userId = this.getUserId(null);
|
||||
if (GameData_1.default._instance.GM_INFO.userId == null) {
|
||||
var url = "http://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
|
||||
window.location.href = url;
|
||||
|
@ -74,77 +66,36 @@ var NewClass = /** @class */ (function (_super) {
|
|||
GameData_1.default._instance.GM_INFO.userId = parseInt(GameData_1.default._instance.GM_INFO.userId);
|
||||
}
|
||||
};
|
||||
NewClass.prototype.createTexture = function () {
|
||||
var _this = this;
|
||||
var url = "http://static.sparkus.cn/shoot-sun/assets/resources/native/7a/7a8b41ad-9425-44e2-8f55-7740f12b0e0a.jpg";
|
||||
cc.assetManager.loadRemote(url, function (err, texture) {
|
||||
console.log(err, texture);
|
||||
if (texture) {
|
||||
var sprite = _this.node.getChildByName("icon").getComponent(cc.Sprite);
|
||||
sprite.spriteFrame = new cc.SpriteFrame(texture);
|
||||
}
|
||||
});
|
||||
};
|
||||
NewClass.prototype.getUserId = function () {
|
||||
//获取user id 有参数为获取gameid userid 时间戳, 无参数为只获取链接尾缀上的userId
|
||||
NewClass.prototype.getUserId = function (str) {
|
||||
var pathStr = window.location.search;
|
||||
var arr = pathStr.split("&");
|
||||
if (str != null)
|
||||
arr = pathStr.split("?");
|
||||
if (pathStr.length >= 0 && arr.length > 0) {
|
||||
var arr2_1 = [];
|
||||
arr.map(function (item) {
|
||||
arr2_1.push(item.split("=")[1]);
|
||||
});
|
||||
// GameData._instance.GM_INFO.userId = arr2[0] + "";
|
||||
return arr2_1[0];
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
NewClass.prototype.getId = function (str) {
|
||||
var pathStr = str;
|
||||
var arr = pathStr.split("?");
|
||||
if (pathStr.length >= 0 && arr.length > 0) {
|
||||
var arr2_2 = [];
|
||||
arr.map(function (item) {
|
||||
arr2_2.push(item.split("=")[1]);
|
||||
});
|
||||
// GameData._instance.GM_INFO.userId = arr2[1] + "";
|
||||
return arr2_2;
|
||||
return str == null ? arr2_1[0] : arr2_1;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
//开始游戏,跳转至引导页面
|
||||
NewClass.prototype.startGame = function () {
|
||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
||||
cc.director.loadScene("GuideScene");
|
||||
};
|
||||
//备用,用来测试跳转 指定关卡
|
||||
NewClass.prototype.clickBtn = function (event, data) {
|
||||
GameData_1.default._instance.GM_INFO.custom = parseInt(data);
|
||||
cc.director.loadScene("GameScene");
|
||||
};
|
||||
NewClass.prototype.openLevel = function () {
|
||||
this.node.getChildByName("Level").active = true;
|
||||
};
|
||||
NewClass.prototype.closeBtn = function () {
|
||||
this.node.getChildByName("Level").active = false;
|
||||
};
|
||||
NewClass.prototype.back = function (data) {
|
||||
// debugger;
|
||||
};
|
||||
NewClass.prototype.openBtn = function () {
|
||||
GameData_1.default._instance.GM_INFO.custom = 0;
|
||||
cc.director.loadScene("GuideScene");
|
||||
};
|
||||
//打开排行榜
|
||||
NewClass.prototype.openRank = function () {
|
||||
cc.director.loadScene("RankScene");
|
||||
};
|
||||
__decorate([
|
||||
property(cc.Label)
|
||||
], NewClass.prototype, "label", void 0);
|
||||
__decorate([
|
||||
property
|
||||
], NewClass.prototype, "text", void 0);
|
||||
NewClass = __decorate([
|
||||
ccclass
|
||||
], NewClass);
|
||||
|
|
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user