0

COMPLETE EDIT:

After reading comments, I changed to a Timer with Timer(33,this);, however on my laptop it's repeating at 47 (and constantly bouncing around to other numbers) whereas my computer stays at the perfect 33.

Is there a common problem with timers I'm missing here? Thanks.

3 Answers3

4

I dont think you are taking the right approach, you shouldn't try to keep all the computers running at the same FPS, in fact no game that I know does that. Instead you should make sure that every x fraction of time the same movements happen regardless of the fps for that particular computer.

Oscar Gomez
  • 18,436
  • 13
  • 85
  • 118
1

Time Based Animation is what you want to be looking at.

Jasoneer
  • 2,078
  • 2
  • 15
  • 20
1

Use javax.swing.Timer, as shown in this AnimationTest.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045