gamecore/scenes: add a wrapper around Scene changing
This commit is contained in:
parent
3b77a3c2c1
commit
4c71e262bb
2 changed files with 5 additions and 1 deletions
|
@ -40,7 +40,7 @@ function Scene:new()
|
|||
end
|
||||
|
||||
function Scene:register()
|
||||
core.scenemanager.currentScene = self
|
||||
core.scenemanager:setScene(self)
|
||||
end
|
||||
|
||||
function Scene:update(dt)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue