|
@@ -3,7 +3,7 @@ import Two from "two.js";
|
3
|
3
|
|
4
|
4
|
const colorList = ['#f5222d', '#d4380d', '#d46b08', '#d48806', '#d4b106', '#7cb305', '#389e0d', '#08979c', '#096dd9', '#531dab']
|
5
|
5
|
|
6
|
|
-export default function game({ el, onError, onSuccess }) {
|
|
6
|
+export default function game({ el, onError, onSuccess, onBingo }) {
|
7
|
7
|
|
8
|
8
|
// 是否游戏结束
|
9
|
9
|
let isFinished = false;
|
|
@@ -154,13 +154,15 @@ export default function game({ el, onError, onSuccess }) {
|
154
|
154
|
currentBullet = null;
|
155
|
155
|
isShooting = false;
|
156
|
156
|
|
157
|
|
- if (!clip.length) {
|
158
|
|
- const t = setTimeout(() => {
|
|
157
|
+ const t = setTimeout(() => {
|
|
158
|
+ if (!clip.length) {
|
159
|
159
|
isFinished = true
|
160
|
160
|
onSuccess()
|
161
|
|
- clearTimeout(t)
|
162
|
|
- }, 0)
|
163
|
|
- }
|
|
161
|
+ } else {
|
|
162
|
+ onBingo()
|
|
163
|
+ }
|
|
164
|
+ clearTimeout(t)
|
|
165
|
+ }, 0)
|
164
|
166
|
}
|
165
|
167
|
}
|
166
|
168
|
|