gamecore/scenemanager: let the scene manager handle directly the world
This commit is contained in:
parent
23f17491ad
commit
df4d264c21
4 changed files with 10 additions and 8 deletions
|
@ -51,8 +51,6 @@ function TestScene:update(dt)
|
|||
local i = math.floor(self.i)
|
||||
|
||||
self.estImpair = (math.floor(i / 2) ~= (i / 2))
|
||||
|
||||
self.world:update(dt)
|
||||
end
|
||||
|
||||
function TestScene:mousepressed(x, y)
|
||||
|
@ -79,8 +77,6 @@ function TestScene:draw()
|
|||
|
||||
utils.graphics.resetColor()
|
||||
end
|
||||
|
||||
self.world:draw()
|
||||
end
|
||||
|
||||
return TestScene
|
||||
|
|
|
@ -37,11 +37,11 @@ function MovePlayer:new()
|
|||
end
|
||||
|
||||
function MovePlayer:update(dt)
|
||||
self.world:update(dt)
|
||||
|
||||
end
|
||||
|
||||
function MovePlayer:draw()
|
||||
self.world:draw()
|
||||
|
||||
end
|
||||
|
||||
return MovePlayer
|
||||
|
|
|
@ -39,11 +39,11 @@ function Plateformer:new()
|
|||
end
|
||||
|
||||
function Plateformer:update(dt)
|
||||
self.world:update(dt)
|
||||
|
||||
end
|
||||
|
||||
function Plateformer:draw()
|
||||
self.world:draw()
|
||||
|
||||
end
|
||||
|
||||
return Plateformer
|
||||
|
|
|
@ -67,6 +67,9 @@ function SceneManager:update(dt)
|
|||
self.currentScene:setKeys()
|
||||
self.currentScene.assets:update(dt)
|
||||
self.currentScene.menusystem:update(dt)
|
||||
if (self.currentScene.world ~= nil) then
|
||||
self.currentScene.world:update(dt)
|
||||
end
|
||||
self.currentScene:update(dt)
|
||||
end
|
||||
end
|
||||
|
@ -109,6 +112,9 @@ function SceneManager:draw()
|
|||
if (self.currentScene ~= nil) then
|
||||
self.currentScene:draw(dt)
|
||||
self.currentScene.menusystem:draw()
|
||||
if (self.currentScene.world ~= nil) then
|
||||
self.currentScene.world:draw()
|
||||
end
|
||||
end
|
||||
self.controller.screen:cease()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue