Przeglądaj źródła

Merge branch 'master' of http://git.ycjcjy.com/honghe/roundabout

[baozhangchao] 3 lat temu
rodzic
commit
ca6908f97d

+ 1
- 1
src/components/FireWorkList.vue Wyświetl plik

@@ -45,7 +45,7 @@ const props = defineProps({
45 45
 
46 46
 const fireNum = ref(12)
47 47
 const isFinished = ref(true)
48
-const duration = ref(0.8)
48
+const duration = ref(1)
49 49
 
50 50
 const calcLeft = (inx) => {
51 51
   let start, end

+ 9
- 3
src/pages/game/game.js Wyświetl plik

@@ -75,7 +75,7 @@ export default function game({ el, center, onError, onSuccess, onBingo }) {
75 75
   let rotateAngle = 0
76 76
   
77 77
   // 轿厢的旋转速度 - 单位弧度
78
-  const rotateSpeed = 0.01
78
+  const rotateSpeed = 0.015
79 79
 
80 80
   // 目标轿厢与子弹轿厢的映射字典
81 81
   const mntMap = {}
@@ -328,10 +328,16 @@ export default function game({ el, center, onError, onSuccess, onBingo }) {
328 328
     const cage = cageList.filter((it) => {
329 329
       const rect1 = it.getBoundingClientRect();
330 330
 
331
+      // 校验范围为轿厢内部一半的地方
332
+      const left = rect1.left  + rect1.width / 3
333
+      const right = rect1.right - rect1.width / 3
334
+      const top = rect1.top
335
+      const bottom = rect1.bottom
336
+
331 337
       // 如果当前子弹的中心点位于目标轿厢矩形范围内
332 338
       // 则代表击中
333
-      return x >= rect1.left && x <= rect1.right &&
334
-          y >= rect1.top && y <= rect1.bottom;
339
+      return x >= left && x <= right &&
340
+          y >= top && y <= bottom;
335 341
     })[0]
336 342
 
337 343
     if (!cage) return false;  // 未找到对应的目标轿厢

+ 2
- 2
src/pages/game/index.vue Wyświetl plik

@@ -42,12 +42,12 @@
42 42
       },
43 43
       onSuccess: () => {
44 44
         firesRef.value.toggle()
45
-        alert('你真牛逼')
45
+        // alert('你真牛逼')
46 46
         const t = setTimeout(() => {
47 47
           localStorage.setItem('loadSign', '1');
48 48
           router.push('/OverPage?type=win')
49 49
           clearTimeout(t)
50
-        }, 1000)
50
+        }, 2000)
51 51
       },
52 52
       onBingo: () => {
53 53
       }