|
@@ -7,7 +7,7 @@
|
|
<div v-if="currentScene === 'start'" class="gamestart">
|
|
<div v-if="currentScene === 'start'" class="gamestart">
|
|
<img v-if="currentScene === 'start'" src="/static/images/football/game_start.jpg" class="start_bg" />
|
|
<img v-if="currentScene === 'start'" src="/static/images/football/game_start.jpg" class="start_bg" />
|
|
<!-- <div class="btn rule" @click="showRules = true">查看规则</div> -->
|
|
<!-- <div class="btn rule" @click="showRules = true">查看规则</div> -->
|
|
- <div class="btn start" @click="startGame">踢腿开始游戏</div>
|
|
|
|
|
|
+ <!-- <div class="btn start" @click="startGame">踢腿开始游戏</div> -->
|
|
|
|
|
|
<!-- 规则弹窗 -->
|
|
<!-- 规则弹窗 -->
|
|
<div v-if="showRules" class="ruleshadow">
|
|
<div v-if="showRules" class="ruleshadow">
|
|
@@ -196,10 +196,16 @@ const initGame = () => {
|
|
currentScene.value = 'gameover';
|
|
currentScene.value = 'gameover';
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (currentScene.value == 'gameover') {
|
|
if (currentScene.value == 'gameover') {
|
|
- restartGame();
|
|
|
|
|
|
+ // restartGame();
|
|
|
|
+ emit('confirmExit', { type: 1 });
|
|
}
|
|
}
|
|
- }, 2000)
|
|
|
|
|
|
+ }, 3000)
|
|
});
|
|
});
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (currentScene.value === 'start') {
|
|
|
|
+ startGame();
|
|
|
|
+ }
|
|
|
|
+ }, 1000)
|
|
};
|
|
};
|
|
|
|
|
|
// 预加载场景
|
|
// 预加载场景
|
|
@@ -1210,9 +1216,9 @@ watch(
|
|
if (newData == 1) {
|
|
if (newData == 1) {
|
|
console.log("收腿准备")
|
|
console.log("收腿准备")
|
|
} else {
|
|
} else {
|
|
- if (currentScene.value === 'start') {
|
|
|
|
- startGame();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (currentScene.value === 'start') {
|
|
|
|
+ // startGame();
|
|
|
|
+ // }
|
|
const gameScene = game.value.scene.getScene('GameScene');
|
|
const gameScene = game.value.scene.getScene('GameScene');
|
|
gameScene.shootBall();
|
|
gameScene.shootBall();
|
|
console.log("踢出去了")
|
|
console.log("踢出去了")
|