From 0768384bf238c3e62ea456ed81bd9bc427705fc1 Mon Sep 17 00:00:00 2001 From: JC Date: Sun, 30 Jul 2023 19:46:25 -0500 Subject: [PATCH] Actually allow selecting grid rectangle now This is a bit like snake! --- source/main.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 -- 2.20.1