gamecore/scenes: add a wrapper around Scene changing

This commit is contained in:
Kazhnuz 2019-03-16 15:04:55 +01:00
parent 3b77a3c2c1
commit 4c71e262bb
2 changed files with 5 additions and 1 deletions

View File

@ -40,7 +40,7 @@ function Scene:new()
end
function Scene:register()
core.scenemanager.currentScene = self
core.scenemanager:setScene(self)
end
function Scene:update(dt)

View File

@ -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