summaryrefslogtreecommitdiffhomepage
path: root/not/SceneManager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'not/SceneManager.lua')
-rw-r--r--not/SceneManager.lua23
1 files changed, 14 insertions, 9 deletions
diff --git a/not/SceneManager.lua b/not/SceneManager.lua
index 755548a..367a4c0 100644
--- a/not/SceneManager.lua
+++ b/not/SceneManager.lua
@@ -1,12 +1,17 @@
--- Pretend you didn't see this
--- This is work for scene manager
--- TODO: Create SceneManager or similar class.
-Scene = nil
-musicPlayer = require("not.MusicPlayer")()
+--- `SceneManager`
+-- Used for changing single active scene.
+-- TODO: Extend functionality for more than one active scene (eg. overlay menu).
+SceneManager = require "not.Object":extends()
-function changeScene (scene)
- if Scene ~= nil then
- Scene:delete()
+function SceneManager:changeScene (scene)
+ if self.scene ~= nil then
+ self.scene:delete()
end
- Scene = scene
+ self.scene = scene
end
+
+function SceneManager:getScene ()
+ return self.scene
+end
+
+return SceneManager