dd28d8be-9396-4c3c-ac4b-45bd9f6fb79a.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. "use strict";
  2. cc._RF.push(module, 'dd28di+k5ZMPKxLRb2fb7ea', 'Global');
  3. // Script/Global.ts
  4. "use strict";
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. var Global = /** @class */ (function () {
  7. function Global() {
  8. this.StartNode = null;
  9. /**
  10. * 主场景节点
  11. */
  12. this.MainNode = null;
  13. /**
  14. * 落脚点碰撞标志,默认未碰撞,false
  15. */
  16. this.CollisionFlag = false;
  17. /**
  18. * 顶碰撞标准,默认未碰撞,false
  19. */
  20. this.CollisionWithDing = false;
  21. /**
  22. * 落脚点碰撞标签
  23. */
  24. this.KIND_FootHold = 0;
  25. /**
  26. * player初始下落速度,8.5px/帧
  27. */
  28. this.InitSpeed = 0;
  29. this.ConstInitSpeed = 8.5; //6.5最佳
  30. /**
  31. * player移动速度,1px/帧
  32. */
  33. this.moveSpeed = 10;
  34. /**
  35. * 落脚点移动速度
  36. */
  37. this.FHFallSpeed = 2;
  38. /**
  39. * 剩余命数
  40. */
  41. this.reLife = new Array();
  42. /**
  43. * 受到伤害标志
  44. */
  45. this.Injured = false;
  46. /**
  47. * 失败标志
  48. */
  49. this.OverFlag = false;
  50. /**
  51. * 等级增加标志位,0表示未增加,当前为1级
  52. */
  53. this.LevelAddFlag = 1;
  54. /**
  55. * 本地分数存储
  56. */
  57. this.LocalScore = {
  58. BestScore: 0,
  59. SecondScore: 0,
  60. ThirdScore: 0,
  61. CurrentScore: 0,
  62. length: 3,
  63. };
  64. /**
  65. * 远程分数存储
  66. */
  67. this.remoteScore = new Array();
  68. /**
  69. * 网络连接标志位
  70. */
  71. this.NetStatus = false;
  72. /**
  73. * stop Animations falg;
  74. */
  75. this.AniFalg = false;
  76. /**
  77. * info
  78. */
  79. this.USERINFO = {
  80. userId: "",
  81. uTim: Number,
  82. score: 0,
  83. };
  84. /**
  85. * player排行
  86. */
  87. this.MyRank = null;
  88. this.LorR = 0; //0 for right
  89. }
  90. ;
  91. /**
  92. * return the local score
  93. */
  94. Global.prototype.getLocalScore = function () {
  95. return this.LocalScore;
  96. };
  97. /**
  98. * return the remote score
  99. */
  100. Global.prototype.getRemoteScore = function () {
  101. return this.remoteScore;
  102. };
  103. Global.prototype.setRemoteScore = function (score) {
  104. this.remoteScore = score;
  105. };
  106. /**
  107. * 开始场景节点获取
  108. */
  109. Global.prototype.getSN = function () {
  110. return this.StartNode;
  111. };
  112. /**
  113. *
  114. * @param sn 开始场景节点
  115. */
  116. Global.prototype.setSN = function (sn) {
  117. this.StartNode = sn;
  118. };
  119. /**
  120. * 主场景节点获取
  121. */
  122. Global.prototype.getMN = function () {
  123. return this.MainNode;
  124. };
  125. /**
  126. *
  127. * @param mn 主场景节点
  128. */
  129. Global.prototype.setMN = function (mn) {
  130. this.MainNode = mn;
  131. };
  132. /**
  133. * 获取玩家信息
  134. */
  135. Global.prototype.GetUSer = function () {
  136. return this.USERINFO;
  137. };
  138. /**
  139. * 设置玩家信息
  140. * @param user 玩家
  141. */
  142. Global.prototype.SetUser = function (user) {
  143. this.USERINFO = user;
  144. };
  145. /**
  146. * 获取个人排行
  147. */
  148. Global.prototype.GetR = function () {
  149. return this.MyRank;
  150. };
  151. /**
  152. * 设置个人排行
  153. * @param r 排行
  154. */
  155. Global.prototype.SetR = function (r) {
  156. this.MyRank = r;
  157. };
  158. /**
  159. * 获取排行分数
  160. */
  161. Global.prototype.GetS = function () {
  162. return this.remoteScore;
  163. };
  164. /**
  165. * 设置排行分数
  166. * @param s 分数
  167. */
  168. Global.prototype.SetS = function (s) {
  169. this.remoteScore = s;
  170. };
  171. Global.instance = new Global(); //全局下不可少
  172. return Global;
  173. }());
  174. exports.default = Global;
  175. /**
  176. * 这里应当添加当前局分数存储,
  177. * 只需要游戏最高分
  178. * 从服务器获取的分数也是先与本地分数对比,交换,
  179. * 拿到最高分,上传;
  180. * 之后刷新排行榜
  181. */
  182. cc._RF.pop();