I'm sure this has been asked before, but I couldn't find any straightforwards information about the subject.
I'm currently working on making a 2D game using Java2D and I'm using a simple 60fps main-timer and a paint() method with a custom double buffer, and I noticed that at certain points, especially when the computer is under load they can slow down and/or get out of sync for a short while and the results mess up the game flow.
Is there any way to prevent this by forcing graphics sync similar to a commercial game where lack of horsepower will simply lower the "fps" instead of slowing down the game?
I apologize that I couldn't formulate the question better, I'm rather new to making games. (even simple ones)
Other suggestions on how to prevent this would obviously be very welcome.
Not sure if this forum is the right one, but it seemed the most suitable.
Thanks in advance.
Also posted on: Java-Forums.org