Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java 2d physics
#3
Using a Timer class to call it every X milliseconds, I vary between about 5-50ms per frame because the redrawing starts to lag with shorter times, but it is more accurate.

I'm not sure if the thing is meant for animation, it's just the general JFrame. Tutorials online kinda indicate it would clear itself on each call to repaint() but mine doesn't except when I resize the window :x



It does look kinda neat this way, though. Especially using multiple springs ilke that.
[Image: springmotion10me3.png]
Reply


Messages In This Thread
Java 2d physics - by Stereo - 2009-02-05, 10:23 PM
Java 2d physics - by Spaz - 2009-02-06, 08:31 PM
Java 2d physics - by Stereo - 2009-02-06, 11:04 PM
Java 2d physics - by Spaz - 2009-02-07, 03:13 AM
Java 2d physics - by Stereo - 2009-02-07, 01:57 PM
Java 2d physics - by DeadHead - 2009-02-08, 08:42 PM
Java 2d physics - by Stereo - 2009-02-09, 10:30 AM
Java 2d physics - by DeadHead - 2009-02-10, 03:40 AM
Java 2d physics - by Stereo - 2009-02-10, 10:25 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)