"use strict"; cc._RF.push(module, 'dd28di+k5ZMPKxLRb2fb7ea', 'Global'); // Script/Global.ts "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Global = /** @class */ (function () { function Global() { this.StartNode = null; /** * 主场景节点 */ this.MainNode = null; /** * 落脚点碰撞标志,默认未碰撞,false */ this.CollisionFlag = false; /** * 顶碰撞标准,默认未碰撞,false */ this.CollisionWithDing = false; /** * 落脚点碰撞标签 */ this.KIND_FootHold = 0; /** * player初始下落速度,8.5px/帧 */ this.InitSpeed = 0; this.ConstInitSpeed = 8.5; //6.5最佳 /** * player移动速度,1px/帧 */ this.moveSpeed = 10; /** * 落脚点移动速度 */ this.FHFallSpeed = 2; /** * 剩余命数 */ this.reLife = new Array(); /** * 受到伤害标志 */ this.Injured = false; /** * 失败标志 */ this.OverFlag = false; /** * 等级增加标志位,0表示未增加,当前为1级 */ this.LevelAddFlag = 1; /** * 本地分数存储 */ this.LocalScore = { BestScore: 0, SecondScore: 0, ThirdScore: 0, CurrentScore: 0, length: 3, }; /** * 远程分数存储 */ this.remoteScore = new Array(); /** * 网络连接标志位 */ this.NetStatus = false; /** * stop Animations falg; */ this.AniFalg = false; /** * info */ this.USERINFO = { userId: "", uTim: Number, score: 0, }; /** * player排行 */ this.MyRank = null; this.LorR = 0; //0 for right } ; /** * return the local score */ Global.prototype.getLocalScore = function () { return this.LocalScore; }; /** * return the remote score */ Global.prototype.getRemoteScore = function () { return this.remoteScore; }; Global.prototype.setRemoteScore = function (score) { this.remoteScore = score; }; /** * 开始场景节点获取 */ Global.prototype.getSN = function () { return this.StartNode; }; /** * * @param sn 开始场景节点 */ Global.prototype.setSN = function (sn) { this.StartNode = sn; }; /** * 主场景节点获取 */ Global.prototype.getMN = function () { return this.MainNode; }; /** * * @param mn 主场景节点 */ Global.prototype.setMN = function (mn) { this.MainNode = mn; }; /** * 获取玩家信息 */ Global.prototype.GetUSer = function () { return this.USERINFO; }; /** * 设置玩家信息 * @param user 玩家 */ Global.prototype.SetUser = function (user) { this.USERINFO = user; }; /** * 获取个人排行 */ Global.prototype.GetR = function () { return this.MyRank; }; /** * 设置个人排行 * @param r 排行 */ Global.prototype.SetR = function (r) { this.MyRank = r; }; /** * 获取排行分数 */ Global.prototype.GetS = function () { return this.remoteScore; }; /** * 设置排行分数 * @param s 分数 */ Global.prototype.SetS = function (s) { this.remoteScore = s; }; Global.instance = new Global(); //全局下不可少 return Global; }()); exports.default = Global; /** * 这里应当添加当前局分数存储, * 只需要游戏最高分 * 从服务器获取的分数也是先与本地分数对比,交换, * 拿到最高分,上传; * 之后刷新排行榜 */ cc._RF.pop();