Lab 43: Whack A Mole
Link to Lab 43:
For this lab, we made a fully functional whack a mole game that generates mole at different time intervals, at different holes, and keeps score. While this may seem like there is a lot of JavaScript involved, but honestly, it is a lot less than anyone would expect. There are some main functions such as a function that makes it so a mole is generated at a random hole by having a number assigned to each hole and then generating a random number within the interval and setting the mole to that number hole. There is also a function to make the mole appear at different time intervals. There is a function to start the game and a function that keeps score. Whack-a-mole is a common game and it is nice to know the actual code behind it and it shows that even though something may seem complicated at first, using the right method, it can be very easy.
For this lab, we made a fully functional whack a mole game that generates mole at different time intervals, at different holes, and keeps score. While this may seem like there is a lot of JavaScript involved, but honestly, it is a lot less than anyone would expect. There are some main functions such as a function that makes it so a mole is generated at a random hole by having a number assigned to each hole and then generating a random number within the interval and setting the mole to that number hole. There is also a function to make the mole appear at different time intervals. There is a function to start the game and a function that keeps score. Whack-a-mole is a common game and it is nice to know the actual code behind it and it shows that even though something may seem complicated at first, using the right method, it can be very easy.

Comments
Post a Comment