For loop iteration, table iteration, and rectangles drawn diagonally
local pd <const> = playdate
local gfx <const> = playdate.graphics
-local r = pd.geometry.rect.new(0, 0, 32, 32)
+local rects = {}
+for i=1, 10 do
+ rects[i] = pd.geometry.rect.new(32 * (i-1), 32 * (i-1), 32, 32)
+end
function playdate.update()
- gfx.drawRect(r)
+ for i,r in ipairs(rects) do
+ gfx.drawRect(r)
+ end
if playdate.buttonJustPressed("a") then
playdate.display.setInverted(not playdate.display.getInverted())
end