From a8d4e12ad0763edd8b199f42fdc23cd4a3730bc7 Mon Sep 17 00:00:00 2001 From: eipporko Date: Fri, 23 Feb 2024 17:31:11 +0100 Subject: [PATCH] Update LoveAStar visual demo for compatibility with LOVE 2D 11.3 --- conf.lua | 12 ++++++------ main.lua | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conf.lua b/conf.lua index cbcbb81..82fd4ad 100644 --- a/conf.lua +++ b/conf.lua @@ -2,13 +2,13 @@ function love.conf(t) t.title = "AStarDemo" t.author = "MarekkPie" t.identity = nil - t.version = "0.8.0" + t.version = "11.3.0" t.console = false - t.screen.width = 800 - t.screen.height = 800 - t.screen.fullscreen = false - t.screen.vsync = true - t.screen.fsaa = 0 + t.window.width = 800 + t.window.height = 800 + t.window.fullscreen = false + t.window.vsync = true + t.window.fsaa = 0 t.modules.joystick = false t.modules.audio = false t.modules.keyboard = true diff --git a/main.lua b/main.lua index f0fc4d1..05b0551 100644 --- a/main.lua +++ b/main.lua @@ -299,7 +299,7 @@ function love.mousepressed(x,y,b) local gr, gc = findGridPosition(x, y, wallMap, NODEWIDTH, NODEHEIGHT) if gr ~= -1 then if love.keyboard.isDown("rshift", "lshift") then - if b == "l" then + if b == 1 then if not (gc == startGridPos.c and gr == startGridPos.r) and not (gc == exitGridPos.c and gr == exitGridPos.r) then if wallMap[gr][gc].wall then @@ -311,11 +311,11 @@ function love.mousepressed(x,y,b) end else if not wallMap[gr][gc].wall then - if b == "l" and + if b == 1 and not (gc == exitGridPos.c and gr == exitGridPos.r) then startGridPos.c = gc startGridPos.r = gr - elseif b == "r" and + elseif b == 2 and not (gc == startGridPos.c and gr == startGridPos.r) then exitGridPos.c = gc exitGridPos.r = gr