GameMode.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. var GameStates = require('GameStates');
  2. // 游戏主逻辑,规则 时间计算 胜负条件
  3. cc.Class({
  4. extends: cc.Component,
  5. properties: {
  6. Player:cc.Node,
  7. Champin:cc.Node,
  8. playerLife:cc.Node,
  9. toolPanel:cc.Node,
  10. gameoverPanel:cc.Node,
  11. gameResetPanel:cc.Node,
  12. speedAnimation:cc.Node,
  13. pauseBtn:cc.Node,
  14. runBtn:cc.Node,
  15. Toast:cc.Node,
  16. targetLabel:cc.Label,
  17. levelLabel:cc.Label,
  18. scoreLabel:cc.Label,
  19. timeLabel:cc.Label,
  20. playerAnimation:cc.Node,
  21. holeInAnimation:cc.Node,
  22. gameWinAnimation:cc.Node,
  23. toolPrefab:[cc.Prefab],
  24. boomPrefab:cc.Prefab,
  25. //音效
  26. sound:{
  27. default:[],
  28. type: cc.AudioClip
  29. },
  30. bgsound:{
  31. default:[],
  32. type: cc.AudioClip
  33. },
  34. },
  35. // LIFE-CYCLE CALLBACKS
  36. start () {
  37. this.isAndroid = false;
  38. this.isiOS = false;
  39. console.log('平台信息=',navigator.userAgent);
  40. this.isAndroid = Boolean(navigator.userAgent.match(/android/ig));
  41. this.isIphone = Boolean(navigator.userAgent.match(/iphone|ipod/ig));
  42. this.isIpad = Boolean(navigator.userAgent.match(/ipad/ig));
  43. if(this.isIphone || this.isIpad)
  44. {
  45. this.isiOS = true;
  46. }
  47. if(this.isAndroid)
  48. {
  49. console.log('当前平台是:android')
  50. }
  51. else if(this.isiOS)
  52. {
  53. console.log('当前平台是:ios')
  54. }
  55. else
  56. {
  57. console.log('当前平台未检测到')
  58. }
  59. //开启碰撞检测
  60. cc.director.getCollisionManager().enabled = true;
  61. //初始化
  62. this.positionArr = [-250,-150,-50,50,150,250]
  63. this.playerPosition = 2
  64. this.dropTime = 2000-GameStates.levelNum*100 //下落时间间隔
  65. this.movetime = 0.1//左右移动速度
  66. this.targetNum = GameStates.levelNum*10
  67. this.speedRate = 1
  68. this.iceSpeedRate = 1
  69. this.myturnsNum = 0
  70. //条件
  71. this.missTool1 = 0
  72. this.missTool2 = 0
  73. this.missTool3 = 0
  74. this.getTool1 = 0
  75. this.getTool2Rule2 = 0
  76. this.getTool2Rule4 = 0
  77. this.getTool3 = 0
  78. this.getTool4 = 0
  79. //开始
  80. this.levelLabel.node.runAction(cc.scaleTo(1.5,0.5))
  81. setTimeout(function(){
  82. this.levelLabel.node.opacity = 140
  83. }.bind(this),1500)
  84. this.dropTimer = setInterval(function(){
  85. if(!this.ispause)
  86. this.dropFunc()
  87. }.bind(this),this.dropTime+Math.random()*1000-500)
  88. this.gameTimer = setInterval(function(){
  89. this.showTime()
  90. }.bind(this),1000)
  91. this.showScore()
  92. this.showTime()
  93. this.showLife()
  94. this.showTarget()
  95. this.levelLabel.string = 'Lv '+GameStates.levelNum
  96. this.onTurnsNumber(true)
  97. this.slowBgsound = cc.audioEngine.play(this.bgsound[0],true)
  98. cc.audioEngine.play(this.sound[5],false)
  99. //监听进入后台
  100. cc.game.on(cc.game.EVENT_HIDE,event=>{
  101. // console.log("------------>后台了");
  102. this.ispause = 1
  103. },this);
  104. cc.game.on(cc.game.EVENT_SHOW,event=>{
  105. // console.log("------------>前台了");
  106. this.ispause = 0
  107. },this);
  108. },
  109. dropFunc(){
  110. if(this.ispause)
  111. return
  112. var positionNumArr = [1,2,3,4,5]
  113. if(Math.random()>0.9){
  114. var maxNum = Math.floor(Math.random()*2)+3
  115. }
  116. else{
  117. var maxNum = 1
  118. }
  119. for(var i=0;i<maxNum;i++){
  120. var ranNum = Math.random()
  121. var toolIndex = 0
  122. if(ranNum<0.3){
  123. toolIndex = 0
  124. }
  125. else if(ranNum<0.5){
  126. toolIndex = 1
  127. }
  128. else if(ranNum<0.6){
  129. toolIndex = 2
  130. }
  131. else{
  132. toolIndex = 3
  133. }
  134. if(maxNum>1)
  135. toolIndex = 3
  136. else{
  137. var getRule = this.getRule()
  138. if(getRule>0 && !this.isUsingTool){
  139. toolIndex = getRule
  140. if(getRule==4)
  141. this.getTool1 = 0
  142. if(getRule==5)
  143. this.getTool3 = 0
  144. if(getRule==7)
  145. this.getTool2Rule2 = 0
  146. if(getRule==6)
  147. this.getTool2Rule4 = 0
  148. }
  149. }
  150. var toolPrefab = cc.instantiate(this.toolPrefab[toolIndex])
  151. toolPrefab.index = toolIndex
  152. toolPrefab.y = 1000
  153. var num = Math.floor(Math.random()*positionNumArr.length)
  154. toolPrefab.x = this.positionArr[positionNumArr[num]]
  155. positionNumArr.splice(num,1)
  156. toolPrefab.parent = this.toolPanel
  157. toolPrefab.addComponent('ToolConfig')
  158. }
  159. if(maxNum>1){
  160. var toolIndex = Math.floor(Math.random()*3)
  161. var toolPrefab = cc.instantiate(this.toolPrefab[toolIndex])
  162. toolPrefab.index = toolIndex
  163. toolPrefab.y = 1000
  164. var num = Math.floor(Math.random()*positionNumArr.length)
  165. toolPrefab.x = this.positionArr[positionNumArr[num]]
  166. positionNumArr.splice(num,1)
  167. toolPrefab.parent = this.toolPanel
  168. toolPrefab.addComponent('ToolConfig')
  169. }
  170. },
  171. onTurnsNumber(f){
  172. window.bTurnsNumber = f;
  173. console.log('bShowTurnsNumberLog=',window.bTurnsNumber);
  174. },
  175. showToast(str){
  176. this.Toast.getChildByName('label').getComponent(cc.Label).string = str
  177. this.Toast.stopAllActions()
  178. this.Toast.opacity = 0
  179. this.Toast.position = cc.v2(0,0)
  180. this.Toast.runAction(cc.sequence(cc.fadeIn(0),cc.moveBy(2,0,200),cc.fadeOut(0)))
  181. },
  182. getRule(){ //查找出现道具条件
  183. //没有奖励A类到最底下方没取 + 没碰撞炸弹下连续取到 10个奖励A类 时钟 4
  184. //没有奖励B类到最底下方没取 + 没碰撞炸弹下连续取到 5个奖励B类 炸弹 7
  185. //没有奖励B到最底下方没取 + 没碰撞炸弹 + 获取3个UFO 彩虹鱼 5
  186. //没有奖励C类到最底下方没取,连续取到 5个奖励B类 牛奶 6
  187. if(this.missTool1==0 && this.getTool1>=10 && this.getTool4==0){
  188. return 4
  189. }
  190. if(this.missTool2==0 && this.getTool2Rule2>=5 && this.getTool4==0){
  191. return 7
  192. }
  193. if(this.getTool4==0 && this.missTool2==0 && this.getTool3>=3){
  194. return 5
  195. }
  196. if(this.missTool3==0 && this.getTool2Rule4>=5){
  197. return 6
  198. }
  199. return 0
  200. },
  201. showTarget(){
  202. this.targetLabel.string = this.targetNum
  203. },
  204. showTime(){
  205. var newDate = new Date()
  206. var timeNum = Math.floor((newDate.getTime()-GameStates.gameTime.getTime())/1000)
  207. var mm = Math.floor(timeNum/60)
  208. if (mm<10)
  209. mm = '0'+mm
  210. var ss = timeNum - mm*60
  211. if (ss<10)
  212. ss = '0'+ss
  213. this.timeLabel.string = mm+':'+ss
  214. },
  215. showScore(){
  216. this.scoreLabel.string = GameStates.gameScore
  217. },
  218. showLife(){
  219. for(var i=0;i<3;i++){
  220. if(i<GameStates.lifeNum)
  221. this.playerLife.children[i].active = true
  222. else
  223. this.playerLife.children[i].active = false
  224. }
  225. },
  226. addTarget(){
  227. if(this.isUsingDefence){
  228. cc.audioEngine.play(this.sound[6],false)
  229. }
  230. else{
  231. cc.audioEngine.play(this.sound[7],false)
  232. }
  233. this.targetNum--
  234. this.showTarget()
  235. if(this.targetNum==0){
  236. this.ispause = 1
  237. this.toolPanel.removeAllChildren()
  238. this.gameWinAnimation.active = true
  239. setTimeout(function(){
  240. this.gameWinAnimation.active = false
  241. if(GameStates.levelNum==10)
  242. this.gameOver(1)
  243. else
  244. this.gameWin()
  245. }.bind(this),1000)
  246. }
  247. },
  248. addScore(n){
  249. GameStates.gameScore+=n
  250. this.showScore()
  251. },
  252. loseLife(){
  253. cc.audioEngine.play(this.sound[2],false)
  254. if(this.delaytime) //连续碰撞 短时间内无敌 只扣一次生命
  255. return
  256. this.delaytime = 1
  257. setTimeout(function(){
  258. this.delaytime = 0
  259. }.bind(this),500)
  260. GameStates.lifeNum--
  261. if(GameStates.lifeNum<=0){
  262. GameStates.lifeNum=0
  263. cc.audioEngine.play(this.sound[1],false)
  264. this.ispause = 1
  265. this.gameOver(null,'0')
  266. }
  267. this.showLife()
  268. },
  269. addLife(){
  270. cc.audioEngine.play(this.sound[3],false)
  271. GameStates.lifeNum++
  272. if(GameStates.lifeNum>3)
  273. GameStates.lifeNum = 3
  274. this.showLife()
  275. },
  276. showDefence(){
  277. cc.audioEngine.play(this.sound[4],false)
  278. this.isUsingTool = 1
  279. this.speedRate = 0.8
  280. this.isUsingDefence = 1
  281. this.speedAnimation.active = true
  282. this.Player.getChildByName('playerDefence').active = true
  283. this.movetime = 0.05
  284. cc.audioEngine.stop(this.slowBgsound)
  285. this.fastBgsound = cc.audioEngine.play(this.bgsound[1],true)
  286. clearInterval(this.dropTimer)
  287. this.dropTimer = setInterval(function(){
  288. this.dropFunc()
  289. }.bind(this),this.dropTime+Math.random()*1000-1300)
  290. setTimeout(function(){
  291. this.isUsingDefence = 0
  292. this.isUsingTool = 0
  293. this.speedRate = 1
  294. this.speedAnimation.active = false
  295. this.Player.getChildByName('playerDefence').active = false
  296. this.movetime = 0.1
  297. cc.audioEngine.stop(this.fastBgsound)
  298. this.slowBgsound = cc.audioEngine.play(this.bgsound[0],true)
  299. this.droptime+=500
  300. clearInterval(this.dropTimer)
  301. this.dropTimer = setInterval(function(){
  302. this.dropFunc()
  303. }.bind(this),this.dropTime+Math.random()*1000-500)
  304. }.bind(this),15000)
  305. },
  306. useIce(){
  307. cc.audioEngine.play(this.sound[4],false)
  308. this.isUsingTool = 1
  309. this.iceSpeedRate = 3
  310. setTimeout(function(){
  311. this.isUsingTool = 0
  312. this.iceSpeedRate = 1
  313. }.bind(this),8000)
  314. },
  315. useBoom(){
  316. cc.audioEngine.play(this.sound[4],false)
  317. for(var i=0;i<this.toolPanel.children.length;i++){
  318. var tool_Stone = this.toolPanel.children[i]
  319. if(tool_Stone.name == 'tool_Stone'){
  320. var boom = cc.instantiate(this.boomPrefab)
  321. boom.parent = tool_Stone
  322. tool_Stone.getComponent('ToolConfig').runDestroy()
  323. }
  324. }
  325. },
  326. gameOver(event,n){
  327. this.speedRate = 1
  328. this.speedAnimation.active = false
  329. clearInterval(this.dropTimer)
  330. clearInterval(this.gameTimer)
  331. for(var i=0;i<this.toolPanel.children.length;i++){
  332. this.toolPanel.children[i].destroy()
  333. }
  334. this.ispause = 1
  335. clearInterval(this.resetTimer)
  336. if(n=='0'){
  337. var newDate = new Date()
  338. this.durationTime = Math.floor((newDate-GameStates.gameTime)/1000)
  339. this.gameResetPanel.active = true
  340. this.gameResetPanel.getChildByName('scoreLabel').getComponent(cc.Label).string = GameStates.gameScore
  341. this.gameResetPanel.getChildByName('levelLabel').getComponent(cc.Label).string = 'Lv '+GameStates.levelNum
  342. this.gameResetPanel.getChildByName('timeLabel').getComponent(cc.Label).string = this.timeLabel.string
  343. this.gameResetPanel.getChildByName('kcalLabel').getComponent(cc.Label).string = Math.floor((window.calorie-GameStates.carlNum)/1000)
  344. this.gameResetPanel.getChildByName('circle').getComponent(cc.Sprite).fillRange = 1
  345. cc.log(this.gameResetPanel.getChildByName('circle').getComponent(cc.Sprite).fillRange)
  346. this.resetTime = 15
  347. this.gameResetPanel.getChildByName('overTime').getComponent(cc.Label).string = this.resetTime
  348. this.resetTimer = setInterval(function(){
  349. this.resetTime--
  350. this.gameResetPanel.getChildByName('overTime').getComponent(cc.Label).string = this.resetTime
  351. this.gameResetPanel.getChildByName('circle').getComponent(cc.Sprite).fillRange = this.resetTime/15
  352. if(this.resetTime<=0){
  353. clearInterval(this.resetTimer)
  354. this.gameOver(null,'1')
  355. }
  356. }.bind(this),1000)
  357. }
  358. else{
  359. this.onTurnsNumber(false)
  360. this.gameoverPanel.active = true
  361. this.gameResetPanel.active = false
  362. this.gameoverPanel.getChildByName('scoreLabel').getComponent(cc.Label).string = GameStates.gameScore
  363. this.gameoverPanel.getChildByName('levelLabel').getComponent(cc.Label).string = 'Lv '+GameStates.levelNum
  364. this.gameoverPanel.getChildByName('timeLabel').getComponent(cc.Label).string = this.timeLabel.string
  365. this.gameoverPanel.getChildByName('kcalLabel').getComponent(cc.Label).string = Math.floor((window.calorie-GameStates.carlNum)/1000)
  366. var self = this
  367. var gripName = this.isiOS ? 'IOS' : 'Android'
  368. var scoreJson = {
  369. startTime:parseInt(GameStates.gameTime.getTime()/1000),
  370. durationTime:self.durationTime,
  371. fromType:15,
  372. calories:window.calorie-GameStates.carlNum,
  373. gripName:gripName,
  374. ip:"ip",
  375. objectJson:{"courseId":1002,"circles":window.turnsNum-GameStates.turnsNum,"averspeed":((window.turnsNum-GameStates.turnsNum)/self.durationTime).toFixed(2),"score":GameStates.gameScore,"round":GameStates.levelNum},
  376. }
  377. var scoreStr = JSON.stringify(scoreJson)
  378. console.log(scoreStr)
  379. if(this.isAndroid)
  380. {
  381. console.log('submitGameScore:',scoreStr)
  382. window.eventJsBridge.submitGameScore(scoreStr);
  383. }
  384. else if(this.isiOS)
  385. {
  386. console.log('submitGameScore:',scoreStr)
  387. window.webkit.messageHandlers.submitGameScore.postMessage(scoreStr);
  388. }
  389. if(!((this.isAndroid && window.eventJsBridge.maxScore) || (this.isiOS && window.webkit.messageHandlers.maxScore))){
  390. this.Champin.active = false
  391. }
  392. else{
  393. if(this.isAndroid)
  394. {
  395. console.log('isSendData')
  396. window.eventJsBridge.maxScore()
  397. }
  398. else if(this.isiOS)
  399. {
  400. console.log('isSendData')
  401. window.webkit.messageHandlers.maxScore.postMessage(null);
  402. }
  403. window.maxScore = function(maxScore){
  404. console.log('maxScore',maxScore)
  405. if(self.isAndroid){
  406. var mymaxScore = maxScore
  407. self.gameoverPanel.getChildByName('MaxScore').getComponent(cc.Label).string = mymaxScore.maxScore
  408. }
  409. else if(self.isiOS){
  410. var mymaxScore = JSON.parse(maxScore)
  411. self.gameoverPanel.getChildByName('MaxScore').getComponent(cc.Label).string = mymaxScore.maxScore
  412. }
  413. }
  414. }
  415. }
  416. },
  417. gameBack(){
  418. if(this.isAndroid)
  419. {
  420. window.eventJsBridge.goBack()
  421. }
  422. else if(this.isiOS)
  423. {
  424. window.webkit.messageHandlers.goBack.postMessage(null)
  425. }
  426. },
  427. gameWin(){
  428. GameStates.levelNum++
  429. cc.director.loadScene('GameScene')
  430. },
  431. gameReset(){
  432. this.ispause = 0
  433. cc.audioEngine.play(this.sound[0],false)
  434. var self = this
  435. if(this.isAndroid)
  436. {
  437. console.log('aliveGame')
  438. window.eventJsBridge.aliveGame()
  439. }
  440. else if(this.isiOS)
  441. {
  442. console.log('aliveGame')
  443. window.webkit.messageHandlers.aliveGame.postMessage(null);
  444. }
  445. window.aliveGameResponse= function(response){
  446. console.log('aliveGameResponse:',response)
  447. GameStates.lifeNum = 3
  448. cc.director.loadScene('GameScene')
  449. }
  450. var self = this
  451. window.aliveGameOnError= function(response){
  452. if(self.isAndroid)
  453. window.aliveCode = response.errCode
  454. else if(self.isiOS)
  455. window.aliveCode = JSON.parse(response).errCode
  456. console.log('aliveGameOnError:',response)
  457. if(window.aliveCode == 5031){
  458. self.showToast('You don’t have enough Mcoin, please deposit more Mcoin')
  459. }
  460. else{
  461. GameStates.lifeNum = 3
  462. cc.director.loadScene('GameScene')
  463. }
  464. }
  465. },
  466. gameHome(event,n){
  467. cc.audioEngine.play(this.sound[0],false)
  468. if(n=='0'){
  469. cc.sys.localStorage.setItem('showRank',1)
  470. }
  471. else{
  472. cc.sys.localStorage.setItem('showRank',0)
  473. }
  474. cc.director.loadScene('BeginScene')
  475. },
  476. gameBegin(){
  477. //接口
  478. cc.audioEngine.play(this.sound[0],false)
  479. GameStates.levelNum = 1
  480. GameStates.lifeNum = 3
  481. GameStates.carlNum = window.calorie
  482. GameStates.turnsNum = window.turnsNum
  483. var date = new Date()
  484. GameStates.gameTime = date
  485. GameStates.gameScore = 0
  486. cc.director.loadScene('GameScene')
  487. },
  488. gamePause(){
  489. cc.audioEngine.play(this.sound[0],false)
  490. if(!this.ispause){
  491. this.ispause = 1
  492. this.runBtn.active = true
  493. this.pauseBtn.active = false
  494. for(var i=0;i<this.toolPanel.children.length;i++){
  495. this.toolPanel.children[i].pauseAllActions()
  496. }
  497. }
  498. else{
  499. this.ispause = 0
  500. this.runBtn.active = false
  501. this.pauseBtn.active = true
  502. for(var i=0;i<this.toolPanel.children.length;i++){
  503. this.toolPanel.children[i].resumeAllActions()
  504. }
  505. }
  506. },
  507. moveLeft(){
  508. if(this.cannotMove || this.ispause)
  509. return
  510. this.cannotMove = 1
  511. this.playerPosition--
  512. if(this.playerPosition<0){
  513. this.playerPosition = 5
  514. this.Player.runAction(cc.sequence(cc.moveBy(this.movetime,0,0),cc.moveBy(0,600,0),cc.moveBy(this.movetime,-100,0)))
  515. this.Player.runAction(cc.sequence(cc.scaleTo(this.movetime,0),cc.scaleTo(this.movetime,1)))
  516. this.Player.runAction(cc.sequence(cc.rotateBy(this.movetime,-30),cc.rotateBy(this.movetime,30)))
  517. this.holeInAnimation.getComponent(dragonBones.ArmatureDisplay).playAnimation('03',1)
  518. setTimeout(function(){
  519. this.holeInAnimation.getComponent(dragonBones.ArmatureDisplay).playAnimation('02',0)
  520. }.bind(this),this.movetime*2000)
  521. cc.audioEngine.play(this.sound[9],false)
  522. }
  523. else{
  524. this.Player.runAction(cc.moveBy(0.2,-100,0))
  525. this.Player.runAction(cc.sequence(cc.rotateBy(this.movetime,-30),cc.rotateBy(this.movetime,30)))
  526. }
  527. setTimeout(function(){
  528. this.cannotMove = 0
  529. }.bind(this),this.movetime*2000)
  530. },
  531. moveRight(){
  532. if(this.cannotMove || this.ispause)
  533. return
  534. this.cannotMove = 1
  535. this.playerPosition++
  536. if(this.playerPosition>5){
  537. this.playerPosition = 0
  538. this.Player.runAction(cc.sequence(cc.moveBy(this.movetime,100,0),cc.moveBy(0,-700,0),cc.moveBy(this.movetime,100,0)))
  539. this.Player.runAction(cc.sequence(cc.scaleTo(this.movetime,0),cc.scaleTo(this.movetime,1)))
  540. this.Player.runAction(cc.sequence(cc.rotateBy(this.movetime,30),cc.rotateBy(this.movetime,-30)))
  541. this.holeInAnimation.getComponent(dragonBones.ArmatureDisplay).playAnimation('03',1)
  542. setTimeout(function(){
  543. this.holeInAnimation.getComponent(dragonBones.ArmatureDisplay).playAnimation('02',0)
  544. }.bind(this),this.movetime*2000)
  545. cc.audioEngine.play(this.sound[9],false)
  546. }
  547. else{
  548. this.Player.runAction(cc.moveBy(0.2,100,0))
  549. this.Player.runAction(cc.sequence(cc.rotateBy(this.movetime,30),cc.rotateBy(this.movetime,-30)))
  550. }
  551. setTimeout(function(){
  552. this.cannotMove = 0
  553. }.bind(this),this.movetime*2000)
  554. },
  555. update(){
  556. //转圈
  557. if(window.turnsNum>this.myturnsNum){
  558. this.myturnsNum = window.turnsNum
  559. if(window.direction==1){
  560. console.log('moveleft')
  561. this.moveLeft()
  562. }
  563. else{
  564. console.log('moveright')
  565. this.moveRight()
  566. }
  567. }
  568. },
  569. onDestroy(){
  570. cc.audioEngine.stopAllEffects()
  571. clearInterval(this.dropTimer)
  572. clearInterval(this.gameTimer)
  573. clearInterval(this.resetTimer)
  574. },
  575. });