From: JC Date: Mon, 31 Jul 2023 00:39:49 +0000 (-0500) Subject: Turn rect values in to maps X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=59bc5140c49e935fa72f154ea7b7c32b5a2bad88;p=life-pd.git Turn rect values in to maps This will be useful later for determining live/deadness --- 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