posted 11 years ago
Like in topic. I created a simple game prototype, and don't know why is it running very slow and taking 30% (!) of computer CPU power. Can someone look at this code an explain me where am I making performance errors?
This prototype is showing controlable ship at the middle of screen and planet with moon orbiting it, you can also shoot with space key. It should run at 60 FPS, but real speed seems to be much slower, at 20, maybe 25 FPS.
I am posting the whole code, but I think problem is somewhere in main loop or painting.
Frame.Java (main):
Painting.Java:
Bullet.Java: