summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua7
1 files changed, 4 insertions, 3 deletions
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