diff --git a/gamecore/modules/scenes.lua b/gamecore/modules/scenes.lua index a1840ca..d60f442 100644 --- a/gamecore/modules/scenes.lua +++ b/gamecore/modules/scenes.lua @@ -25,8 +25,12 @@ local cwd = (...):gsub('%.scenes$', '') .. "." local Scene = Object:extend() -local Assets = require(cwd .. "assets") -local MenuSystem = require(cwd .. "menusystem") + +local Assets = require(cwd .. "assets") +local MenuSystem = require(cwd .. "menusystem") + +-- INIT FUNCTIONS +-- Initialize and configure the scene function Scene:new() self.mouse = {} @@ -46,10 +50,20 @@ function Scene:register() core.scenemanager:setScene(self) end +function Scene:clear() + -- TODO: send automatic cleanups to the different elements of the scene +end + +-- UPDATE FUNCTIONS +-- Handle stuff that happens every steps + function Scene:update(dt) -- Empty function, is just here to avoid crash end +-- MOUSE FUNCTIONS +-- Make the scene support the pointer + function Scene:mousemoved(x, y, dx, dy) -- Empty function, is just here to avoid crash end @@ -58,13 +72,15 @@ function Scene:mousepressed( x, y, button, istouch ) -- Empty function, is just here to avoid crash end +-- DRAW FUNCTIONS +-- Draw the scene and its content + function Scene:draw() end -function Scene:clear() - -end +-- KEYBOARD FUNCTIONS +-- Handle inputs from keyboard/controllers function Scene:setKeys() if (self.inputLocked) then