Double cell count, make cell size const
authorJC <dev@jacobcasper.com>
Mon, 31 Jul 2023 02:46:50 +0000 (21:46 -0500)
committerJC <dev@jacobcasper.com>
Mon, 31 Jul 2023 02:46:50 +0000 (21:46 -0500)
source/main.lua

index 0b94cc8..62891be 100644 (file)
@@ -1,8 +1,9 @@
 local pd <const> = playdate
 local gfx <const> = playdate.graphics
 
-local WIDTH <const> = 12
-local HEIGHT <const> = 7
+local WIDTH <const> = 24
+local HEIGHT <const> = 14
+local CELL_SIZE <const> = 16
 
 -- Convenience function for iterating over 8 neighbors
 function neighbors(g1, x, y)
@@ -84,7 +85,7 @@ local cells = {}
 for i=1, WIDTH do
     cells[i] = {}
       for j=1, HEIGHT do
-          r = pd.geometry.rect.new(32 * (i-1), 32 * (j-1), 32, 32)
+          r = pd.geometry.rect.new(CELL_SIZE * (i-1), CELL_SIZE * (j-1), CELL_SIZE, CELL_SIZE)
           cells[i][j] = { cell = r, live = false }
       end
 end