Browse Source

日常开发

林旭祥 1 month ago
parent
commit
edd07113f7
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/views/game/football.vue

+ 7 - 2
src/views/game/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">
@@ -1074,13 +1074,18 @@ watch(currentScene, (newVal) => {
 watch(
   () => myThrow.value,
   (newData, oldData) => {
-    if (myTimer.value) {
+    if (oldData == undefined || myTimer.value) {
       return false;
     }
     console.log("ppp", oldData, newData)
     if (newData == 1) {
       console.log("收腿准备")
     } else {
+      if (currentScene.value === 'start') {
+        startGame();
+      }
+      const gameScene = game.value.scene.getScene('GameScene');
+      gameScene.shootBall();
       console.log("踢出去了")
       //加个时间以免踢出去然后收腿也算了
       myTimer.value = setTimeout(() => {