Ticks, Timing and Sleeps oh my!
This LD, some of us from the CubedHost.org team decided to participate and give it a shot, as we had admired the past few compos from afar.
So to pass the time and give me an excuse for procrastinating further, I began work on our base code; just some simple stuff like getting our code skeleton down, a tick system, and a simple window opening and automatically optimizing the framerate. The latter of those three proved to be the most difficult.
Through trial and error I applied different algorithms, ideas and whatnot, in an effort to calculate the current framerate, and essentially figure out how fast it could refresh, without falling behind or eating up all your CPU. Finally, I have found one that I am satisfied with, and although it is by no means perfect, it shall do for now.
As you can see, it’s not too exciting; however, I’m proud. Feel free to look around the code: here.
Enjoy
