Browse Source

日常开发

林旭祥 3 weeks ago
parent
commit
a1c04182f8
3 changed files with 15 additions and 11 deletions
  1. 1 1
      src/layout/index.vue
  2. 1 1
      src/views/game/components/fruit.vue
  3. 13 9
      src/views/game/index.vue

+ 1 - 1
src/layout/index.vue

@@ -45,7 +45,7 @@ const openRanking = () => {
   timer.value = setTimeout(() => {
     if (!rankingWindowRef.value.rankingState) {
       if (
-        !['/ranking', '/login', '/login/qrcode', '/login/mobile', '/login/sunshineRun', '/sunshineRun', '/game'].includes(router.currentRoute.value.fullPath)
+        !['/ranking', '/login', '/login/qrcode', '/login/mobile', '/login/sunshineRun', '/sunshineRun', '/game', '/game/test'].includes(router.currentRoute.value.fullPath)
       ) {
         rankingWindowRef.value.open();
       }

+ 1 - 1
src/views/game/components/fruit.vue

@@ -1022,7 +1022,7 @@ class MainScene extends Phaser.Scene {
     // 每次创建全新的容器,避免复用旧实例
     this.sandiaGroup = this.add.container(0, 0); // 先置0,后续重新计算
     // 西瓜组初始位置:基于当前窗口尺寸动态计算(核心修复)
-    this.sandiaGroup.setPosition(width / 2, height / 2); // 强制设置位置
+    this.sandiaGroup.setPosition(width / 2, height / 2.5); // 强制设置位置
     //圆圈
     this.new_game = this.add.sprite(0, 0, "new-game");
     this.new_game.setOrigin(0.5, 0.5);

+ 13 - 9
src/views/game/index.vue

@@ -22,28 +22,28 @@
     <div class="gameWindow" v-if="currentGame">
       <!---人体姿态识别-->
       <div class="columns" v-if="currentGame == 'bodyposecontroller'">
-        <div class="item">
+        <div class="item left">
           <HumanBody ref="humanBodyLeftRef" type="left"></HumanBody>
         </div>
-        <div class="item">
+        <div class="item right">
           <HumanBody ref="humanBodyRightRef" type="right"></HumanBody>
         </div>
       </div>
       <!---篮球投篮-->
       <div class="columns" v-if="currentGame == 'game_basketball'">
-        <div class="item">
+        <div class="item left">
           <Basketball ref="basketballLeftRef" type="left"></Basketball>
         </div>
-        <div class="item">
+        <div class="item right">
           <Basketball ref="basketballRightRef" type="right"></Basketball>
         </div>
       </div>
       <!---足球带球-->
       <div class="columns" v-if="currentGame == 'game_football'">
-        <div class="item">
+        <div class="item left">
           <Football ref="footballLeftRef" type="left"></Football>
         </div>
-        <div class="item">
+        <div class="item right">
           <Football ref="footballRightRef" type="right"></Football>
         </div>
       </div>
@@ -186,8 +186,6 @@ const getInit = async () => {
       }
     }
     if (e?.cmd == 'terminate_bodyposecontroller') {
-      closeWS();
-      getExit();
     }
     if (e?.type == 'disconnect') {
       getExit();
@@ -413,7 +411,13 @@ $waiPadding: 6.51rem;
     .item {
       flex: 1;
       display: flex;
-
+      box-sizing: border-box;
+    }
+    .left{
+      border-right: 10px solid #07121a;
+    }
+    .right{
+      border-left: 10px solid #07121a;
     }
   }