72605d56-81ac-477a-9fc6-d48d39956e27.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. "use strict";
  2. cc._RF.push(module, '726051WgaxHep/G1I05lW4n', 'MainScene');
  3. // Script/MainScene.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  19. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  21. 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;
  22. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23. };
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. var Global_1 = require("./Global");
  26. var MessManager_1 = require("./MessManager");
  27. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  28. var MainScene = /** @class */ (function (_super) {
  29. __extends(MainScene, _super);
  30. function MainScene() {
  31. var _this = _super !== null && _super.apply(this, arguments) || this;
  32. _this.boli = null;
  33. _this.dici = null;
  34. _this.lvdai = null;
  35. _this.shandian = null;
  36. _this.tanhuang = null;
  37. _this.Opplvdai = null;
  38. _this.GD = null;
  39. _this.failure = null;
  40. _this.fuhuo = null;
  41. _this.Player = null;
  42. _this.FHolderNode = null;
  43. _this.Bg = null;
  44. _this.LifeDing = null;
  45. _this.LEFT = null;
  46. _this.RIGHT = null;
  47. _this.output = null;
  48. // LIFE-CYCLE CALLBACKS:
  49. /**
  50. * 上一个落脚点生成时间
  51. */
  52. _this.STime = 0;
  53. /**
  54. * 当前落脚点生成时间
  55. */
  56. _this.ETime = 0;
  57. /** Left*/
  58. _this.LkeyDown = false;
  59. /** Right*/
  60. _this.RkeyDown = false;
  61. /**the loght FootHolder F */
  62. _this.lightF = false;
  63. _this.moveFalg = "";
  64. _this.USERINFO = {
  65. userId: "",
  66. score: 0,
  67. };
  68. _this.fuhuoCount = 1;
  69. _this.once = false;
  70. return _this;
  71. }
  72. MainScene.prototype.onKeyDown = function (event) {
  73. if (event.keyCode == cc.macro.KEY.w) {
  74. console.error(1231);
  75. }
  76. };
  77. MainScene.prototype.onLoad = function () {
  78. cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this.onKeyDown, this);
  79. MessManager_1.default.getInstance().initData();
  80. var time = cc.sys.localStorage.getItem("hfsj");
  81. if (time == null || time == undefined || time == "") {
  82. cc.sys.localStorage.setItem("hfsj", "99");
  83. }
  84. this.LifeDing.zIndex = 10;
  85. this.FHolderNode.zIndex = 9;
  86. Global_1.default.instance.setMN(this.node);
  87. this.STime = Date.now();
  88. var FHolder = cc.instantiate(this.GD);
  89. this.FHolderNode.addChild(FHolder, 10, "GD");
  90. FHolder.getComponent("GD").init(this, 1);
  91. FHolder.getComponent("GD").First = true;
  92. FHolder.y = -100;
  93. var FHolder2 = cc.instantiate(this.lvdai);
  94. this.FHolderNode.addChild(FHolder2, 10, "lvdai");
  95. FHolder2.getComponent("lvdai").init(this);
  96. FHolder2.y = -300;
  97. // let FHolder2 = cc.instantiate(this.dici);
  98. // this.FHolderNode.addChild(FHolder2, 10, "dici");
  99. // FHolder2.getComponent("dici").init(this);
  100. // FHolder2.y = -300;
  101. // let FHolder2 = cc.instantiate(this.tanhuang);
  102. // this.FHolderNode.addChild(FHolder2,10,"tanhuang");
  103. // FHolder2.getComponent("tanhuang").init(this);
  104. // FHolder2.y = -300;
  105. var FHolder3 = cc.instantiate(this.GD);
  106. this.FHolderNode.addChild(FHolder3, 10, "GD");
  107. FHolder3.getComponent("GD").init(this, 1);
  108. FHolder3.y = -450;
  109. // this.Player.active = false;
  110. this.Player.x = 0;
  111. // this.Player.y = FHolder.y+60;
  112. this.Player.zIndex = 11;
  113. for (var i = 0; i < this.LifeDing.children.length; i++) {
  114. if (this.LifeDing.children[i].name == "lifeBG") {
  115. if (!this.LifeDing.children[i].active) {
  116. this.LifeDing.children[i].active = true;
  117. }
  118. Global_1.default.instance.reLife.push(this.LifeDing.children[i]);
  119. }
  120. }
  121. cc.director.getCollisionManager().enabled = true;
  122. // cc.director.getCollisionManager().enabledDebugDraw = true;
  123. cc.director.getCollisionManager().enabledDrawBoundingBox = false;
  124. };
  125. MainScene.prototype.playtansound = function () {
  126. if (Global_1.default.instance.OverFlag == false) {
  127. cc.loader.loadRes("tan", cc.AudioClip, function (err, clip) {
  128. var audioID = cc.audioEngine.play(clip, false, 0.5);
  129. });
  130. }
  131. };
  132. MainScene.prototype.playdeadsound = function () {
  133. cc.loader.loadRes("dead", cc.AudioClip, function (err, clip) {
  134. var audioID = cc.audioEngine.play(clip, false, 0.5);
  135. });
  136. };
  137. MainScene.prototype.start = function () {
  138. };
  139. MainScene.prototype.update = function (dt) {
  140. // console.log(Global.instance.CollisionFlag);
  141. this.MoveBg();
  142. Global_1.default.instance.moveSpeed = 1;
  143. var FHolder;
  144. if ((this.ETime - this.STime) > (1200 - (180 * (Global_1.default.instance.FHFallSpeed - 2)))) { //控制落脚点之间的间距,间距144px
  145. this.STime = Date.now();
  146. if (!Global_1.default.instance.OverFlag) {
  147. FHolder = this.FootHoldGenerator(null);
  148. // this.Score();
  149. }
  150. }
  151. this.FHolder();
  152. this.reduceLife();
  153. if (Global_1.default.instance.CollisionFlag) { //左右传送带减速
  154. switch (Global_1.default.instance.KIND_FootHold) {
  155. case 3: {
  156. this.Player.x += 2;
  157. break;
  158. }
  159. case 4: {
  160. this.Player.x -= 2;
  161. break;
  162. }
  163. case 7: {
  164. if (Global_1.default.instance.LorR == 1) {
  165. this.Player.x--;
  166. }
  167. else {
  168. this.Player.x++;
  169. }
  170. break;
  171. }
  172. default: {
  173. break;
  174. }
  175. }
  176. }
  177. if (this.Player.x < -180) {
  178. this.Player.x = -180;
  179. }
  180. if (this.Player.x > 180) {
  181. this.Player.x = 180;
  182. }
  183. if (this.Player.y < (-560)) {
  184. this.Player.getComponent(cc.BoxCollider).enabled = false;
  185. this.pretreatmentGameover();
  186. }
  187. if (Global_1.default.instance.reLife.length == 0) {
  188. this.Player.getComponent(cc.BoxCollider).enabled = false;
  189. this.pretreatmentGameover();
  190. }
  191. this.ETime = Date.now();
  192. // let AllChildren = new Array();
  193. // let GDChildren = new Array();
  194. // AllChildren = this.node.getChildByName("BgNode").getChildByName("FHolder").children;
  195. // for (let i = 0; i < AllChildren.length; i++) {
  196. // if (AllChildren[i].name == "GD") {
  197. // GDChildren.push(AllChildren[i]);
  198. // }
  199. // }
  200. // cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,this.onKeyDown,this);
  201. //cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP,this.onKeyUp,this);
  202. this.Listener();
  203. };
  204. MainScene.prototype.Listener = function () {
  205. var _this = this;
  206. var btnClickArr = new Array(2);
  207. if (!this.LkeyDown) {
  208. this.RIGHT.node.on(cc.Node.EventType.TOUCH_START, this.BtnTurnRight, this);
  209. this.RIGHT.node.on(cc.Node.EventType.TOUCH_MOVE, this.BtnTurnRight, this);
  210. this.RIGHT.node.on(cc.Node.EventType.TOUCH_CANCEL, this.onKeyUp, this);
  211. btnClickArr.push(this.RIGHT);
  212. this.RIGHT.node.on(cc.Node.EventType.TOUCH_END, function () {
  213. _this.onKeyUp;
  214. }, this);
  215. }
  216. else {
  217. this.RIGHT.node.off(cc.Node.EventType.TOUCH_START, this.BtnTurnRight, this);
  218. this.RIGHT.node.off(cc.Node.EventType.TOUCH_MOVE, this.BtnTurnRight, this);
  219. this.RIGHT.node.off(cc.Node.EventType.TOUCH_CANCEL, this.onKeyUp, this);
  220. this.RIGHT.node.off(cc.Node.EventType.TOUCH_END, function () {
  221. _this.onKeyUp;
  222. }, this);
  223. }
  224. if (!this.RkeyDown) {
  225. this.LEFT.node.on(cc.Node.EventType.TOUCH_START, this.BtnTurnLeft, this);
  226. this.LEFT.node.on(cc.Node.EventType.TOUCH_MOVE, this.BtnTurnLeft, this);
  227. this.LEFT.node.on(cc.Node.EventType.TOUCH_CANCEL, this.onKeyUp, this);
  228. // btnClickArr.push(this.LEFT);
  229. this.LEFT.node.on(cc.Node.EventType.TOUCH_END, function () {
  230. _this.onKeyUp;
  231. }, this);
  232. }
  233. else {
  234. this.LEFT.node.off(cc.Node.EventType.TOUCH_START, this.BtnTurnLeft, this);
  235. this.LEFT.node.off(cc.Node.EventType.TOUCH_MOVE, this.BtnTurnLeft, this);
  236. this.LEFT.node.off(cc.Node.EventType.TOUCH_CANCEL, this.onKeyUp, this);
  237. this.LEFT.node.off(cc.Node.EventType.TOUCH_END, function () {
  238. _this.onKeyUp;
  239. }, this);
  240. }
  241. };
  242. MainScene.prototype.StopAni = function (self) {
  243. if (!Global_1.default.instance.AniFalg) {
  244. var FHolder = self.node.getChildByName("BgNode").getChildByName("FHolder").children;
  245. var Fname = void 0;
  246. for (var i = 0; FHolder.length; i++) {
  247. if (i == FHolder.length - 1) {
  248. Global_1.default.instance.AniFalg = true;
  249. return;
  250. }
  251. Fname = FHolder[i].name;
  252. FHolder[i].getComponent(Fname).enabled = false;
  253. }
  254. }
  255. };
  256. /**
  257. * player 移出落脚点
  258. */
  259. MainScene.prototype.FHolder = function () {
  260. var self = this;
  261. var FHArray = this.FHolderNode.children;
  262. var Ani; //the Animation of Player when player fall down
  263. var Anistate; //the state of Ani;
  264. for (var i = FHArray.length - 1; i >= 0; i--) {
  265. if (FHArray[i].isHold) {
  266. if (self.Player.x > (FHArray[i].x + 75)) {
  267. Global_1.default.instance.CollisionFlag = false;
  268. FHArray[i].isHold = false;
  269. }
  270. else if (self.Player.x < (FHArray[i].x - 75)) {
  271. Global_1.default.instance.CollisionFlag = false;
  272. FHArray[i].isHold = false;
  273. }
  274. else {
  275. Global_1.default.instance.CollisionFlag = true;
  276. FHArray[i].isHold = true;
  277. }
  278. }
  279. }
  280. };
  281. /**
  282. * 移动背景,初始移动速度200px/s
  283. */
  284. MainScene.prototype.MoveBg = function () {
  285. var Bg0 = this.Bg.getChildByName("Bg_0");
  286. var Bg1 = this.Bg.getChildByName("Bg_1");
  287. if (Global_1.default.instance.OverFlag) {
  288. }
  289. else {
  290. Bg0.y += Global_1.default.instance.FHFallSpeed + 1;
  291. Bg1.y += Global_1.default.instance.FHFallSpeed + 1;
  292. if (Bg0.y > 946) {
  293. Bg0.y = -946;
  294. }
  295. if (Bg1.y > 946) {
  296. Bg1.y = -946;
  297. }
  298. }
  299. };
  300. /**
  301. * 生成落脚点
  302. */
  303. MainScene.prototype.FootHoldGenerator = function (rtpe) {
  304. var self = this;
  305. var Magnification = 0;
  306. var f = parseInt(self.LifeDing.getChildByName("Floor").getComponent(cc.Label).string);
  307. if (f < 20) {
  308. Magnification = 2;
  309. }
  310. else if (f < 40) {
  311. Magnification = 4;
  312. }
  313. else if (f < 60) {
  314. Magnification = 6;
  315. }
  316. else if (f < 80) {
  317. Magnification = 8;
  318. }
  319. else {
  320. Magnification = 8;
  321. }
  322. var KindHolder = Math.ceil(Math.random() * Magnification);
  323. // KindHolder = 7;
  324. var FHolder;
  325. // KindHolder = Math.ceil(Math.random()*7);
  326. if (KindHolder == 3 || KindHolder == 4) {
  327. var va = Math.random() * 10;
  328. if (va >= 1 && va < 4) {
  329. KindHolder = 7;
  330. }
  331. else if (va >= 4 && va < 10) {
  332. KindHolder = 5;
  333. }
  334. //KindHolder = 5;
  335. console.log("KindHolder gb: " + KindHolder);
  336. }
  337. if (rtpe != null) {
  338. KindHolder = rtpe;
  339. console.log("KindHolder gb2: " + KindHolder);
  340. }
  341. this.ETime = Date.now();
  342. switch (KindHolder) {
  343. case 1: {
  344. FHolder = cc.instantiate(self.GD);
  345. self.FHolderNode.addChild(FHolder, 5, "GD");
  346. FHolder.getComponent("GD").init(self, 1);
  347. FHolder.isHold = false;
  348. // console.log("产生第一种落脚点");
  349. break;
  350. }
  351. case 2: {
  352. FHolder = cc.instantiate(self.GD);
  353. self.FHolderNode.addChild(FHolder, 5, "GD");
  354. FHolder.getComponent("GD").init(self, 7);
  355. FHolder.isHold = false;
  356. break;
  357. }
  358. case 3: {
  359. FHolder = cc.instantiate(self.lvdai);
  360. self.FHolderNode.addChild(FHolder, 5, "lvdai");
  361. FHolder.getComponent("lvdai").init(self);
  362. FHolder.isHold = false;
  363. // console.log("产生第二种落脚点");
  364. console.log(" 创建滚动 ");
  365. break;
  366. }
  367. case 4: {
  368. FHolder = cc.instantiate(self.lvdai);
  369. self.FHolderNode.addChild(FHolder, 5, "lvdai");
  370. FHolder.getComponent("lvdai").init(self);
  371. FHolder.isHold = false;
  372. // console.log("产生第五种落脚点");
  373. console.log(" 创建滚动1 ");
  374. break;
  375. }
  376. case 5: {
  377. FHolder = cc.instantiate(self.boli);
  378. self.FHolderNode.addChild(FHolder, 5, "boli");
  379. FHolder.getComponent("boli").init(self);
  380. FHolder.isHold = false;
  381. // console.log("产生第三种落脚点");
  382. break;
  383. }
  384. case 6: {
  385. FHolder = cc.instantiate(self.dici);
  386. self.FHolderNode.addChild(FHolder, 5, "dici");
  387. FHolder.getComponent("dici").init(self);
  388. FHolder.isHold = false;
  389. // console.log("产生第四种落脚点");
  390. break;
  391. }
  392. case 7: {
  393. // FHolder = cc.instantiate(self.GD);
  394. // self.FHolderNode.addChild(FHolder, 5, "GD");
  395. // FHolder.getComponent("GD").init(self, 7);
  396. // FHolder.isHold = false;
  397. // break;
  398. }
  399. case 8: {
  400. if (self.lightF) {
  401. self.lightF = false;
  402. self.FootHoldGenerator(null);
  403. break;
  404. }
  405. FHolder = cc.instantiate(self.shandian);
  406. self.FHolderNode.addChild(FHolder, 5, "shandian");
  407. FHolder.getComponent("shandian").init(self);
  408. FHolder.isHold = false;
  409. self.lightF = true;
  410. break;
  411. }
  412. // default:{
  413. // FHolder = cc.instantiate(self.GD);
  414. // self.FHolderNode.addChild(FHolder,5,"GD");
  415. // FHolder.getComponent("GD").init(self);
  416. // FHolder.getComponent("GD").enabled = true;
  417. // FHolder.getComponent("MoveGD").init(self);
  418. // FHolder.getComponent("MoveGD").enabled = false;
  419. // FHolder.isHold = false;
  420. // // console.log("默认产生第一种落脚点");
  421. // }
  422. // break;
  423. }
  424. return FHolder;
  425. };
  426. /**
  427. * 按钮触发,向左,长按事件
  428. */
  429. MainScene.prototype.BtnTurnLeft = function (event) {
  430. var self = this;
  431. if (self.RkeyDown) {
  432. return;
  433. }
  434. else {
  435. self.LkeyDown = true;
  436. self.RkeyDown = false;
  437. this.BtnLorR(event);
  438. }
  439. };
  440. /**
  441. * 按钮触发,向右,长按事件,长按响应未解决
  442. */
  443. MainScene.prototype.BtnTurnRight = function (event) {
  444. var self = this;
  445. if (self.LkeyDown) {
  446. return;
  447. }
  448. else {
  449. self.LkeyDown = false;
  450. self.RkeyDown = true;
  451. this.BtnLorR(event);
  452. }
  453. };
  454. /**
  455. * btn触发事件
  456. * @param event 按钮触发事件
  457. */
  458. MainScene.prototype.BtnLorR = function (event) {
  459. var self = this;
  460. Global_1.default.instance.moveSpeed = 1;
  461. var schedule = cc.director.getScheduler();
  462. var stand = self.Player.getChildByName("stand");
  463. var runRight = self.Player.getChildByName("runRight");
  464. var run = self.Player.getChildByName("run");
  465. var Ani; //the animation of player
  466. var Anistate; //the Ani's state
  467. var Anistring; //the name of Ani
  468. var moveByTime = 1;
  469. var scheduleState = false; //the schedule's state
  470. var schedulePause = true;
  471. var target = null; //the target which is binged to schedule
  472. var moveByDes = Global_1.default.instance.moveSpeed * 120 + 40;
  473. if (self.LkeyDown) {
  474. target = self.LEFT;
  475. moveByTime = 1;
  476. moveByDes = -moveByDes;
  477. scheduleState = schedule.isScheduled(func, target);
  478. // self.output.getComponent(cc.Label).string = Anistring;
  479. schedulePause = schedule.isTargetPaused(target);
  480. Ani = run.getComponent(cc.Animation);
  481. Anistring = "run";
  482. stand.active = false;
  483. runRight.active = false;
  484. run.active = true;
  485. // self.output.getComponent(cc.Label).string = Anistring;
  486. if (!Global_1.default.instance.CollisionFlag) {
  487. moveByTime = 1;
  488. }
  489. else {
  490. switch (Global_1.default.instance.KIND_FootHold) {
  491. case 2: {
  492. moveByTime = 4.1;
  493. self.output.getComponent(cc.Label).string = Global_1.default.instance.KIND_FootHold + "2";
  494. break;
  495. }
  496. case 5: {
  497. moveByTime = 3.9;
  498. // self.output.getComponent(cc.Label).string = Global.instance.KIND_FootHold+"5";
  499. break;
  500. }
  501. }
  502. ;
  503. }
  504. }
  505. if (self.RkeyDown) {
  506. target = self.RIGHT;
  507. moveByTime = 1;
  508. moveByDes = moveByDes;
  509. scheduleState = schedule.isScheduled(func, target);
  510. // self.output.getComponent(cc.Label).string = Anistring;
  511. schedulePause = schedule.isTargetPaused(target);
  512. Ani = runRight.getComponent(cc.Animation);
  513. Anistring = "runR";
  514. stand.active = false;
  515. runRight.active = true;
  516. run.active = false;
  517. // self.output.getComponent(cc.Label).string = Anistring;
  518. if (!Global_1.default.instance.CollisionFlag) {
  519. moveByTime = 1;
  520. }
  521. else {
  522. switch (Global_1.default.instance.KIND_FootHold) {
  523. case 2: {
  524. moveByTime = 4.1;
  525. // self.output.getComponent(cc.Label).string = Global.instance.KIND_FootHold+"2";
  526. break;
  527. }
  528. case 5: {
  529. moveByTime = 3.9;
  530. // self.output.getComponent(cc.Label).string = Global.instance.KIND_FootHold+"5";
  531. break;
  532. }
  533. }
  534. ;
  535. }
  536. }
  537. var funcFlag = false;
  538. switch (event.type) {
  539. case "touchstart": {
  540. if (!(self.moveFalg.length == 0)) {
  541. break;
  542. }
  543. self.moveFalg = "touchstart";
  544. if (!scheduleState) {
  545. // self.output.getComponent(cc.Label).string = movefalg;
  546. schedule.schedule(func, target, 0);
  547. }
  548. ;
  549. if (schedulePause) {
  550. schedule.resumeTarget(target);
  551. }
  552. ;
  553. break;
  554. }
  555. case "touchmove": {
  556. if (!(self.moveFalg.length == 0)) {
  557. break;
  558. }
  559. self.moveFalg = "touchmove";
  560. // self.output.getComponent(cc.Label).string = movefalg;
  561. if (!scheduleState) {
  562. schedule.schedule(func, target, 0);
  563. }
  564. ;
  565. if (schedulePause) {
  566. schedule.resumeTarget(target);
  567. }
  568. ;
  569. break;
  570. }
  571. case "touchcancel": {
  572. break;
  573. }
  574. case "touchend": {
  575. // self.output.getComponent(cc.Label).string = "touchend";
  576. schedule.pauseTarget(target);
  577. self.Player.stopAllActions();
  578. Ani.stop(Anistring);
  579. moveByTime = 1;
  580. moveByDes = Global_1.default.instance.moveSpeed * 120 + 40;
  581. switch (Anistring) {
  582. case "run": {
  583. run.active = false;
  584. runRight.active = false;
  585. stand.active = true;
  586. self.LkeyDown = false;
  587. self.RkeyDown = false;
  588. moveByDes = Global_1.default.instance.moveSpeed / 2;
  589. break;
  590. }
  591. case "runR": {
  592. run.active = false;
  593. runRight.active = false;
  594. stand.active = true;
  595. self.LkeyDown = false;
  596. self.RkeyDown = false;
  597. moveByDes = Global_1.default.instance.moveSpeed / 2;
  598. break;
  599. }
  600. }
  601. funcFlag = false;
  602. self.moveFalg = "";
  603. break;
  604. }
  605. }
  606. function func() {
  607. if (funcFlag) {
  608. return;
  609. }
  610. if (Global_1.default.instance.CollisionFlag) {
  611. moveByTime = 1;
  612. }
  613. var spawn = cc.spawn(cc.callFunc(function () {
  614. self.Player.runAction(cc.moveBy(moveByTime, moveByDes, 0));
  615. }), cc.callFunc(function () {
  616. Anistate = Ani.play(Anistring);
  617. Anistate.speed = 1;
  618. Anistate.repeatCount = 100;
  619. Anistate = Ani.playAdditive(Anistring);
  620. }));
  621. self.Player.runAction(spawn);
  622. funcFlag = true;
  623. }
  624. };
  625. /**
  626. * 返回键监听
  627. * @param event 按下返回键退出游戏
  628. */
  629. MainScene.prototype.AniPlayer = function (Ani, Anistate, moveByTime, moveByDes, Key, AniName, self) {
  630. Ani = Key.getComponent(cc.Animation);
  631. var spawn = cc.spawn(cc.callFunc(function () {
  632. self.Player.runAction(cc.moveBy(moveByTime, moveByDes, 0));
  633. }), cc.callFunc(function () {
  634. Anistate = Ani.play(AniName);
  635. Anistate.speed = 2;
  636. Anistate.repeatCount = 100;
  637. }));
  638. self.Player.runAction(spawn);
  639. if (!Ani.state) {
  640. var spawn2 = cc.spawn(cc.callFunc(function () {
  641. self.Player.runAction(cc.moveBy(moveByTime, moveByDes, 0));
  642. }), cc.callFunc(function () {
  643. Anistate = Ani.play(AniName);
  644. Anistate.speed = 2;
  645. Anistate.repeatCount = 100;
  646. }));
  647. self.Player.runAction(spawn2);
  648. }
  649. };
  650. /**
  651. * 抬起动画停止
  652. * @param event 抬起左右键触发
  653. */
  654. MainScene.prototype.onKeyUp = function (event) {
  655. var self = this;
  656. self.LkeyDown = false;
  657. this.RkeyDown = false;
  658. self.Player.stopAllActions();
  659. var stand = this.Player.getChildByName("stand");
  660. var runRight = this.Player.getChildByName("runRight");
  661. var run = this.Player.getChildByName("run");
  662. stand.active = true;
  663. run.active = false;
  664. runRight.active = false;
  665. };
  666. MainScene.prototype.pretreatmentGameover = function () {
  667. var _this = this;
  668. if (!Global_1.default.instance.OverFlag && this.once == false) {
  669. this.once = true;
  670. MessManager_1.default.getInstance().getUserSore(function (res) {
  671. console.error('收到正常消息一次');
  672. // console.error(res);
  673. if (_this.fuhuoCount-- > 0) {
  674. _this.showFail(res.data.thirty_score, res.data.one_hundred_score);
  675. }
  676. else {
  677. _this.gameOver(res.data.thirty_score, res.data.one_hundred_score);
  678. _this.once = false;
  679. }
  680. }, function () {
  681. console.error('收到失败消息一次');
  682. _this.gameOver();
  683. _this.once = false;
  684. });
  685. }
  686. };
  687. MainScene.prototype.showFailPnael = function () {
  688. var failure = cc.instantiate(this.failure);
  689. var ReStartBtnreGame = failure.getChildByName("reset").getComponent(cc.Button);
  690. var reGameEventHandler = new cc.Component.EventHandler();
  691. reGameEventHandler.target = this.node;
  692. reGameEventHandler.component = "MainScene";
  693. reGameEventHandler.handler = "restart";
  694. reGameEventHandler.customEventData = null;
  695. ReStartBtnreGame.clickEvents.push(reGameEventHandler);
  696. };
  697. MainScene.prototype.showFail = function (score1, score2) {
  698. if (score1 === void 0) { score1 = 0; }
  699. if (score2 === void 0) { score2 = 0; }
  700. var self = this;
  701. var failure;
  702. var Score;
  703. failure = cc.instantiate(self.failure);
  704. var ReStartBtnreGame = failure.getChildByName("reset").getComponent(cc.Button);
  705. var fuhuo = failure.getChildByName("fuhuo").getComponent(cc.Button);
  706. failure.getChildByName("fuhuo").active = true;
  707. this.init2Btn(fuhuo, ReStartBtnreGame);
  708. if (!Global_1.default.instance.OverFlag) {
  709. Global_1.default.instance.OverFlag = true;
  710. this.Player.active = false;
  711. failure.y = -20;
  712. self.node.addChild(failure);
  713. Score = failure.getChildByName("cj").getChildByName("Score");
  714. Score.getComponent(cc.Label).string = self.LifeDing.getChildByName("Floor").getComponent(cc.Label).string;
  715. if (parseInt(Score.getComponent(cc.Label).string) >= 100) {
  716. failure.getChildByName("fuhuo").active = false;
  717. }
  718. else {
  719. failure.getChildByName("fuhuo").active = true;
  720. }
  721. var TipSNode = failure.getChildByName("sb");
  722. this.initFailStr(Score, TipSNode, failure, score1, score2);
  723. }
  724. else {
  725. return;
  726. }
  727. };
  728. /**
  729. *
  730. */
  731. MainScene.prototype.gameOver = function (score1, score2) {
  732. if (score1 === void 0) { score1 = 0; }
  733. if (score2 === void 0) { score2 = 0; }
  734. var self = this;
  735. self.Player.stopAllActions();
  736. Global_1.default.instance.CollisionFlag = false;
  737. // self.Player.getComponent(cc.BoxCollider).enabled = false;
  738. self.Player.getComponent("Playcontroler").enabled = false;
  739. try {
  740. self.Player.getComponent(cc.Animation).stop();
  741. }
  742. catch (error) {
  743. self.node.getChildByName("output").getComponent(cc.Label).string = error;
  744. }
  745. self.Player.getChildByName("stand").active = true;
  746. self.Player.getChildByName("runRight").active = false;
  747. self.Player.getChildByName("run").active = false;
  748. self.Player.y -= Global_1.default.instance.InitSpeed;
  749. var AllFH = self.node.getChildByName("BgNode").getChildByName("FHolder").children;
  750. for (var i = 0; i < AllFH.length; i++) {
  751. var FHNA = AllFH[i].name;
  752. AllFH[i].getComponent(FHNA).enabled = false;
  753. AllFH[i].isHold = false;
  754. if (FHNA == "GD") {
  755. AllFH[i].getChildByName("gd").getComponent("CliGD").enabled = false;
  756. }
  757. }
  758. self.StopAni(self);
  759. for (var i = 0; i < this.LifeDing.children.length; i++) {
  760. if (this.LifeDing.children[i].name == "lifeBG") {
  761. this.LifeDing.children[i].active = false;
  762. }
  763. }
  764. self.LEFT.node.active = false;
  765. self.RIGHT.node.active = false;
  766. self.playdeadsound();
  767. var failure;
  768. var Score;
  769. failure = cc.instantiate(self.failure);
  770. var ReStartBtnreGame = failure.getChildByName("reset").getComponent(cc.Button);
  771. var fuhuo = failure.getChildByName("fuhuo").getComponent(cc.Button);
  772. failure.getChildByName("fuhuo").active = false;
  773. this.init2Btn(fuhuo, ReStartBtnreGame);
  774. if (!Global_1.default.instance.OverFlag) {
  775. Global_1.default.instance.OverFlag = true;
  776. this.Player.active = false;
  777. failure.y = -20;
  778. self.node.addChild(failure);
  779. Score = failure.getChildByName("cj").getChildByName("Score");
  780. Score.getComponent(cc.Label).string = self.LifeDing.getChildByName("Floor").getComponent(cc.Label).string;
  781. var TipSNode = failure.getChildByName("sb");
  782. this.initFailStr(Score, TipSNode, failure, score1, score2);
  783. }
  784. else {
  785. return;
  786. }
  787. console.log("游戏结束!!!");
  788. };
  789. MainScene.prototype.init2Btn = function (fuhuo, reset) {
  790. var FuhupEventHandler = new cc.Component.EventHandler();
  791. FuhupEventHandler.target = this.node;
  792. FuhupEventHandler.component = "MainScene";
  793. FuhupEventHandler.handler = "fuhuoOnce";
  794. FuhupEventHandler.customEventData = null;
  795. fuhuo.clickEvents.push(FuhupEventHandler);
  796. var reGameEventHandler = new cc.Component.EventHandler();
  797. reGameEventHandler.target = this.node;
  798. reGameEventHandler.component = "MainScene";
  799. reGameEventHandler.handler = "restart";
  800. reGameEventHandler.customEventData = null;
  801. reset.clickEvents.push(reGameEventHandler);
  802. };
  803. MainScene.prototype.initFailStr = function (CurrentScore, tipsNode, failure, score1, score2) {
  804. if (parseInt(CurrentScore.getComponent(cc.Label).string) >= 100) {
  805. tipsNode.getComponent(cc.Label).string = "成功";
  806. }
  807. else {
  808. tipsNode.getComponent(cc.Label).string = "失败";
  809. }
  810. failure.getChildByName("tips").active = false;
  811. failure.getChildByName("tips").getComponent(cc.Label).string = "\u4ECA\u65E5\u53EF\u83B7\u5F97\u5956\u52B1\n60\u5C42\u8FC7\u5173\u5956\u52B1: " + score1 + "/90 \u79EF\u5206\n100\u5C42\u901A\u5173\u5956\u52B1: " + score2 + "/100\u79EF\u5206";
  812. failure.getChildByName("tips").active = true;
  813. };
  814. MainScene.prototype.fuhuoOnce = function (a, b, c) {
  815. var _this = this;
  816. var once = function () {
  817. Global_1.default.instance.OverFlag = false;
  818. var AllFH = _this.node.getChildByName("BgNode").getChildByName("FHolder").children;
  819. for (var i = 0; i < AllFH.length; i++) {
  820. AllFH[i].destroy();
  821. }
  822. for (var i = 0; i < _this.LifeDing.children.length; i++) {
  823. if (_this.LifeDing.children[i].name == "lifeBG") {
  824. if (!_this.LifeDing.children[i].active) {
  825. _this.LifeDing.children[i].active = true;
  826. }
  827. Global_1.default.instance.reLife.push(_this.LifeDing.children[i]);
  828. }
  829. }
  830. _this.Player.getComponent(cc.BoxCollider).enabled = false;
  831. _this.Player.y = 300;
  832. _this.scheduleOnce(function () {
  833. Global_1.default.instance.CollisionFlag = false;
  834. _this.Player.active = true;
  835. _this.Player.getComponent(cc.BoxCollider).enabled = true;
  836. }, 0.1);
  837. a.target.parent.destroy();
  838. _this.FootHoldGenerator(1).y = -380;
  839. _this.FootHoldGenerator(1).y = -220;
  840. _this.FootHoldGenerator(1).y = -100;
  841. _this.once = false;
  842. };
  843. if (CC_DEBUG) {
  844. once();
  845. return;
  846. }
  847. MessManager_1.default.getInstance().changeScore(-10, function () {
  848. once();
  849. }, function () {
  850. once();
  851. });
  852. };
  853. /**
  854. * 复活按钮的回调函数:打开排行榜
  855. */
  856. MainScene.prototype.FBtnCB_Rank = function (self) {
  857. this.destroy();
  858. cc.director.loadScene("EndScene");
  859. };
  860. /**
  861. * 复活按钮的回调函数:立即复活
  862. */
  863. MainScene.prototype.FBtnCB_rePlay = function () {
  864. cc.sys.localStorage.setItem("hfsj", "99");
  865. var self = this;
  866. Global_1.default.instance.OverFlag = false;
  867. Global_1.default.instance.AniFalg = false;
  868. Global_1.default.instance.LorR = 0;
  869. Global_1.default.instance.InitSpeed = Global_1.default.instance.ConstInitSpeed;
  870. Global_1.default.instance.moveSpeed = 1;
  871. // Global.instance.FHFallSpeed = 2;
  872. Global_1.default.instance.CollisionFlag = false;
  873. Global_1.default.instance.CollisionWithDing = false;
  874. Global_1.default.instance.TheHolder = null;
  875. Global_1.default.instance.KIND_FootHold = 0;
  876. // this.RIGHT.node.off(cc.Node.EventType.TOUCH_START,this.BtnTurnRight,this);
  877. // this.RIGHT.node.off(cc.Node.EventType.TOUCH_MOVE,this.BtnTurnRight,this);
  878. // this.RIGHT.node.off(cc.Node.EventType.TOUCH_CANCEL,this.onKeyUp,this);
  879. this.LEFT.node.active = true;
  880. this.RIGHT.node.active = true;
  881. this.LkeyDown = false;
  882. this.RkeyDown = false;
  883. this.moveFalg = "";
  884. this.Player.y = 300;
  885. this.Player.x = 0;
  886. this.Player.getComponent("Playcontroler").enabled = true;
  887. this.Player.getComponent(cc.BoxCollider).enabled = true;
  888. var AllFH = this.node.getChildByName("BgNode").getChildByName("FHolder").children;
  889. this.node.getChildByName("SB").destroy();
  890. // this.node.getChildByName("fuhuo1").destroy();
  891. for (var i = 0; i < this.LifeDing.children.length; i++) {
  892. //for(let i=0;i<2;i++){
  893. if (this.LifeDing.children[i].name == "lifeBG") {
  894. if (!this.LifeDing.children[i].active) {
  895. this.LifeDing.children[i].active = true;
  896. }
  897. Global_1.default.instance.reLife.push(this.LifeDing.children[i]);
  898. }
  899. }
  900. this.Player.getComponent(cc.BoxCollider).enabled = false;
  901. for (var i = 0; i < AllFH.length; i++) {
  902. AllFH[i].destroy();
  903. }
  904. var F = this.FootHoldGenerator(1);
  905. F.y = -380;
  906. this.scheduleOnce(function () {
  907. self.Player.getComponent(cc.BoxCollider).enabled = true;
  908. }, 0.5);
  909. };
  910. /**
  911. * restart
  912. */
  913. MainScene.prototype.restart = function () {
  914. this.destroy();
  915. cc.director.loadScene("MainScene");
  916. cc.director.resume();
  917. Global_1.default.instance.OverFlag = false;
  918. Global_1.default.instance.AniFalg = false;
  919. Global_1.default.instance.LorR = 0;
  920. Global_1.default.instance.InitSpeed = Global_1.default.instance.ConstInitSpeed;
  921. Global_1.default.instance.moveSpeed = 1;
  922. Global_1.default.instance.FHFallSpeed = 2;
  923. Global_1.default.instance.CollisionFlag = false;
  924. Global_1.default.instance.CollisionWithDing = false;
  925. Global_1.default.instance.TheHolder = null;
  926. Global_1.default.instance.KIND_FootHold = 0;
  927. // this.RIGHT.node.off(cc.Node.EventType.TOUCH_START,this.BtnTurnRight,this);
  928. // this.RIGHT.node.off(cc.Node.EventType.TOUCH_MOVE,this.BtnTurnRight,this);
  929. // this.RIGHT.node.off(cc.Node.EventType.TOUCH_CANCEL,this.onKeyUp,this);
  930. this.LEFT.node.active = true;
  931. this.RIGHT.node.active = true;
  932. this.LkeyDown = false;
  933. this.RkeyDown = false;
  934. // this.moveFalg = "";
  935. this.Player.y = 300;
  936. // this.Score();
  937. };
  938. /**
  939. * 受到伤害,命数减一
  940. */
  941. MainScene.prototype.reduceLife = function () {
  942. var self = this;
  943. var Ls = new Array();
  944. var reLCount = 0;
  945. var FHolder = self.node.getChildByName("BgNode").getChildByName("FHolder").children;
  946. for (var i = 0; i < FHolder.length; i++) {
  947. if (FHolder[i].isHold) {
  948. if (!Global_1.default.instance.CollisionFlag) {
  949. FHolder[i].isHold = false;
  950. var box = FHolder[i].getComponent(cc.BoxCollider);
  951. box.enabled = false;
  952. }
  953. }
  954. }
  955. //
  956. for (var i = self.LifeDing.children.length - 1; i >= 0; i--) {
  957. if (self.LifeDing.children[i].name == "lifeBG") {
  958. if (Global_1.default.instance.Injured || Global_1.default.instance.CollisionWithDing) {
  959. if (self.LifeDing.children[i].active) {
  960. self.LifeDing.children[i].active = false;
  961. Global_1.default.instance.Injured = false;
  962. Global_1.default.instance.CollisionFlag = false;
  963. Global_1.default.instance.CollisionWithDing = false;
  964. }
  965. }
  966. Ls.push(self.LifeDing.children[i]);
  967. }
  968. }
  969. Global_1.default.instance.reLife = [];
  970. for (var i = 0; i < Ls.length; i++) {
  971. if (Ls[i].active) {
  972. Global_1.default.instance.reLife.push(Ls[i]); //player剩余的命数
  973. }
  974. }
  975. //
  976. var time = cc.sys.localStorage.getItem("hfsj");
  977. //console.log( time + "当前血 : " + Global.instance.reLife.length);
  978. if (Global_1.default.instance.reLife.length < 3) {
  979. if (time == 99) {
  980. var time_1 = Math.floor(Date.now() / 1000);
  981. cc.sys.localStorage.setItem("hfsj", time_1);
  982. }
  983. else {
  984. var time_2 = Math.floor(Date.now() / 1000);
  985. var timlod = parseInt(cc.sys.localStorage.getItem("hfsj"));
  986. var sub = time_2 - timlod;
  987. if (sub >= 20) {
  988. var sizes = Global_1.default.instance.reLife.length + 2;
  989. Global_1.default.instance.reLife = [];
  990. for (var i = 0; i < sizes; i++) {
  991. if (this.LifeDing.children[i].name == "lifeBG") {
  992. if (!this.LifeDing.children[i].active) {
  993. this.LifeDing.children[i].active = true;
  994. }
  995. Global_1.default.instance.reLife.push(this.LifeDing.children[i]);
  996. // console.log("push --------------" + i);
  997. }
  998. }
  999. cc.sys.localStorage.setItem("hfsj", time_2);
  1000. // console.log(sizes + "恢复血+1---------------------------------------" + Global.instance.reLife.length);
  1001. }
  1002. }
  1003. }
  1004. else {
  1005. cc.sys.localStorage.setItem("hfsj", "99");
  1006. }
  1007. };
  1008. /**
  1009. * 每下落一层,分数加一。
  1010. */
  1011. MainScene.prototype.Score = function () {
  1012. var _this = this;
  1013. var self = this.node;
  1014. var scLabel = this.LifeDing.getChildByName("Floor").getComponent(cc.Label);
  1015. var sc = parseInt(scLabel.string);
  1016. if (!Global_1.default.instance.OverFlag) {
  1017. sc = sc + 1;
  1018. }
  1019. this.playtansound();
  1020. console.log("打印一下");
  1021. scLabel.string = sc.toString();
  1022. if (sc == 60) {
  1023. MessManager_1.default.getInstance().questServer(30, null, null);
  1024. }
  1025. if (sc == 100) {
  1026. MessManager_1.default.getInstance().questServer(100, function () {
  1027. _this.pretreatmentGameover();
  1028. }, null);
  1029. ///
  1030. }
  1031. var lv = Math.ceil(sc / 25);
  1032. if (lv > Global_1.default.instance.LevelAddFlag) {
  1033. Global_1.default.instance.LevelAddFlag = lv;
  1034. Global_1.default.instance.InitSpeed += 0.5; //每下落50层,player下落速度加0.25
  1035. Global_1.default.instance.FHFallSpeed += 1; //没下落50层,落脚点下落速度加快0.5.
  1036. if (sc == 50) {
  1037. Global_1.default.instance.InitSpeed += 1; //每下落50层,player下落速度加0.25
  1038. Global_1.default.instance.FHFallSpeed += 2; //没下落50层,落脚点下落速度加快0.5.
  1039. }
  1040. if (sc == 70) {
  1041. Global_1.default.instance.InitSpeed += 2; //每下落50层,player下落速度加0.25
  1042. Global_1.default.instance.FHFallSpeed += 4; //没下落50层,落脚点下落速度加快0.5.
  1043. }
  1044. }
  1045. };
  1046. /**
  1047. * 本地分数存储
  1048. */
  1049. MainScene.prototype.StoregeScore = function () {
  1050. var self = this;
  1051. var localS = Global_1.default.instance.getLocalScore(); //the temp of local score;
  1052. var CurrentScore = parseInt(this.LifeDing.getChildByName("Floor").getComponent(cc.Label).string);
  1053. Global_1.default.instance.getLocalScore().CurrentScore = CurrentScore;
  1054. if (CurrentScore > localS.ThirdScore) {
  1055. if (CurrentScore > localS.SecondScore) {
  1056. if (CurrentScore > localS.BestScore) {
  1057. localS.BestScore = CurrentScore;
  1058. return;
  1059. }
  1060. localS.SecondScore = CurrentScore;
  1061. }
  1062. localS.ThirdScore = CurrentScore;
  1063. }
  1064. };
  1065. /**
  1066. * upload the best score
  1067. */
  1068. MainScene.prototype.UpLoadScore = function () {
  1069. var self = this;
  1070. var tmp = Global_1.default.instance.GetUSer();
  1071. /* Http.sendRequest("/updateScore",tmp,function(msg){
  1072. let x = msg;
  1073. if(msg.code!=0){
  1074. Global.instance.NetStatus = false;
  1075. }
  1076. let ux = {
  1077. userId:'',
  1078. }
  1079. console.log(x);
  1080. ux.userId = Global.instance.GetUSer().userId;
  1081. Http.sendRequest("/rank",ux,function(mmsg){
  1082. console.log("------------------3");
  1083. let MM = JSON.parse(mmsg.msg);
  1084. console.log(MM);
  1085. if(Global.instance.GetR()==null||Global.instance.GetR().rank==undefined||Global.instance.GetR().rank<MM.my.rank){
  1086. Global.instance.SetR(MM.my.rank);
  1087. Global.instance.setRemoteScore(MM.other);
  1088. }
  1089. });
  1090. });*/
  1091. };
  1092. __decorate([
  1093. property(cc.Prefab)
  1094. ], MainScene.prototype, "boli", void 0);
  1095. __decorate([
  1096. property(cc.Prefab)
  1097. ], MainScene.prototype, "dici", void 0);
  1098. __decorate([
  1099. property(cc.Prefab)
  1100. ], MainScene.prototype, "lvdai", void 0);
  1101. __decorate([
  1102. property(cc.Prefab)
  1103. ], MainScene.prototype, "shandian", void 0);
  1104. __decorate([
  1105. property(cc.Prefab)
  1106. ], MainScene.prototype, "tanhuang", void 0);
  1107. __decorate([
  1108. property(cc.Prefab)
  1109. ], MainScene.prototype, "Opplvdai", void 0);
  1110. __decorate([
  1111. property(cc.Prefab)
  1112. ], MainScene.prototype, "GD", void 0);
  1113. __decorate([
  1114. property(cc.Prefab)
  1115. ], MainScene.prototype, "failure", void 0);
  1116. __decorate([
  1117. property(cc.Prefab)
  1118. ], MainScene.prototype, "fuhuo", void 0);
  1119. __decorate([
  1120. property(cc.Node)
  1121. ], MainScene.prototype, "Player", void 0);
  1122. __decorate([
  1123. property(cc.Node)
  1124. ], MainScene.prototype, "FHolderNode", void 0);
  1125. __decorate([
  1126. property(cc.Node)
  1127. ], MainScene.prototype, "Bg", void 0);
  1128. __decorate([
  1129. property(cc.Node)
  1130. ], MainScene.prototype, "LifeDing", void 0);
  1131. __decorate([
  1132. property(cc.Button)
  1133. ], MainScene.prototype, "LEFT", void 0);
  1134. __decorate([
  1135. property(cc.Button)
  1136. ], MainScene.prototype, "RIGHT", void 0);
  1137. __decorate([
  1138. property(cc.Label)
  1139. ], MainScene.prototype, "output", void 0);
  1140. MainScene = __decorate([
  1141. ccclass
  1142. ], MainScene);
  1143. return MainScene;
  1144. }(cc.Component));
  1145. exports.default = MainScene;
  1146. cc._RF.pop();