user5199606
user5199606

Reputation:

How to create 10 by 10 grid

I have created this program which currently creates a grid of x rows and y columns, however always displays a 4X4 grid, even if you enter 10 rows 10 columns. How would you create a 10 by 10 grid?

Upvotes: 1

Views: 154

Answers (1)

Micheal O'Dwyer
Micheal O'Dwyer

Reputation: 1261

The main problem with the original code is that all of the tiles are being displayed as white. I believe the reason there are black borders in the original example is, because of the how the co-ordinates worked out. Many of the co-ordinates end in .5, which are rounded by pygame. So, as a result, your program creates an 8X8 grid, but doesn't display them correctly, and borders are only seen after every 2 tiles.

Upvotes: 1

Related Questions