Controlling FPS rating

Hello!



Is there any way to control the FPS rating?? I need to keep my game running around 50 FPS…



Thanks!

Try using FixedFramerateGame, it will throttle framerates.

Hello again!



I read the FixedFramereateGame's API, I found it very good, thoug I don't know where to use it in my code, since I'm using the SimpleGame class as my project's base.



Thanx!

Easiest way for your case:



extend FixedFramerateGame



copy update, render, initSystem, initGame methods from SimpleGame into your application.



copy variables from SimpleGame into your application.



That should be enough to do what you need.

Hi!



I invoked the method setFrameRate(int fps) inside the method initSystem(), and it worked wonderfully!

Did I used that method in the right place? Invoking it in some other local would enhance game performance?



Thx!!!

initSystem is fine (that method is called once, and setFrameRate only needs to be called once).