diff options
Diffstat (limited to 'src/scenes.js')
-rw-r--r-- | src/scenes.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/scenes.js b/src/scenes.js new file mode 100644 index 0000000..09ea493 --- /dev/null +++ b/src/scenes.js @@ -0,0 +1,30 @@ +import * as PREQUEL from "./scenes/prequel.js" +import * as GAME from "./scenes/game.js" + +export const SCENES = { + PREQUEL: "prequel", + GAME: "game", +} + +export const SCENE = { + load: loadScene, + update: null, + draw: null, +} + +let currentScene + +function loadScene(scene) { + currentScene = scene + if (currentScene == SCENES.PREQUEL) { + PREQUEL.start() + SCENE.update = PREQUEL.update + SCENE.draw = PREQUEL.draw + } + + if (currentScene == SCENES.GAME) { + GAME.start() + SCENE.update = GAME.update + SCENE.draw = GAME.draw + } +} |