|
@@ -48,6 +48,7 @@ watch(
|
|
if (oldData == undefined) {
|
|
if (oldData == undefined) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ if (gameState.state !== 'play') return;
|
|
console.log("ppp", oldData, newData)
|
|
console.log("ppp", oldData, newData)
|
|
if (newData == 1) {
|
|
if (newData == 1) {
|
|
console.log("投篮")
|
|
console.log("投篮")
|
|
@@ -849,13 +850,14 @@ const draw = () => {
|
|
gameState.score = 0;
|
|
gameState.score = 0;
|
|
gameState.time = 60;
|
|
gameState.time = 60;
|
|
gameState.balls = [];
|
|
gameState.balls = [];
|
|
- gameState.state = 'menu';
|
|
|
|
|
|
+ //gameState.state = 'menu';
|
|
gameState.click = false;
|
|
gameState.click = false;
|
|
gameState.exitTimer = null;
|
|
gameState.exitTimer = null;
|
|
|
|
|
|
// 如果需要跳转到其他页面,可以使用路由
|
|
// 如果需要跳转到其他页面,可以使用路由
|
|
// router.push('/');
|
|
// router.push('/');
|
|
- }, 2000);
|
|
|
|
|
|
+ emit('confirmExit', { type: 1 });
|
|
|
|
+ }, 3000);
|
|
}
|
|
}
|
|
|
|
|
|
// 保留点击退出的功能
|
|
// 保留点击退出的功能
|
|
@@ -896,6 +898,13 @@ const initGame = async () => {
|
|
// 开始游戏循环
|
|
// 开始游戏循环
|
|
gameState.animationFrameId = requestAnimationFrame(gameLoop);
|
|
gameState.animationFrameId = requestAnimationFrame(gameLoop);
|
|
gameState.ballY = clientObj.value.height - 90;
|
|
gameState.ballY = clientObj.value.height - 90;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ handleMouseDown();
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ handleMouseUp();
|
|
|
|
+ }, 100)
|
|
|
|
+ }, 1000)
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|