Another day, another game. This time I wanted to do JDs Click Challenge, and I had no idea how to do this project. I almost gave up, but asked for help and the BF helped me through (as always).
As always, I learned something today:
- I think the most important lesson today is that I shouldn’t give in to the initial panic that I experience. When I relax I actually have gotten a few things under my belt, and I feel much more comfortable than I did just some projects ago. As the BF advised me; just start with the HTML (which feels really easy at the moment) and then go on to hooking up the buttons. Because those things I have understood quite well now.
- Started with a variable that holds the sum of the number of clicks the user has made.
- I used the setTimeout to switch to the result-page after 30 seconds.
- To get the number of clicks per second, I made a variable that holds the sum of clicked divided by 30. At first this number had quite a few decimals (much more than I wanted), so the BF told me that I could use a function called .toFixed(number of decimals you want) that will fix the number of decimals.
- Also I made sure to set the sum to 0 after the 30 seconds has passed.