# 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 on other sites
I decided this may be a better question for the .NET forum...So I posted it over there..

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627680
• Total Posts
2978610

• 13
• 12
• 10
• 12
• 22