Sign in to follow this  
Siriion

[java] Dynamic Java Framework

Recommended Posts

Hey. Ok, so I've been trying to write a dynamic Java animation framework for a while now. What I mean is a framework which updates itself every x amount of loops depending on how much time 1 loop takes. This would be in a while loop, completely independent of a thread. It's been very difficult for me, because I can't quite figure out how it would work. I have the basic concept, and using System.currentTimeMillis was able to write what I thought would work but ended up just failing. Basically, I was wondering if anyone could point me to a tutorial or layout what I should do. And please don't say Google. I tried.

Share this post


Link to post
Share on other sites
It depends on what you're using; First, System.nanoTime() is a more accurate timer - still, if you're using LWJGL, it has its own timer class that handles issues related to this kind of code.

For examples, you might want to check out some of the source code available for the Slick engine, which presents a good 2D animation system. Also, there are other code examples at Kev's site (www.cokeandcode.com).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this