Hello.
Personally, I'd:
- hold the tiles in an array, not a list;
- apply a global decal offset to the values;
- create images instead of drawing rects.
The difficulty is that every inner loop you're iterating through all the tiles 24 times, regardless of if they're on screen or not, and then iterating through them once again 24 times to display them (again regardless of if they're on screen or not). That's a lot of tiles.
If you're not sure what I mean, reduce the number of rows to 1 and then increase the number of rows to 10000 to see a change in the time taken. t remains constant for each value.
Goodbye.
Personally, I'd:
- hold the tiles in an array, not a list;
- apply a global decal offset to the values;
- create images instead of drawing rects.
The difficulty is that every inner loop you're iterating through all the tiles 24 times, regardless of if they're on screen or not, and then iterating through them once again 24 times to display them (again regardless of if they're on screen or not). That's a lot of tiles.
If you're not sure what I mean, reduce the number of rows to 1 and then increase the number of rows to 10000 to see a change in the time taken. t remains constant for each value.
Goodbye.