Hero image

Multiple Squares

What the code does

Shows you how to draw multiple rectangles (in this case squares) with different colours simultaneously. PTB has excellent support for drawing multiple instances of objects (and as we will see, textures). Rarely should you be using a "for" loop to do this. 

Visualisation

The code

Instagram image Instagram image Instagram image Instagram image Instagram image Instagram image