This challenge started out being very ambitious. Between the little time and the difficulties that I have faced, I have made a rather regrettable code, but it is functional and meets the specifications and I hope to improve it later if I have time for it.
In this challenge, I have to thank the great help that many colleagues have given me, especially Álvaro, Carlos, Diego and Joan. For those long nights "picando código".
- JavaScript (high percentage).
- HTML.
- CSS.
- To do the random luck I documented here. This is the part of the code:
const getRandomArbitrary = (min, max) => {
return Math.floor(Math.random()) * (max - min) + min;
}
let fluke = getRandomArbitrary(1,rival.luck);
- To make the progress bar of life I documented here. This is the part of the code:
<progress id="healthPlayer1" value="200" max="200" min="0"></progress>
- To put audio I documented here. This is the part of the code:
<audio src="./audio/Pokemon_Gold_Silver_Battle.mp3" autoplay></audio>
JS:
const reset = document.getElementById('reset');
reset.addEventListener('click', () => {
alert('Game over... loadding');
window.location.reload();
})
HTML:
<div class="resetButton">
<button class="reset" id="reset">Game Over</button>
</div>
- I found and documented how to put different fonts here.
The operation is simple. You press start, choose three characters per teams and then attack. To listen to the music you have to allow automatic playback in your browser. Simple for so many hours.
The fighting game I have deployed on GitHub page. Here you can see the final result of the project.