Hi all,
This is my first time building an really interactive game. I use setInterval to do something, then call a function called nextThing() which is my attempt to keep synchronicity while determining the next thing to be done.
Unfortunately I am finding it very hard to keep track of the state of my application (e.g. when is it playing a pattern? When is it listening to user input?).
I would love some feedback on my JavaScript code structure. I am aware that it is a mess and there are function calls and state setting all over the place. I just don’t know how to approach the problem of keeping track of the applications state!
The main issue is that I only want certain actions to be performed AFTER setInterval has finished playing a sequence. The only way to do that is by calling functions INSIDE setInterval(function(){/*here/}, time).
Any advice in that regard would be very helpful, here is the pen:
Many thanks for your time and feedback!
(and that’s it, I’m done with the Frontend Course, thank you FreeCodeCamp!!!)