Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Downsider on January 30, 2011, 02:47:55 am

Title: Framerate limiter?
Post by: Downsider on January 30, 2011, 02:47:55 am
I'd prefer my game run at a constant framerate rather than jumping around, so I'm willing to lower it to a constant 20 FPS to prevent that. Does anybody konw how to set up a framerate limiter in Axe?
Title: Re: Framerate limiter?
Post by: Builderboy on January 30, 2011, 02:52:03 am
Are you familiar with interupts?  Try putting a Stop statement, and set the interrupt for a specific frequency.

If you are looking for the non-interrupt method, might I know why your code runs at so many different speeds?  If we can figure out that, it will most likely work a lot better than the interrupt method.
Title: Re: Framerate limiter?
Post by: Downsider on February 03, 2011, 12:33:58 am
Are you familiar with interupts?  Try putting a Stop statement, and set the interrupt for a specific frequency.

If you are looking for the non-interrupt method, might I know why your code runs at so many different speeds?  If we can figure out that, it will most likely work a lot better than the interrupt method.

Well, some scenes in the game are more intensive than others. That's all. And when you stand still, since the map isn't scrolling, it runs significantly faster, and I'd prefer that the enemies, bullets, etc around you didn't also move faster, so to combat that, I want to lock the framerate.
Title: Re: Framerate limiter?
Post by: Builderboy on February 03, 2011, 12:55:12 am
Ah gotcha.  Hmmmm thats a tricky one, i've really never dealt too much with this, maybe someone else can shed some light?
Title: Re: Framerate limiter?
Post by: Downsider on February 03, 2011, 01:14:12 am
I could easily write one myself if Axe has an accurate clock function, does it have one that returns a time value accurately?
Title: Re: Framerate limiter?
Post by: Builderboy on February 03, 2011, 01:21:34 am
Well interrupts trigger at regular time, no matter what else is executing, so you could use those to your advantage