From 59bc5140c49e935fa72f154ea7b7c32b5a2bad88 Mon Sep 17 00:00:00 2001 From: JC Date: Sun, 30 Jul 2023 19:39:49 -0500 Subject: [PATCH] Turn rect values in to maps This will be useful later for determining live/deadness --- source/main.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/main.lua b/source/main.lua index 8bda86b..e4c3d58 100644 --- a/source/main.lua +++ b/source/main.lua @@ -5,7 +5,8 @@ local rects = {} for i=1, 10 do rects[i] = {} for j=1, 10 do - rects[i][j] = pd.geometry.rect.new(32 * (i-1), 32 * (j-1), 32, 32) + r = pd.geometry.rect.new(32 * (i-1), 32 * (j-1), 32, 32) + rects[i][j] = { rect = r } end end @@ -13,7 +14,7 @@ end function playdate.update() for i,row in ipairs(rects) do for j,r in ipairs(row) do - gfx.drawRect(r) + gfx.drawRect(r.rect) end end if playdate.buttonJustPressed("a") then -- 2.20.1