Unfortunately I have to focus on finishing my homework and then going to sleep right now. If I get back home tomorrow and the problem isn't solved I'll make sure to give your code a good look over. Until then you can read about game loops here:
http://www.java-gaming.org/topics/game-loops/24220/view.htmlYour code runs at 60fps for me (I use a i5), I had to remove a few lines that were giving me errors though, here is everything I deleted
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| import me.astrodev.hoodoo.gui.Button; import me.astrodev.hoodoo.gui.ButtonListener;
public Keys keys = new Keys();
this.addKeyListener(new InputHandler(keys));
keys.release();
@Override public void buttonPressed(Button button) {
} |
You can add the following lines of code to your render method to see the fps (I may be wrong, I added them and saw 60 (I also ran a different program, Fraps, that confirmed it running at 60, so I assume the following lines are accurate)
1 2 3
| g.setColor(Color.YELLOW); g.drawString(Integer.toString(fps), 100, 100); g.setColor(Color.BLACK); |
EDIT: I'm also still learning Java so I feel I won't be able to accurately state your problem, the two top things things would be to check out the link I provided and check out those lines I deleted since I was able to run your code smoothly.