so, I have made a lot of progress since you guys helped me out last time, but I am sadly stuck again. I have added a pause feature, and I want to make it so that you are not able to click any of the buttons when you are paused. Me and my friend have been trying for about 2 days to fix this issue, and we have no idea why it isn't working, so it would me amazing if someone out there could help me out! https://colonize-mars-alpha-135--javakid999.repl.co/
You may need to do some refactoring with your code. Instead of using
setTimeout try using
setInterval while storing the reference to the interval in a globally accessible variable, let's say
updateInterval (implement in the initial script outside of any function to hoist it into the global scope).
You'll then want to pause any updates to the game while the game is paused so you would use
clearInterval(updateInterval) and then when you unpause, you would just reset the interval. I'd store the interval function into its own named function so then you can do something like
I don't have the time to do all of this for you, but you can do it!