Skip to main content
Edited title to be more clear
Link
Vaughan Hilts
  • 5.5k
  • 2
  • 34
  • 58

C# Monogame Scrolling Tile-Based Maps using Matrix Translate How can I scroll my tile maps?

edited title
Link

C# Monogame Matrix Tile Scrolling Tile-Based Maps using Matrix Translate

Source Link

C# Monogame Matrix Tile Scrolling

I've been trying to understand how I can use matrix to implement a smooth tile scrolling system but I fail miserably.

So I have a pretty big world stored in a multi-dimensional array which is drawn like this :

 for (int i = 0; i < screenHeight / 32; i++)
            for (int j = 0; j < screenWidth  / 32; j++)
               spriteBatch.Draw( texture[i + offsetY][j + offsetX] , screenRectangle[i + offsetY][j + offsetX] , Color.White );

Can somebody give me some tips on what to do or at least explain the logic behind the matrix translation?
Thank you.