Game rules:
- Just try to hit the mole.
- Start with easy level then proceed to medium and hard level.
Play the game
Learn JavaScript by Building Games 3
Steps to do this project
- Create a function to randomly position the mole to appear.
- Create a function to check if the player hit the mole and update the score accordingly.
- Create a function to give different speeds according to the level chosen.
- Create a function to start the game CountDown when started.
- A function that starts/calles all the above functions when clicked START game and
JavaScript methods and properties used :
.querySelectorAll()
.querySelector()
.ForEach()
.classList.add()
.classList.remove()
Math.random()
Math.floor()
.addEventListener()
.textContent
setInterval()
clearInterval()
If you want to use the same mole download the mole.png from this repository.