Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/2f224fcbe9c48e2b6d8344cd4e30941c to your computer and use it in GitHub Desktop.
Save parzibyte/2f224fcbe9c48e2b6d8344cd4e30941c to your computer and use it in GitHub Desktop.
// 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