Lab 43 Reflection

     Lab 43 was about creating an online whack-a-mole game. The game would start after a button was clicked and would go on for several seconds, with a score counter keeping track of how many times the user clicked a mole. In my HTML, I set up a total of 12 divs, 6 for the holes and 6 for the moles, however, using JS and CSS, only one of the mole divs would be visible at a time. I set the background url of these divs to the image I wanted and focused on creating the function for the button. Using .addEventListener(), whenever the button was clicked, a function was called that would set the initial score to 0, use a random number generator to decide which mole div to make visible, added to the score count whenever a mole was clicked, and timed the game to end after a specific period.
     These skills are important to a web designer because they can make a website appealing to demographics that like gaming. This game was basically a culmination of the skills we learned to make a website interactive, a utilization that made them do more than make a button change some CSS. Such use of JS is great for game development environments, where complex operations are needed to provide a good gameplay experience. It opens up the possibility for a website to be more than boring text and perhaps host a fun game.

Comments

Popular Posts