diff --git a/gamecore/modules/scenes.lua b/gamecore/modules/scenes.lua index cd082e2..60f378c 100644 --- a/gamecore/modules/scenes.lua +++ b/gamecore/modules/scenes.lua @@ -40,7 +40,7 @@ function Scene:new() end function Scene:register() - core.scenemanager.currentScene = self + core.scenemanager:setScene(self) end function Scene:update(dt) diff --git a/gamecore/scenemanager.lua b/gamecore/scenemanager.lua index ad7c9d6..d5e3166 100644 --- a/gamecore/scenemanager.lua +++ b/gamecore/scenemanager.lua @@ -30,6 +30,10 @@ function SceneManager:new(controller) self.currentScene = nil end +function SceneManager:setScene(scene) + self.currentScene = scene +end + function SceneManager:update(dt) if (self.currentScene ~= nil) then local keys = self.controller.input.keys