Need a clean TileMap example in XNA

Several friends and I have been working on the XNA RPG once a week for the past year. Our combat engine is basically finished, and now we are working on reconnaissance in the world.

I have already created the rude Tile and TileMap objects that work this way:

  • A simple 2D array of integer values ​​representing tile (Texture2D) objects in a list
  • Using a For loop to render a TileMap that matches the screen size

The question is, how can I change this to achieve such a function?

  • Make maps larger than the screen
  • Scroll smoothly around the TileMap, just draw what you need (e.g. a visible view)

FOOTNOTE: I tried to get the scroll to work, but maybe used the wrong approach to achieve this (i.e. rendering tile sections to achieve smooth scrolling). However, this never worked, and it would be great if I could find something that would basically draw the TileMap window.

Any additional links or external sources will also be welcome. Even pseudo-code example ideas would help a lot.

+3
source share
1 answer

You can find the Nick Gravelyn Tile Engine useful information.

+4
source

Source: https://habr.com/ru/post/1770004/


All Articles