flappy-svg
flappy-svg copied to clipboard
Use one timer for the game loop
threading.js uses several timers. This can be reduced to one timer per interval. The problem with many timers is that they tend to schedule differently when you use them for a long time. This can be seen as the obstacles move where they should not.
Leave a comment of you want to work on this issue.
will like to work on this.
Sure, go ahead!
how to get started here? as I have no idea about this.
If you have a look at threading.js line 38, you see that every action starts its own interval. We can reduce the number of started intervals to only one that performs all actions. That is the idea. How would you go about it?
@niccokunzmann but looking at the above code you mentioned, it seems every action have its interval set to null, I'm not getting what exactly is it dong here. and which one should be the action which should contain the interval to start all the actions?
There will be one timeout for all actions. You can put it in a global variable, if you like.
@SilentFlame updates pls?