diff --git a/CHANGELOG.md b/CHANGELOG.md index 4623dc1..7405140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - **gamecore:** updated to 0.5.0 +### Fixed + +- **worldmap:** use gamecore 0.5.0-style key handling + ## Imperium-Porcorum 0.0.1 - Initial pre-alpha released based on source status before starting port to gamecore 0.5.0 diff --git a/imperium-porcorum.love/scenes/worldmap/init.lua b/imperium-porcorum.love/scenes/worldmap/init.lua index 5146aab..6d269d0 100644 --- a/imperium-porcorum.love/scenes/worldmap/init.lua +++ b/imperium-porcorum.love/scenes/worldmap/init.lua @@ -37,22 +37,23 @@ function WorldMap:registerDot(dot) end function WorldMap:update(dt) - if (self.keys["up"].isDown) and (self.cursor.canMove) then + local keys = self.sources[1].keys + if (keys["up"].isDown) and (self.cursor.canMove) then self.cursor.y = math.max(0, self.cursor.y - 1) self.cursor.canMove = false end - if (self.keys["down"].isDown) and (self.cursor.canMove) then + if (keys["down"].isDown) and (self.cursor.canMove) then self.cursor.y = math.min(12, self.cursor.y + 1) self.cursor.canMove = false end - if (self.keys["right"].isDown) and (self.cursor.canMove) then + if (keys["right"].isDown) and (self.cursor.canMove) then self.cursor.x = math.min(27, self.cursor.x + 1) self.cursor.canMove = false end - if (self.keys["left"].isDown) and (self.cursor.canMove) then + if (keys["left"].isDown) and (self.cursor.canMove) then self.cursor.x = math.max(0, self.cursor.x - 1) self.cursor.canMove = false end @@ -77,7 +78,7 @@ function WorldMap:update(dt) self.cursor.canMove = true end - if (self.keys["A"].isPressed) and (self.cursor.canMove) then + if (keys["A"].isPressed) and (self.cursor.canMove) then if (self.cursor.dotAtPoint ~= nil) then self.cursor.dotAtPoint:action() end