How to render a scrolling tile-map in Macro-Quad?

I am rendering a HUGE map from a .txt file, but i do not know how to render the tiles in a grid.

Can you tell us what you've tried already or possible approaches you had in mind?

I have tried using a FOR loop and iterating a vector

I did it once with MacroQuad but now switched to Bevy.
You can still find the code here:

Basically you need two for loops one for the columns and one for the rows.
And inside the loops the current tile is determined and chosen from the texture atlas / sprite sheet and then drawn to screen.
If your tilemap does not fill up the whole screen you have to do some clipping when drawing the tiles.

Hope this helps.

Should i something like this?

for i in &tile_list {
  //My Custom function        
  blit(grass, *i, 100.0, 32.0, 32.0)

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.