|
@@ -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; // 未找到对应的目标轿厢
|