Hi, I want to run one function at 30 times per second (game logic)
then I want to run another function at 60 times per second ( graphics)
But if the game is running slow, then I want to reduce the number of times graphics are drawn per second, so the logic can stay constant.
I can set up timers and callback functions but cant seem to work out how to do the rest.
game timing
-
- Posts: 85
- Joined: Mon Sep 27, 2010 5:26 pm
Re: game timing
you can use
with this code the DS will wait 1 screen update!
Code: Select all
swiWaitForVBlank();
Re: game timing
don't do that. don't draw more graphics than game logic executions. it is silly.
definitely do not use timers for anything like this.
you may want to add a vblank handler to count the number of frames that have elapsed, and then each time you go through your main loop, you can consider whether you are so far behind that you should skip drawing a frame. if so, then just skip it and only run the game logic instead. or, if you are safely caught-up, then do both.
definitely do not use timers for anything like this.
you may want to add a vblank handler to count the number of frames that have elapsed, and then each time you go through your main loop, you can consider whether you are so far behind that you should skip drawing a frame. if so, then just skip it and only run the game logic instead. or, if you are safely caught-up, then do both.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest