Please help. This is the first 2D game I have made that needed animation. I was just trying to make a java game that could be played without having to download any additional plugins like j3d or GL4Java. I have tried various things, such as…
System.currentTimeMillis()
->is widely known as innacurate
sun.misc.Perf
->won’t run in an applet due to the security manager
com.sun.j3d.utils.timer.J3DTimer
->I gave up on avoiding additional downloads in my latest attempt, and I thought it would work out just fine, except on my system I am always getting 0 returned from J3DTimer.getValue() and .getResolution().
The J3DTimer problem is not just my stupid little test code either, the TimerTest.java included in the J3DFlythrough does the same thing on my machine. Does this have to be initialized in some strange way?
If you guys have some suggestions and/or examples that you could point me at that do accurate timing in an applet, I would greately appreceate it.
(added June 2nd)
I thought that there might be at least one person with experience in this area, am I wrong? So, I guess I should just try to cap my framerate at a low value using Thread.sleep(), and give up? I hope there is something left that I havn’t tried yet.