From 08ed4002fa471b60ac572a2ecae48d17310d0512 Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Fri, 27 Dec 2024 00:49:53 +0100
Subject: [PATCH] implement restart game, surrender

---
 04 - monster slayer game/prj-monster-01-starting-setup/index.html |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/04 - monster slayer game/prj-monster-01-starting-setup/index.html b/04 - monster slayer game/prj-monster-01-starting-setup/index.html
index e521d09..ef89d35 100644
--- a/04 - monster slayer game/prj-monster-01-starting-setup/index.html
+++ b/04 - monster slayer game/prj-monster-01-starting-setup/index.html
@@ -31,17 +31,18 @@
       </section>
       <section class="container" v-if="winner">
         <h2>Game Over!</h2>
-        <h3 v-if="winner == 'monster'">You lost!</h3>
-        <h3 v-else-if="winner == 'player'">You won!</h3>
+        <h3 v-if="winner === 'monster'">You lost!</h3>
+        <h3 v-else-if="winner === 'player'">You won!</h3>
         <h3 v-else>It's a Draw</h3>
+        <button @click="startGame">Start new game</button>
       </section>
-      <section id="controls">
+      <section id="controls" v-else>
         <button @click="attackMonster">ATTACK</button>
         <button @click="specialAttackMonster" :disabled="mayUseSpecialAttack">
           SPECIAL ATTACK
         </button>
         <button @click="healPlayer">HEAL</button>
-        <button>SURRENDER</button>
+        <button @click="surrender">SURRENDER</button>
       </section>
       <section id="log" class="container">
         <h2>Battle Log</h2>

--
Gitblit v1.8.0