I'm currently creating a drawing program using pygame. Ti draw, I'm using a pixarray. I want the drawing size to be changeable, so I set up my pixarray like this:
pixArray[p1+i][p2+i] = mousecolor
pixArray[p1-i][p2+i] = mousecolor
pixArray[p1+i][p2-i] = mousecolor
pixArray[p1-i][p2-i] = mousecolor
where i is coming from
for i in range(0,size):
Currently, this draws the pixels in a x shape. How do I make it draw a square?
To get a square you need to loop over 2 dimensions, for example like this:
You can't make a quadratic number of points with one linear loop.