208 lines
6.5 KiB
JavaScript
208 lines
6.5 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'f2f0bI5PsVI+o18xF6G+KVa', 'GameData');
|
|
// Script/GameData.ts
|
|
|
|
"use strict";
|
|
var __extends = (this && this.__extends) || (function () {
|
|
var extendStatics = function (d, b) {
|
|
extendStatics = Object.setPrototypeOf ||
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
return extendStatics(d, b);
|
|
};
|
|
return function (d, b) {
|
|
extendStatics(d, b);
|
|
function __() { this.constructor = d; }
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
};
|
|
})();
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
|
|
var GameData = /** @class */ (function (_super) {
|
|
__extends(GameData, _super);
|
|
function GameData() {
|
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
}
|
|
GameData_1 = GameData;
|
|
// 0.15 0.37 0.8 获得三个星星 -2167.675 -2054 两个尺寸的屏幕的补偿值
|
|
GameData.prototype.onLoad = function () {
|
|
if (GameData_1._instance == null) {
|
|
GameData_1._instance = this;
|
|
// cc.game.addPersistRootNode(this.node);
|
|
this.AudioManager = this.node.getComponent('BallAudioManager');
|
|
}
|
|
else {
|
|
this.node.destroy();
|
|
return;
|
|
}
|
|
};
|
|
GameData.prototype.start = function () {
|
|
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
|
|
this.GAME_DATA = [];
|
|
this.GM_INFO_init(); //GM_INFO存储 一些游戏数据,这些数据至少是当局内不会重置清零的
|
|
this.LEVEL_init(); //每局游戏内游戏参数,可复活清零或者重玩清零
|
|
this.BLOCK_INFO_init(); //每个游戏不同,此游戏为跳板参数
|
|
this.CLICK_init(); //埋点数据,用于上传重要数据
|
|
};
|
|
GameData.prototype.GM_INFO_init = function () {
|
|
this.GM_INFO = {
|
|
// isEnd: false,
|
|
mean_Time: 0,
|
|
total: 0,
|
|
currSeed: 203213,
|
|
gameId: '100001',
|
|
userId: "",
|
|
guide: true,
|
|
url: "https://dev.api.sparkus.cn",
|
|
custom: 0,
|
|
//从这开始
|
|
jumpUpTime: 0.5,
|
|
jumpDownTime: 0.4,
|
|
jumpHeight: 150,
|
|
blockMin: 30,
|
|
blockMax: -10,
|
|
blockScale: 5,
|
|
distanceMin: 100,
|
|
distanceMax: 110,
|
|
life: 3,
|
|
levelMax: 1,
|
|
difficultyMax: 1,
|
|
score: 0,
|
|
success: true,
|
|
probation: true,
|
|
afkCount: 0,
|
|
isAFK: false //是否挂机
|
|
};
|
|
};
|
|
GameData.prototype.CLICK_init = function () {
|
|
GameData_1._instance.CLICK_DATA =
|
|
{
|
|
type: 1,
|
|
level: 0,
|
|
block: 0,
|
|
percent: 0,
|
|
getScore: 0,
|
|
totalScore: 0,
|
|
difficulty: 0,
|
|
height: false,
|
|
combo: 0,
|
|
accuracy: 0,
|
|
jumps: 0,
|
|
timer: 0,
|
|
fake: false,
|
|
fakeSpeed: 0,
|
|
speed: 0,
|
|
round: 0,
|
|
isAFK: false //是否挂机
|
|
};
|
|
};
|
|
GameData.prototype.LEVEL_init = function () {
|
|
this.LEVEL_INFO =
|
|
{
|
|
speed: 1,
|
|
addSpeed: 0.015,
|
|
reduceSpeed: 0,
|
|
jiansu: 3,
|
|
round1: 10,
|
|
round2: 20,
|
|
round3: 30,
|
|
doubleSuccess: 3,
|
|
fastSpeed: 3.5,
|
|
slowSpeed: 4.5,
|
|
doubleHit: 1,
|
|
doubleAdd: 0.05,
|
|
doubleMax: 2,
|
|
layer: 100,
|
|
layerAdd: 2,
|
|
star1: 0.2,
|
|
star2: 0.4,
|
|
star3: 0.8,
|
|
scoreMax: 120000,
|
|
levelMax: 1,
|
|
difficultyMax: 1 //最高难度系数
|
|
};
|
|
};
|
|
GameData.prototype.BLOCK_INFO_init = function () {
|
|
this.BLOCK_INFO = [
|
|
{
|
|
name: "block1",
|
|
speed: 8,
|
|
thickness: false,
|
|
},
|
|
{
|
|
name: "block2",
|
|
speed: 9,
|
|
thickness: false,
|
|
},
|
|
{
|
|
name: "block3",
|
|
speed: 8,
|
|
thickness: false,
|
|
},
|
|
{
|
|
name: "block4",
|
|
speed: 9,
|
|
thickness: false,
|
|
},
|
|
{
|
|
name: "block5",
|
|
speed: 8,
|
|
thickness: false,
|
|
},
|
|
{
|
|
name: "block6",
|
|
speed: 8,
|
|
thickness: false,
|
|
},
|
|
{
|
|
name: "block7",
|
|
speed: 10,
|
|
thickness: true,
|
|
},
|
|
{
|
|
name: "block8",
|
|
speed: 10,
|
|
thickness: true,
|
|
},
|
|
{
|
|
name: "block9",
|
|
speed: 10,
|
|
thickness: true,
|
|
},
|
|
{
|
|
name: "block10",
|
|
speed: 10,
|
|
thickness: true,
|
|
},
|
|
{
|
|
name: "block11",
|
|
speed: 10,
|
|
thickness: true,
|
|
},
|
|
{
|
|
name: "block12",
|
|
speed: 10,
|
|
thickness: true,
|
|
},
|
|
{
|
|
name: "block0",
|
|
speed: 14,
|
|
thickness: false,
|
|
},
|
|
];
|
|
};
|
|
var GameData_1;
|
|
GameData = GameData_1 = __decorate([
|
|
ccclass
|
|
], GameData);
|
|
return GameData;
|
|
}(cc.Component));
|
|
exports.default = GameData;
|
|
|
|
cc._RF.pop(); |