On Sat, Nov 15, 2008 at 3:27 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Michael Fiano wrote: >> >> i want to have a faster >> framerate when there is no scrolling by only updating the player and the >> background and foreground contained in it's rect area.
Generally in a scrolling game, depending on how you deal with the camera, the player is scrolling more often than not. In this case there is no gain for a faster framerate when not scrolling. In any case, if there is important gameplay that occurs while the screen may be scrolling, such as dodging an enemy, then you have to make sure everything works at that slower framerate. If it's more like zelda (the first one), where you get a non-scrolling screen and then there is a short scrolling transition when you move off the screen, then your case would make sense. A good thing to do in a tile based game, is to blit all of the tiles to a single surface, so you aren't doing a bunch of blits every frame, and then just redraw the whole screen each frame using the rendered map. If you have animated tiles of course, depending on how many tiles on screen are likely to be animated, this optimization will not be helpful.