Sign in to follow this  
ArchG

Tile Based Scrolling RPG Speed & Map Size Question

Recommended Posts

Hello, I'm making a small top down tile-based game with XNA and C#, that I want to be smooth scrolling. The player will always stand in the middle of the map and the map will scroll underneath him, unless he's near the edge of a map, in which case he will walk towards the edge. I'm using 32x32 tiles, and my map is currently 128x128, I have 2 background layers and 2 foreground layers and an attribute layer (for walls/warps/etc). I'm wondering how much of the map I can show at one time and still have it run rather fast? I currently am showing a 10x10 section of the map and it seems fine, but i'm wondering how big I could go before the game would start slowing down alot (if it would at all?) my map drawing code is like this
for (int x =0; x<11; x++)
{
   for (int y = 0; y<11; y++)
   {
      DrawBackgroundTile(currentMap.background1[x,y]);
      DrawBackgroundTile(currentMap.background2[x,y]);
   }
}
DrawPlayers();
for (int x =0; x<11; x++)
{
   for (int y = 0; y<11; y++)
   {
      DrawBackgroundTile(currentMap.foreground1[x,y]);
      DrawBackgroundTile(currentMap.foreground2[x,y]);
   }
}
for example...could I show a 20x20 section and have it scroll with no problem? I would try it out...but it's quite a bit of code to change if it wouldn't work properly... Thanks in Advance, ArchG

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this