draw bar healt after attack
| | |
| | | monsterHealth: 100, |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | computed: { |
| | | monsterBarStyle(){ |
| | | return {width: this.monsterHealth + '%'} |
| | | }, |
| | | playerBarStyle(){ |
| | | return {width: this.playerHealth + '%'} |
| | | }, |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | | attackMonster() { |
| | |
| | | <section id="monster" class="container"> |
| | | <h2>Monster Health</h2> |
| | | <div class="healthbar"> |
| | | <div class="healthbar__value"></div> |
| | | <div |
| | | class="healthbar__value" |
| | | :style="monsterBarStyle" |
| | | ></div> |
| | | </div> |
| | | </section> |
| | | <section id="player" class="container"> |
| | | <h2>Your Health</h2> |
| | | <div class="healthbar"> |
| | | <div class="healthbar__value"></div> |
| | | <div |
| | | class="healthbar__value" |
| | | :style="playerBarStyle" |
| | | ></div> |
| | | </div> |
| | | </section> |
| | | <section id="controls"> |
| | | <button>ATTACK</button> |
| | | <button @click="attackMonster">ATTACK</button> |
| | | <button>SPECIAL ATTACK</button> |
| | | <button>HEAL</button> |
| | | <button>SURRENDER</button> |