// Método que muestra la alerta indicando que el jugador ha perdido; después | |
// de mostrarla, se reinicia el juego | |
indicarFracaso() { | |
Swal.fire({ | |
title: "Perdiste", | |
html: ` | |
<img class="img-fluid" src="./img/perdiste.png" alt="Perdiste"> | |
<p class="h4">Agotaste tus intentos</p>`, | |
confirmButtonText: "Jugar de nuevo", | |
allowOutsideClick: false, | |
allowEscapeKey: false, | |
}) | |
.then(this.reiniciarJuego) | |
}, | |
// Mostrar alerta de victoria y reiniciar juego | |
indicarVictoria() { | |
Swal.fire({ | |
title: "¡Ganaste!", | |
html: ` | |
<img class="img-fluid" src="./img/ganaste.png" alt="Ganaste"> | |
<p class="h4">Muy bien hecho</p>`, | |
confirmButtonText: "Jugar de nuevo", | |
allowOutsideClick: false, | |
allowEscapeKey: false, | |
}) | |
.then(this.reiniciarJuego) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment