From 8f9182baff36d33c07c5eb8df795e3cfcd5307a5 Mon Sep 17 00:00:00 2001 From: cursed22bc Date: Sun, 1 Mar 2026 11:17:23 +0200 Subject: improved tileset and load --- main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index e44d670..3f25812 100644 --- a/main.lua +++ b/main.lua @@ -16,7 +16,8 @@ local camera = nil local fonts = require("fonts") local currentState = "game" -local currentLevel = "assets/maps/tilemap1.lua" +local currentMapPath = "assets/maps/tilemap.lua" +local currentTilesetPath = "assets/maps/tileset.png" local world = nil local states = { @@ -36,9 +37,9 @@ end function states.game.load() local World = require("world") world = World:new() - world:load(currentLevel) + world:load(currentMapPath, currentTilesetPath) local target = world:getPlayer() or { x = 0, y = 0, width = 16, height = 16 } - camera = cameraModule:new(target, VIRTUAL_WIDTH/3, VIRTUAL_HEIGHT/3, true, WORLD_TO_CANVAS) + camera = cameraModule:new(target, VIRTUAL_WIDTH/2, VIRTUAL_HEIGHT/2, true, WORLD_TO_CANVAS) world:setCamera(camera) end -- cgit v1.2.3