diff options
author | Aki <nthirtyone@gmail.com> | 2017-07-12 09:31:32 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-07-12 09:31:32 +0200 |
commit | 094f9326d1e3ae6e451b21192b288220a8fab12e (patch) | |
tree | 8f13496fea649801513178b742f3bfc21f6f676b /not/SceneManager.lua | |
parent | 47d4e1c229adfffb70b3c984d00049bcebcfc183 (diff) | |
download | roflnauts-094f9326d1e3ae6e451b21192b288220a8fab12e.zip roflnauts-094f9326d1e3ae6e451b21192b288220a8fab12e.tar.gz roflnauts-094f9326d1e3ae6e451b21192b288220a8fab12e.tar.bz2 |
Basic SceneManager created and partialy replaced old scene managment system
Diffstat (limited to 'not/SceneManager.lua')
-rw-r--r-- | not/SceneManager.lua | 23 |
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 |