From: JC Date: Mon, 31 Jul 2023 00:46:25 +0000 (-0500) Subject: Actually allow selecting grid rectangle now X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=0768384bf238c3e62ea456ed81bd9bc427705fc1;p=life-pd.git Actually allow selecting grid rectangle now This is a bit like snake! --- diff --git a/source/main.lua b/source/main.lua index f96c0b4..913d60c 100644 --- a/source/main.lua +++ b/source/main.lua @@ -20,8 +20,16 @@ function playdate.update() gfx.drawRect(r.rect) end end + gfx.fillRect(rects[x][y].rect) - if playdate.buttonJustPressed("a") then - playdate.display.setInverted(not playdate.display.getInverted()) + + if playdate.buttonJustPressed("right") then + x = math.min(10, x + 1) + elseif playdate.buttonJustPressed("left") then + x = math.max(1, x - 1) + elseif playdate.buttonJustPressed("up") then + y = math.max(1, y - 1) + elseif playdate.buttonJustPressed("down") then + y = math.min(10, y + 1) end end