views:

45

answers:

1

A few friends and myself have been working on an XNA RPG once a week for the last year. Our battle engine is basically finished, and now we're working on overworld exploration.

I've already created crude Tile and TileMap objects that work in this way:

  1. Simple 2D array of integer values representing tile (Texture2D) objects in a List
  2. Using a For loop to render the TileMap which is exactly the size of the screen

The question is, how can I alter this to achieve functionality like this?

  1. Make maps that are larger than the screen
  2. Smoothly scroll around the TileMap, only drawing what is necessary (e.g. Viewport visible)

FOOTNOTE: I've been trying to get scrolling working, but was maybe using the wrong approach to achieve it (i.e. Rendering sections of tiles to achieve the smooth scrolling appearance). This never worked right, however, and it would be great if I could find something that would basically draw a viewport of the TileMap.

Also, any additional links or outside sources would be greatly appreciated. Even pseudocode example ideas would help tremendously.

+1  A: 

You might find Nick Gravelyn's Tile Engine series helpful.

smack0007
Thank you, this is what I was hoping to find!
C. Griffin