Is there a straight forward way to keep track of game time in Android (java)? For instance in order to keep movement fluid no matter what frame rate, I need to factor in the amount of time which has passed by since the last frame. This is pretty easy to do in XNA (since its all setup for you) but even without a game engine you can still use timeSpan in C#. I tried looking up timespan for java but it doesn’t come up with much or then long hand. Is there an equivalent, short hand way of handling frame to frame timing?
Share
Your game logic should run in a separate thread that is independent of frame rate. Then when refreshing the screen you just draw the objects in their current state.
When you do need to be able to measure time, use SystemClock.elapsedRealTime