-- world module local world = require("world") -- love's load function function love.load() -- set the overall map offset offset = { x = 304, y = 48 } -- generate the world and load the files world.new(20, 20, 3) world.loadTiles() end -- love's update function function love.update(dt) end -- love's key press funciton function love.keypressed(key, scanCode, isRepeat) -- arrow keys for moving offset if key == "left" then offset.x = offset.x + 16 end if key == "right" then offset.x = offset.x - 16 end if key == "up" then offset.y = offset.y + 16 end if key == "down" then offset.y = offset.y - 16 end if key == "escape" then love.event.quit(0) end end -- love's draw function function love.draw() -- clear the window love.graphics.clear() -- draw the map world.render(offset) end