04 - monster slayer game/prj-monster-01-starting-setup/app.js
@@ -8,6 +8,7 @@ playerHealth: 100, monsterHealth: 100, currentRound: 0, winner: null, }; }, computed: { @@ -21,7 +22,22 @@ return this.currentRound % 3 !== 0; }, }, watch: {}, watch: { playerHealt(value) { if (value <= 0 && this.monsterHealth <= 0) { this.winner = "draw"; } else if (value <= 0) { this.winner = "moster"; } }, monsterHealth(value) { if (value <= 0 && this.playerHealt <= 0) { this.winner = "draw"; } else if (value <= 0) { this.winner = "player"; } }, }, methods: { attackMonster() { this.currentRound++;