소스 검색

日常开发

林旭祥 3 주 전
부모
커밋
d36e8d7346
1개의 변경된 파일12개의 추가작업 그리고 6개의 파일을 삭제
  1. 12 6
      src/views/game/components/football.vue

+ 12 - 6
src/views/game/components/football.vue

@@ -7,7 +7,7 @@
     <div v-if="currentScene === 'start'" class="gamestart">
       <img v-if="currentScene === 'start'" src="/static/images/football/game_start.jpg" class="start_bg" />
       <!-- <div class="btn rule" @click="showRules = true">查看规则</div> -->
-      <div class="btn start" @click="startGame">踢腿开始游戏</div>
+      <!-- <div class="btn start" @click="startGame">踢腿开始游戏</div> -->
 
       <!-- 规则弹窗 -->
       <div v-if="showRules" class="ruleshadow">
@@ -196,10 +196,16 @@ const initGame = () => {
     currentScene.value = 'gameover';
     setTimeout(() => {
       if (currentScene.value == 'gameover') {
-        restartGame();
+        // restartGame();
+        emit('confirmExit', { type: 1 });
       }
-    }, 2000)
+    }, 3000)
   });
+  setTimeout(() => {
+    if (currentScene.value === 'start') {
+      startGame();
+    }
+  }, 1000)
 };
 
 // 预加载场景
@@ -1210,9 +1216,9 @@ watch(
     if (newData == 1) {
       console.log("收腿准备")
     } else {
-      if (currentScene.value === 'start') {
-        startGame();
-      }
+      // if (currentScene.value === 'start') {
+      //   startGame();
+      // }
       const gameScene = game.value.scene.getScene('GameScene');
       gameScene.shootBall();
       console.log("踢出去了")