add a method to surrender the game
This commit is contained in:
parent
a31d971291
commit
f61cd7af9f
|
@ -95,7 +95,9 @@ const app = Vue.createApp({
|
||||||
}
|
}
|
||||||
this.attackPlayer();
|
this.attackPlayer();
|
||||||
},
|
},
|
||||||
surrender() {},
|
surrender() {
|
||||||
|
this.winner = "monster";
|
||||||
|
},
|
||||||
attackPlayer() {
|
attackPlayer() {
|
||||||
this.playerHealth -= getRandomValue(8, 15);
|
this.playerHealth -= getRandomValue(8, 15);
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<button @click="attackMonster">ATTACK</button>
|
<button @click="attackMonster">ATTACK</button>
|
||||||
<button :disabled="specialAttackAllowed" @click="specialAttackMonster">SPECIAL ATTACK</button>
|
<button :disabled="specialAttackAllowed" @click="specialAttackMonster">SPECIAL ATTACK</button>
|
||||||
<button @click="healPlayer">HEAL</button>
|
<button @click="healPlayer">HEAL</button>
|
||||||
<button>SURRENDER</button>
|
<button @click="surrender">SURRENDER</button>
|
||||||
</section>
|
</section>
|
||||||
<section id="log" class="container">
|
<section id="log" class="container">
|
||||||
<h2>Battle Log</h2>
|
<h2>Battle Log</h2>
|
||||||
|
|
Reference in New Issue