Jump to content
  • Advertisement
Sign in to follow this  
ArchG

Tile Based Scrolling RPG Speed & Map Size Question

This topic is 4001 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!