added logic for end-game

This commit is contained in:
Kostya
2024-01-23 22:23:42 +03:00
parent 30b6d17075
commit 6390376668
2 changed files with 16 additions and 6 deletions

View File

@@ -6,7 +6,7 @@
<chat-component id="chat"></chat-component>
<section class="saper">
<section class="saper" :class="{ 'game-end' : ValidationPlay.endGame }">
<div class="bg"></div>
<div class="bg-two"></div>
<div class="saper-start" :class="{ 'game-start__menu-off' : gameStart }">
@@ -129,6 +129,10 @@
<div class="start-game" v-if="ValidationPlay.startGame === true">
<h2>Игра началась!</h2>
</div>
<div class="start-game" v-if="ValidationPlay.endGame === true">
<h2>Вы подорвались! Игра закончена</h2>
<a href="#" @click="updatePage()">Продолжить</a>
</div>
</template>
<script>
@@ -172,6 +176,7 @@ export default {
CrystalValidate: false,
DiamondValidate: false,
startGame: false,
endGame: false,
},
modules: [ Navigation ]
}
@@ -268,11 +273,7 @@ export default {
this.gamesCircle = this.gamesCircle + 1
this.offEventPointers = true
if (AnswerServer === 'You dead') {
this.gameStart = false
this.offEventPointers = false
this.flippedCards = []
this.gamesCircle = 0
console.log(this.gameStart, this.offEventPointers)
this.ValidationPlay.endGame = true
}
}
@@ -324,6 +325,9 @@ export default {
this.offEventPointers = true
}
},
updatePage() {
window.location.reload()
},
validationCheck() {
if (this.ValidationPlay.CrystalValidate === true && this.ValidationPlay.DiamondValidate === true) {
return true